Pre Merge pull request !7 from 打豆豆/master

This commit is contained in:
打豆豆 2024-04-08 01:34:17 +00:00 committed by Gitee
commit 5f2c575803
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
155 changed files with 19618 additions and 3726 deletions

View File

@ -1,11 +1,11 @@
# 页面标题
VUE_APP_TITLE = 苦糖果MES-软件开发记录
VUE_APP_TITLE = 智造大师
# 开发环境配置
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = '/prod-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 苦糖果MES-软件开发记录
VUE_APP_TITLE = 智造大师
# 生产环境配置
ENV = 'production'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 苦糖果MES-软件开发记录
VUE_APP_TITLE = 智造大师
NODE_ENV = production

8
.gitignore vendored
View File

@ -18,9 +18,9 @@ selenium-debug.log
*.njsproj
*.sln
*.local
.editorconfig
.eslintignore
.eslintrc.js
.env.*
# .editorconfig
# .eslintignore
# .eslintrc.js
# .env.*
package-lock.json
yarn.lock

View File

@ -1,7 +1,7 @@
{
"name": "ktg-mes-ui",
"version": "3.8.2",
"description": "苦糖果MES",
"description": "智造大师",
"author": "YinJinLu",
"license": "MIT",
"scripts": {
@ -44,9 +44,12 @@
"dhtmlx-gantt": "^7.1.11",
"echarts": "4.9.0",
"element-ui": "2.15.6",
"ezuikit-js": "^0.7.2",
"file-saver": "2.0.5",
"flv.js": "^1.6.2",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"jquery": "^3.7.1",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<title>智造大师</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,

View File

@ -7,13 +7,13 @@
<script>
export default {
name: 'App',
metaInfo() {
return {
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
titleTemplate: title => {
return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
}
}
}
// metaInfo() {
// return {
// title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
// titleTemplate: title => {
// return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
// }
// }
// }
}
</script>

View File

@ -0,0 +1,19 @@
import request from "@/utils/request";
// 查询设备报警列表
export function list(query) {
return request({
url: "/cad/warn/page",
method: "get",
params: query,
});
}
// 修改设备报警
export function edit(data) {
return request({
url: "/cad/warn/edit",
method: "put",
data: data,
});
}

View File

@ -0,0 +1,45 @@
import request from "@/utils/request";
// 查询排班列表
export function list(query) {
return request({
url: "/cad/code/list",
method: "get",
params: query,
});
}
// 新增
export function updateTeam(data) {
return request({
url: "/cad/code/add",
method: "post",
data: data,
});
}
// 修改
export function reviseFile(data) {
return request({
url: "/cad/code/edit",
method: "put",
data: data,
});
}
// 删除
export function delTeam(teamId) {
return request({
url: "/cad/code/" + teamId,
method: "delete",
});
}
// 查询设备列表
export function listMachinery(query) {
return request({
url: "/mes/dv/machinery/list",
method: "get",
params: query,
});
}

View File

@ -0,0 +1,45 @@
import request from "@/utils/request";
// 查询排班列表
export function list(query) {
return request({
url: "/cad/file/list",
method: "get",
params: query,
});
}
// 新增
export function updateTeam(data) {
return request({
url: "/cad/file",
method: "post",
data: data,
});
}
// 修改
export function reviseFile(data) {
return request({
url: "/cad/file",
method: "put",
data: data,
});
}
// 删除
export function delTeam(teamId) {
return request({
url: "/cad/file/" + teamId,
method: "delete",
});
}
// 查询文件类型列表
export function listType(query) {
return request({
url: "/cad/type/list",
method: "get",
params: query,
});
}

View File

@ -0,0 +1,36 @@
import request from "@/utils/request";
// 查询排班列表
export function list(query) {
return request({
url: "/cad/type/list",
method: "get",
params: query,
});
}
// 新增
export function updateTeam(data) {
return request({
url: "/cad/type",
method: "post",
data: data,
});
}
// 修改
export function reviseFile(data) {
return request({
url: "/cad/type",
method: "put",
data: data,
});
}
// 删除
export function delTeam(teamId) {
return request({
url: "/cad/type/" + teamId,
method: "delete",
});
}

View File

@ -1,44 +1,71 @@
import request from '@/utils/request'
import request from "@/utils/request";
// 查询设备列表
export function listMachinery(query) {
return request({
url: '/mes/dv/machinery/list',
method: 'get',
params: query
})
url: "/mes/dv/machinery/list",
method: "get",
params: query,
});
}
// 查询设备详细
export function getMachinery(machineryId) {
return request({
url: '/mes/dv/machinery/' + machineryId,
method: 'get'
})
url: "/mes/dv/machinery/" + machineryId,
method: "get",
});
}
// 查询代码程序列表
export function listMes(query) {
return request({
url: "/cad/code/list",
method: "get",
params: query,
});
}
// 新增设备
export function addMachinery(data) {
return request({
url: '/mes/dv/machinery',
method: 'post',
data: data
})
url: "/mes/dv/machinery",
method: "post",
data: data,
});
}
// 修改设备
export function updateMachinery(data) {
return request({
url: '/mes/dv/machinery',
method: 'put',
data: data
})
url: "/mes/dv/machinery",
method: "put",
data: data,
});
}
// 删除设备
export function delMachinery(machineryId) {
return request({
url: '/mes/dv/machinery/' + machineryId,
method: 'delete'
})
url: "/mes/dv/machinery/" + machineryId,
method: "delete",
});
}
// 新增设备关联通知人
export function UserArr(data) {
return request({
url: "/machinery/User/add",
method: "post",
data: data,
});
}
// 查询设备关联通知人详细信息
export function machineryUsers(query) {
return request({
url: "/machinery/User/machineryUsers",
method: "get",
params: query,
});
}

46
src/api/mes/dv/route.js Normal file
View File

@ -0,0 +1,46 @@
import request from '@/utils/request'
// 查询agv线路
export function findProAgvline(query) {
return request({
url: '/proagv/findProAgvline',
method: 'get',
params: query
})
}
// 自动生成agv线路编码
export function findLineCode(query) {
return request({
url: '/proagv/findLineCode',
method: 'get',
params: query
})
}
// 新增agv线路
export function addProAgvline(data) {
return request({
url: '/proagv/addProAgvline',
method: 'post',
data: data
})
}
// 修改agv线路
export function updateProAgvline(data) {
return request({
url: '/proagv/updateProAgvline',
method: 'post',
data: data
})
}
// 删除agv线路
export function deleteProAgvline(data) {
return request({
url: '/proagv/deleteProAgvline',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,46 @@
import request from '@/utils/request'
// 查询agv站点
export function findProAgvsite(query) {
return request({
url: '/proagvsite/findProAgvsite',
method: 'get',
params: query
})
}
// 自动生成agv站点编码
export function findSiteCode(query) {
return request({
url: '/proagvsite/findSiteCode',
method: 'get',
params: query
})
}
// 新增agv站点
export function addProAgvsite(data) {
return request({
url: '/proagvsite/addProAgvsite',
method: 'post',
data: data
})
}
// 修改agv线路
export function updateProAgvsite(data) {
return request({
url: '/proagvsite/updateProAgvsite',
method: 'post',
data: data
})
}
// 删除agv站点
export function deleteProAgvsite(data) {
return request({
url: '/proagvsite/deleteProAgvsite',
method: 'post',
data: data
})
}

64
src/api/mes/md/pallet.js Normal file
View File

@ -0,0 +1,64 @@
import request from "@/utils/request";
// 分页查询托盘设置列表
export function listMdItem(query) {
return request({
url: "/propallet/findProPallet",
method: "get",
params: query,
});
}
// 新增托盘设置
export function addMdItem(data) {
return request({
url: "/propallet/addProPallet",
method: "post",
data: data,
});
}
// 修改托盘设置
export function updateMdItem(data) {
return request({
url: "/propallet/updateProPallet",
method: "post",
data: data,
});
}
// 删除托盘设置
export function delMdItem(data) {
return request({
url: "/propallet/deleteProPallet",
method: "post",
data: data,
});
}
// 批量删除托盘设置
export function batchDeleteProPallet(itemId) {
return request({
url: "/propallet/batchDeleteProPallet" + "?proPalletIds=" + itemId,
method: "get",
});
}
// 自动生成托盘编码
export function findPalletCode(query) {
return request({
url: "/propallet/findPalletCode",
method: "get",
params: query,
});
}
// 托盘设置导出
export function exportProPallet(query) {
return request({
url: "/propallet/exportProPallet",
method: "get",
params: query,
});
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询工序类型列表
export function listMachinerytype(query) {
return request({
url: '/process/type/list',
method: 'get',
params: query
})
}
// 查询工序类型详细
export function getMachinerytype(processTypeld) {
return request({
url: '/process/type/' + processTypeld,
method: 'get'
})
}
// 新增工序类型
export function addMachinerytype(data) {
return request({
url: '/process/type/add',
method: 'post',
data: data
})
}
// 修改工序类型
export function updateMachinerytype(data) {
return request({
url: '/process/type/edit',
method: 'put',
data: data
})
}
// 删除工序类型
export function delMachinerytype(processTypeld) {
return request({
url: '/process/type/' + processTypeld,
method: 'delete'
})
}

View File

@ -42,3 +42,11 @@ export function delProroute(routeId) {
method: 'delete'
})
}
// 复制
export function copyProRoute(routeId) {
return request({
url: '/mes/pro/proroute/copyProRoute/' + routeId,
method: 'get'
})
}

View File

@ -61,9 +61,11 @@ export function listItems(query) {
})
}
export function dofinish(workorderId){
// 删除
export function deleteShopFace(data) {
return request({
url: '/mes/pro/workorder/'+workorderId,
method: 'put'
url: '/mes/pro/workorder/deleteShopFace',
method: 'post',
data: data
})
}

View File

@ -45,10 +45,11 @@ export function confirmItemrecpt(data) {
}
//执行入库
export function execute(recptId) {
export function storage(data) {
return request({
url: '/mes/wm/itemrecpt/' + recptId,
method: 'put'
url: '/wmMatter/storage',
method: 'post',
data: data
})
}

53
src/api/ownerContract.js Normal file
View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 机构合同基本信息新增
export function addOwnerContBase(data) {
return request({
url: `/owner/contract/addOwnerContBase`,
method: 'post',
data
})
}
// 机构合同基本信息修改
export function modifyOwnerContBaseById(data) {
return request({
url: `/updateOrganInfo`,
method: 'post',
data
})
}
// 根据ID查看合同基本信息详情
export function findOwnById(id) {
return request({
url: `/owner/contract/findById/${id}`,
method: 'get'
})
}
// 根据ID查看合同基本信息详情
export function findByOrganId(organId) {
return request({
url: `/owner/contract/findByOrganId/${organId}`,
method: 'get'
})
}
// 获取登录用户机构信息
export function getOrganInfo(params) {
return request({
url: `/getOrganInfo`,
method: 'get',
params
})
}
export function updateLogoImg(params) {
return request({
url: ``,
method: 'get',
params
})
}

View File

@ -109,3 +109,12 @@ export function authUserSelectAll(data) {
params: data
})
}
// 角色恢复默认菜单权限
export function resetRole(query) {
return request({
url: '/system/role/resetRole',
method: 'get',
params: query
})
}

Binary file not shown.

7
src/assets/font/font.css Normal file
View File

@ -0,0 +1,7 @@
/* // 这是 font.css 可设置多种字体; */
/* // 注意font-family: 'XXX'; 将字体名字自定义为 XXX,使用时要用这个名字 */
@font-face {
font-family: 'Ayuthaya';
src: url('./Ayuthaya.ttf');
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -1,18 +1,17 @@
#app {
.main-container {
min-height: 100%;
transition: margin-left .28s;
transition: margin-left 0.28s;
margin-left: $base-sidebar-width;
position: relative;
}
.sidebarHide {
margin-left: 0!important;
margin-left: 0 !important;
}
.sidebar-container {
-webkit-transition: width .28s;
-webkit-transition: width 0.28s;
transition: width 0.28s;
width: $base-sidebar-width !important;
background-color: $base-menu-background;
@ -24,12 +23,15 @@
left: 0;
z-index: 1001;
overflow: hidden;
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
box-shadow: 2px 0 6px rgba(0,21,41,.35);
-webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
// reset element-ui css
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
transition:
0s width ease-in-out,
0s padding-left ease-in-out,
0s padding-right ease-in-out;
}
.scrollbar-wrapper {
@ -70,7 +72,8 @@
width: 100% !important;
}
.el-menu-item, .el-submenu__title {
.el-menu-item,
.el-submenu__title {
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
@ -80,7 +83,7 @@
.submenu-title-noDropdown,
.el-submenu__title {
&:hover {
background-color: rgba(0, 0, 0, 0.06) !important;
background-color: #f9f9f9 !important;
}
}
@ -88,7 +91,7 @@
color: $base-menu-color-active !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
& .nest-menu .el-submenu > .el-submenu__title,
& .el-submenu .el-menu-item {
min-width: $base-sidebar-width !important;
@ -97,7 +100,7 @@
}
}
& .theme-dark .nest-menu .el-submenu>.el-submenu__title,
& .theme-dark .nest-menu .el-submenu > .el-submenu__title,
& .theme-dark .el-submenu .el-menu-item {
background-color: $base-sub-menu-background !important;
@ -132,20 +135,19 @@
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
& > .el-submenu__title {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
}
}
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
&>span {
& > .el-submenu__title {
& > span {
height: 0;
width: 0;
overflow: hidden;
@ -168,7 +170,7 @@
}
.sidebar-container {
transition: transform .28s;
transition: transform 0.28s;
width: $base-sidebar-width !important;
}
@ -182,7 +184,6 @@
}
.withoutAnimation {
.main-container,
.sidebar-container {
transition: none;
@ -192,13 +193,13 @@
// when menu collapsed
.el-menu--vertical {
&>.el-menu {
& > .el-menu {
.svg-icon {
margin-right: 16px;
}
}
.nest-menu .el-submenu>.el-submenu__title,
.nest-menu .el-submenu > .el-submenu__title,
.el-menu-item {
&:hover {
// you can use $subMenuHover
@ -207,7 +208,7 @@
}
// the scroll bar appears when the subMenu is too long
>.el-menu--popup {
> .el-menu--popup {
max-height: 100vh;
overflow-y: auto;

View File

@ -1,25 +1,25 @@
// base color
$blue:#324157;
$light-blue:#3A71A8;
$red:#C03639;
$pink: #E65D6E;
$green: #30B08F;
$tiffany: #4AB7BD;
$yellow:#FEC171;
$panGreen: #30B08F;
$blue: #324157;
$light-blue: #3a71a8;
$red: #c03639;
$pink: #e65d6e;
$green: #30b08f;
$tiffany: #4ab7bd;
$yellow: #fec171;
$panGreen: #30b08f;
// 默认菜单主题风格
$base-menu-color:#bfcbd9;
$base-menu-color-active:#f4f4f5;
$base-menu-background:#304156;
$base-logo-title-color: #ffffff;
$base-menu-color: #001529;
$base-menu-color-active: #409eff;
$base-menu-background: #fff;
$base-logo-title-color: #001529;
$base-menu-light-color:rgba(0,0,0,.70);
$base-menu-light-background:#ffffff;
$base-menu-light-color: #001529;
$base-menu-light-background: #ffffff;
$base-logo-light-title-color: #001529;
$base-sub-menu-background:#1f2d3d;
$base-sub-menu-hover:#001528;
$base-sub-menu-background: #f3f2f2;
$base-sub-menu-hover: #ecf3fc;
// 自定义暗色菜单风格
/**
@ -50,5 +50,5 @@ $base-sidebar-width: 200px;
subMenuHover: $base-sub-menu-hover;
sideBarWidth: $base-sidebar-width;
logoTitleColor: $base-logo-title-color;
logoLightTitleColor: $base-logo-light-title-color
logoLightTitleColor: $base-logo-light-title-color;
}

View File

@ -0,0 +1,316 @@
<template>
<!--导航栏页-->
<div class="footer">
<div class="footer_right">
<a class="it" href="https://beian.miit.gov.cn" target="_blank"
>苏ICP备2021009988号-6
</a>
</div>
<!-- -->
</div>
</template>
<script>
export default {
name: "Nav",
data() {
return {
// isCollapse:true
};
},
methods: {},
};
</script>
<style scoped lang="scss">
.footer {
background: rgba(0, 0, 0, 0.6);
position: fixed;
height: 5%;
bottom: 0;
width: 100%;
margin-bottom: 0px;
justify-content: space-between;
.foot_content {
padding-left: 11.5%;
padding-right: 11.5%;
height: 360px;
color: #fff;
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
width: 77%;
// div {
// height: 200px;
// width: 30%;
// }
.about_us {
height: 200px;
width: 30%;
.title {
height: 0.8rem;
font-size: 0.327rem;
}
.border {
height: 2px;
display: flex;
justify-content: flex-start;
.red {
border-bottom: 2px solid #00a0dc;
width: 64px;
height: 100%;
}
.gray {
border-bottom: 1px solid #707070;
// width: 308px;
flex: 1;
height: 100%;
}
}
.info {
margin-top: 0.39rem;
opacity: 0.7;
font-size: 0.218rem;
line-height: 0.51rem;
padding-left: 0.2rem;
padding-right: 0.2rem;
}
}
.customer_service {
height: 200px;
width: 30%;
.title {
height: 0.8rem;
font-size: 0.327rem;
}
.border {
height: 2px;
display: flex;
justify-content: flex-start;
.red {
border-bottom: 2px solid #00a0dc;
width: 64px;
height: 100%;
}
.gray {
border-bottom: 1px solid #707070;
flex: 1;
height: 100%;
}
}
.list {
padding-left: 0.2rem;
padding-right: 0.2rem;
opacity: 0.7;
font-size: 0.188rem;
height: 80px;
line-height: 0.5rem;
border-bottom: 1px solid #707070;
display: flex;
align-items: center;
justify-content: space-between;
div {
height: auto;
width: auto;
}
div:hover {
cursor: pointer; //
}
}
}
.follow_us {
height: 200px;
width: 30%;
.title {
height: 0.8rem;
font-size: 0.327rem;
}
.border {
height: 2px;
display: flex;
justify-content: flex-start;
.red {
border-bottom: 2px solid #00a0dc;
width: 64px;
height: 100%;
}
.gray {
border-bottom: 1px solid #707070;
flex: 1;
height: 100%;
}
}
.secCode {
width: 100%;
margin: 20px;
display: flex;
div {
text-align: center;
padding: 5px;
width: 40%;
p {
padding: 3px;
opacity: 0.7;
font-size: 0.188rem;
}
}
}
}
.contact_us {
height: 200px;
width: 30%;
.title {
height: 0.8rem;
font-size: 0.327rem;
}
.border {
height: 2px;
display: flex;
justify-content: flex-start;
.red {
border-bottom: 2px solid #00a0dc;
width: 64px;
height: 100%;
}
.gray {
border-bottom: 1px solid #707070;
flex: 1;
height: 100%;
}
}
.address {
opacity: 0.7;
font-size: 0.188rem;
line-height: 0.36rem;
height: 50px;
padding-left: 0.2rem;
padding-right: 0.2rem;
}
.tel {
margin-top: 0.22rem;
opacity: 0.7;
font-size: 0.188rem;
line-height: 0.36rem;
height: 35px;
padding-left: 0.2rem;
padding-right: 0.2rem;
}
.qq {
opacity: 0.7;
font-size: 0.188rem;
line-height: 0.36rem;
height: 35px;
padding-left: 0.2rem;
padding-right: 0.2rem;
}
.email {
opacity: 0.7;
font-size: 0.188rem;
line-height: 0.36rem;
height: 35px;
padding-left: 0.2rem;
padding-right: 0.2rem;
}
}
}
.footer_right {
position: relative;
left: 0;
bottom: 0;
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
color: #000;
// opacity: 0.7;
font-size: 14px;
a {
text-decoration: none;
color: #fff;
cursor: pointer;
display: inline-block;
}
.it {
}
.aggrement {
display: inline-block;
}
}
}
@media (max-width: 768px) {
.footer {
flex-direction: column;
padding-top: 50px !important;
height: auto !important;
.foot_content {
flex-direction: column !important;
height: auto !important;
.contact_us,
.customer_service,
.follow_us {
font-size: 14px !important;
width: 100% !important;
.address {
line-height: 20px !important;
}
}
.contact_us {
.title {
margin-bottom: 10px !important;
font-size: 16px !important;
}
.tel {
margin-top: 20px !important;
}
.tel,
.qq,
.email,
.address {
font-size: 14px !important;
}
}
.customer_service {
.title {
margin-top: 15px !important;
margin-bottom: 10px !important;
font-size: 16px !important;
}
.list {
div {
font-size: 14px !important;
}
}
}
.follow_us {
margin-top: 20px !important;
.title {
margin-bottom: 10px !important;
font-size: 16px !important;
}
.secCode p {
font-size: 14px !important;
}
}
}
.footer_right {
position: relative;
flex-direction: column;
padding-bottom: 20px !important;
}
.it {
text-align: center !important;
font-size: 14px !important;
}
.aggrement {
font-size: 14px !important;
}
.privacyPolicy {
font-size: 14px !important;
}
}
}
</style>

View File

@ -167,7 +167,6 @@
workstationId: null,
workstationCode: null,
workstationName: null,
routeId: null,
processId: this.processId,
processCode: null,
processName: null,
@ -217,7 +216,6 @@
getList() {
this.loading = true;
listProtask(this.queryParams).then(response => {
debugger;
this.protaskList = response.rows;
this.total = response.total;
this.loading = false;

View File

@ -130,7 +130,7 @@ export default {
updateBy: null,
updateTime: null
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */

View File

@ -161,7 +161,7 @@ export default {
return {
showFlag:false,
//
loading: true,
loading: false,
//
selectedId: null,
selectedRow: null,
@ -244,19 +244,19 @@ export default {
getList() {
this.loading = true;
listWmstock(this.queryParams).then(response => {
if(response.rows){
debugger;
if(this.warehouseCode != null && this.warehouseCode != undefined && this.warehouseCode.indexOf('VIR') >0 ){
this.wmstockList = response.rows;
}else {
//线线
this.wmstockList = response.rows.filter((el) =>{
return el.warehouseCode.indexOf('VIR') == -1;
});
}
// if(response.rows){
// if(this.warehouseCode.indexOf('VIR') == -1){
// //线线
// this.wmstockList = response.rows.filter((el) =>{
// return el.warehouseCode.indexOf('VIR') == -1;
// });
// }
// this.total = response.total;
// this.loading = false;
// }
this.wmstockList = response.rows
this.total = response.total;
this.loading = false;
}
});
},
/** 查询分类下拉树结构 */

View File

@ -74,7 +74,7 @@
<el-table-column label="产品名称" width="200" align="center" prop="productName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="productSpc" :show-overflow-tooltip="true"/>
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
<el-table-column label="工单数量" align="center" prop="quantity" />
<el-table-column label="计划数量" align="center" prop="quantity" />
<el-table-column label="客户编码" align="center" prop="clientCode" />
<el-table-column label="客户名称" align="center" prop="clientName" :show-overflow-tooltip="true"/>
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">

View File

@ -30,7 +30,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<!-- <el-col :span="7">
<el-form-item label="所在车间" prop="workshopName">
<el-select v-model="queryParams.workshopId" placeholder="请选择车间">
<el-option
@ -41,7 +41,7 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="3">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -178,7 +178,7 @@ export default {
workstationCode: null,
workstationName: null,
workstationAddress: null,
workshopId: null,
workshopId: "214",
workshopCode: null,
workshopName: null,
processId: null,

View File

@ -1,33 +1,62 @@
<template>
<div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<hamburger
id="hamburger-container"
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
<breadcrumb
id="breadcrumb-container"
class="breadcrumb-container"
v-if="!topNav"
/>
<!--图片-->
<div
style="
display: inline-block;
width: 66%;
margin-left: 30px;
line-height: 40px;
"
>
<!--<el-image src="/images/logo.png" style="width:100%;height:40px"></el-image>-->
<el-image
v-show="this.companyImg != null || this.companyImg !=''"
:src="this.companyImg"
style="width: 100%; height: 46px"
></el-image>
</div>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div class="right-menu">
<template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<template v-if="device !== 'mobile'">
<!-- <search id="header-search" class="right-menu-item" /> -->
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
</el-tooltip>
<el-tooltip content="文档地址" effect="dark" placement="bottom">
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
</el-tooltip>
</el-tooltip> -->
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="布局大小" effect="dark" placement="bottom">
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip>
</el-tooltip> -->
</template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="click"
>
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar">
<img :src="avatar" class="user-avatar" />
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
@ -47,15 +76,17 @@
</template>
<script>
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import { mapGetters } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import TopNav from "@/components/TopNav";
import Hamburger from "@/components/Hamburger";
import Screenfull from "@/components/Screenfull";
import SizeSelect from "@/components/SizeSelect";
import Search from "@/components/HeaderSearch";
import RuoYiGit from "@/components/RuoYi/Git";
import RuoYiDoc from "@/components/RuoYi/Doc";
import * as ownerServer from "@/api/ownerContract";
export default {
components: {
@ -66,48 +97,63 @@ export default {
SizeSelect,
Search,
RuoYiGit,
RuoYiDoc
RuoYiDoc,
},
created() {
this.getOwnInfo();
},
data() {
return {
companyImg: null,
};
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'device'
]),
...mapGetters(["sidebar", "avatar", "device"]),
setting: {
get() {
return this.$store.state.settings.showSettings
return this.$store.state.settings.showSettings;
},
set(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'showSettings',
value: val
})
}
this.$store.dispatch("settings/changeSetting", {
key: "showSettings",
value: val,
});
},
},
topNav: {
get() {
return this.$store.state.settings.topNav
}
}
return this.$store.state.settings.topNav;
},
},
},
methods: {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
this.$store.dispatch("app/toggleSideBar");
},
getOwnInfo() {
ownerServer.getOrganInfo().then((res) => {
if (res.code === 200 && res.data) {
this.companyImg = res.data.picture;
console.log(companyImg);
this.isEdit = true;
}
});
},
async logout() {
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/index';
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
}).catch(() => {});
}
}
}
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
});
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
@ -116,18 +162,18 @@ export default {
overflow: hidden;
position: relative;
background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08);
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.hamburger-container {
line-height: 46px;
height: 100%;
float: left;
cursor: pointer;
transition: background .3s;
-webkit-tap-highlight-color:transparent;
transition: background 0.3s;
-webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, .025)
background: rgba(0, 0, 0, 0.025);
}
}
@ -164,10 +210,10 @@ export default {
&.hover-effect {
cursor: pointer;
transition: background .3s;
transition: background 0.3s;
&:hover {
background: rgba(0, 0, 0, .025)
background: rgba(0, 0, 0, 0.025);
}
}
}

View File

@ -1,22 +1,17 @@
<template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<div class="sidebar-logo-container" :class="{'collapse':collapse}">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<img src="../../../assets/images/logo-b.png" class="sidebar-logo-small">
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<img src="../../../assets/images/logo-small.png" class="sidebar-logo">
</router-link>
</transition>
</div>
</template>
<script>
import logoImg from '@/assets/logo/logo.png'
import variables from '@/assets/styles/variables.scss'
export default {
name: 'SidebarLogo',
props: {
@ -25,18 +20,10 @@ export default {
required: true
}
},
computed: {
variables() {
return variables;
},
sideTheme() {
return this.$store.state.settings.sideTheme
}
},
data() {
return {
title: '苦糖果MES',
logo: logoImg
title: 'Vue Element Admin',
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png'
}
}
}
@ -54,10 +41,11 @@ export default {
.sidebar-logo-container {
position: relative;
width: 100%;
height: 50px;
line-height: 50px;
background: #2b2f3a;
width: 85%;
margin-left: 5px;
height: 62px;
line-height: 62px;
background: #FFFFFF;
text-align: center;
overflow: hidden;
@ -66,12 +54,19 @@ export default {
width: 100%;
& .sidebar-logo {
width: 32px;
height: 32px;
width: 100%;
height: 85%;
vertical-align: middle;
margin-right: 12px;
}
& .sidebar-logo-small{
width: 100%;
height: 70%;
vertical-align: middle;
margin-right: 0px;
}
& .sidebar-title {
display: inline-block;
margin: 0;

View File

@ -1,12 +1,32 @@
<template>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<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-scrollbar
:class="settings.sideTheme"
wrap-class="scrollbar-wrapper"
style="height: 80%"
>
<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"
: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="settings.theme"
:collapse-transition="false"
@ -20,6 +40,20 @@
/>
</el-menu>
</el-scrollbar>
<div
style="
height: 10%;
display: flex;
justify-content: center;
align-items: center;
"
@click="stop"
>
<img src="../../../assets/images/emergencyStop.png" style="width: 90px" />
</div>
<div style="height: 10%; width: 100%; font-size: 13px">
紧急制动所有设备全部停止
</div>
</div>
</template>
@ -28,6 +62,7 @@ import { mapGetters, mapState } from "vuex";
import Logo from "./Logo";
import SidebarItem from "./SidebarItem";
import variables from "@/assets/styles/variables.scss";
import axios from "axios";
export default {
components: { SidebarItem, Logo },
@ -51,7 +86,61 @@ export default {
},
isCollapse() {
return !this.sidebar.opened;
},
},
methods: {
stop() {
this.$confirm(
"确定制动后,车间内所有设备将全部紧急停止运行,请谨慎操作! 如确定要进行紧急制动,请点击【确定】按钮!",
"紧急制动确认",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
axios
.get("http://192.168.3.53:8077/manage/task/emergencyStop")
.then((res) => {
if (res.code === 200) {
this.$message({
message: "紧急制动成功",
type: "success",
});
} else {
this.$message({
message: "紧急制动失败",
type: "error",
});
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消",
});
});
},
},
};
</script>
<style lang="scss">
.el-message-box {
width: 430px !important;
border: 0px solid #ebeef5 !important;
}
.el-message-box__header {
background: #922423 !important;
color: #fff !important;
}
.el-message-box__title {
color: #fdf3f7 !important;
}
.el-message-box__content {
color: #fdf3f7 !important;
background: #cf3533 !important;
}
</style>

View File

@ -40,6 +40,13 @@ import DictData from '@/components/DictData'
import webSite from '@/config/website'
Vue.prototype.website = webSite
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' // 默认主题
//全局修改默认配置,点击空白处不能关闭弹窗
ElementUI.Dialog.props.closeOnClickModal.default = false
Vue.use(ElementUI)
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey

View File

@ -1,10 +1,10 @@
import Vue from 'vue'
import Router from 'vue-router'
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router)
Vue.use(Router);
/* Layout */
import Layout from '@/layout'
import Layout from "@/layout";
/**
* Note: 路由配置项
@ -31,232 +31,250 @@ import Layout from '@/layout'
// 公共路由
export const constantRoutes = [
{
path: '/redirect',
path: "/redirect",
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect')
}
]
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect"),
},
],
},
{
path: '/login',
component: () => import('@/views/login'),
hidden: true
path: "/login",
component: () => import("@/views/login"),
hidden: true,
},
{
path: '/register',
component: () => import('@/views/register'),
hidden: true
path: "/register",
component: () => import("@/views/register"),
hidden: true,
},
{
path: '/404',
component: () => import('@/views/error/404'),
hidden: true
path: "/404",
component: () => import("@/views/error/404"),
hidden: true,
},
{
path: '/401',
component: () => import('@/views/error/401'),
hidden: true
path: "/401",
component: () => import("@/views/error/401"),
hidden: true,
},
// {
// path: "",
// component: Layout,
// redirect: "index",
// children: [
// {
// path: "index",
// component: () => import("@/views/index"),
// name: "Index",
// meta: { title: "首页", icon: "dashboard", affix: true },
// },
// ],
// },
{
path: '',
path: "",
component: Layout,
redirect: 'index',
redirect: "index",
children: [
{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
path: "index",
component: () => import("@/views/mes/pro/production/index"),
name: "Index",
// meta: { title: "首页", icon: "dashboard", affix: true },
},
],
},
{
path: '/user',
path: "/user",
component: Layout,
hidden: true,
redirect: 'noredirect',
redirect: "noredirect",
children: [
{
path: 'profile',
component: () => import('@/views/system/user/profile/index'),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
}
]
}
]
path: "profile",
component: () => import("@/views/system/user/profile/index"),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
},
],
},
];
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [
{
path: '/system/user-auth',
path: "/system/user-auth",
component: Layout,
hidden: true,
permissions: ['system:user:edit'],
permissions: ["system:user:edit"],
children: [
{
path: 'role/:userId(\\d+)',
component: () => import('@/views/system/user/authRole'),
name: 'AuthRole',
meta: { title: '分配角色', activeMenu: '/system/user' }
}
]
path: "role/:userId(\\d+)",
component: () => import("@/views/system/user/authRole"),
name: "AuthRole",
meta: { title: "分配角色", activeMenu: "/system/user" },
},
],
},
{
path: '/system/role-auth',
path: "/system/role-auth",
component: Layout,
hidden: true,
permissions: ['system:role:edit'],
permissions: ["system:role:edit"],
children: [
{
path: 'user/:roleId(\\d+)',
component: () => import('@/views/system/role/authUser'),
name: 'AuthUser',
meta: { title: '分配用户', activeMenu: '/system/role' }
}
]
path: "user/:roleId(\\d+)",
component: () => import("@/views/system/role/authUser"),
name: "AuthUser",
meta: { title: "分配用户", activeMenu: "/system/role" },
},
],
},
{
path: '/system/dict-data',
path: "/system/dict-data",
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
permissions: ["system:dict:list"],
children: [
{
path: 'index/:dictId(\\d+)',
component: () => import('@/views/system/dict/data'),
name: 'Data',
meta: { title: '字典数据', activeMenu: '/system/dict' }
}
]
path: "index/:dictId(\\d+)",
component: () => import("@/views/system/dict/data"),
name: "Data",
meta: { title: "字典数据", activeMenu: "/system/dict" },
},
],
},
{
path: '/system/autocodePart',
path: "/system/autocodePart",
component: Layout,
hidden: true,
permissions: ['system:autocode:part:list'],
permissions: ["system:autocode:part:list"],
children: [
{
path: 'index/:ruleId(\\d+)',
component: () => import('@/views/system/autocode/part'),
name: 'AutoCode',
meta: { title: '规则组成', activeMenu: '/system/autocode' }
}
]
path: "index/:ruleId(\\d+)",
component: () => import("@/views/system/autocode/part"),
name: "AutoCode",
meta: { title: "规则组成", activeMenu: "/system/autocode" },
},
],
},
{
path: '/mes/wm/location',
path: "/mes/wm/location",
component: Layout,
hidden: true,
permissions: ['mes:wm:location:list'],
permissions: ["mes:wm:location:list"],
children: [
{
path: 'index',
component: () => import('@/views/mes/wm/location/index'),
name: 'locationList',
meta: { title: '库区设置', activeMenu: '/mes/wm/location' }
}
]
path: "index",
component: () => import("@/views/mes/wm/location/index"),
name: "locationList",
meta: { title: "库区设置", activeMenu: "/mes/wm/location" },
},
],
},
{
path: '/mes/wm/area',
path: "/mes/wm/area",
component: Layout,
hidden: true,
permissions: ['mes:wm:area:list'],
permissions: ["mes:wm:area:list"],
children: [
{
path: 'index',
component: () => import('@/views/mes/wm/area/index'),
name: 'areaList',
meta: { title: '库位设置', activeMenu: '/mes/wm/area' }
}
]
path: "index",
component: () => import("@/views/mes/wm/area/index"),
name: "areaList",
meta: { title: "库位设置", activeMenu: "/mes/wm/area" },
},
],
},
{
path: '/mes/pro/schedule',
path: "/mes/pro/schedule",
component: Layout,
hidden: true,
permissions: ['mes:pro:protask:edit'],
permissions: ["mes:pro:protask:edit"],
children: [
{
path: 'ganttedit',
path: "ganttedit",
component: () => import("@/views/mes/pro/schedule/ganttedit"),
name: 'ganttEdit',
meta: {title: '使用甘特图排产',activeMenu: '/mes/pro/schedule'}
}
]
name: "ganttEdit",
meta: { title: "使用甘特图排产", activeMenu: "/mes/pro/schedule" },
},
],
},
{
path: '/monitor/job-log',
path: "/monitor/job-log",
component: Layout,
hidden: true,
permissions: ['monitor:job:list'],
permissions: ["monitor:job:list"],
children: [
{
path: 'index',
component: () => import('@/views/monitor/job/log'),
name: 'JobLog',
meta: { title: '调度日志', activeMenu: '/monitor/job' }
}
]
path: "index",
component: () => import("@/views/monitor/job/log"),
name: "JobLog",
meta: { title: "调度日志", activeMenu: "/monitor/job" },
},
],
},
{
path: '/tool/gen-edit',
path: "/tool/gen-edit",
component: Layout,
hidden: true,
permissions: ['tool:gen:edit'],
permissions: ["tool:gen:edit"],
children: [
{
path: 'index/:tableId(\\d+)',
component: () => import('@/views/tool/gen/editTable'),
name: 'GenEdit',
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
}
]
path: "index/:tableId(\\d+)",
component: () => import("@/views/tool/gen/editTable"),
name: "GenEdit",
meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
},
],
},
{
path: '/mes/qc/pendinginspect/add',
path: "/mes/qc/pendinginspect/add",
component: Layout,
hidden: true,
permissions: ['mes:qc:pending'],
permissions: ["mes:qc:pending"],
children: [
{
path: 'iqc',
component: () => import('@/views/mes/qc/pendinginspect/iqc'),
name: 'iqcadd',
path: "iqc",
component: () => import("@/views/mes/qc/pendinginspect/iqc"),
name: "iqcadd",
props: true,
meta: {title: '来料检验', activeMenu: '/mes/qc/pendinginspect/iqc'}
meta: { title: "来料检验", activeMenu: "/mes/qc/pendinginspect/iqc" },
},
{
path: 'pqc',
component: () => import('@/views/mes/qc/pendinginspect/pqc'),
name: 'pqcadd',
path: "pqc",
component: () => import("@/views/mes/qc/pendinginspect/pqc"),
name: "pqcadd",
props: true,
meta: {title: '过程检验', activeMenu: '/mes/qc/pendinginspect/pqc'}
meta: { title: "过程检验", activeMenu: "/mes/qc/pendinginspect/pqc" },
},
{
path: 'oqc',
component: () => import('@/views/mes/qc/oqc/index'),
name: 'oqcadd',
path: "oqc",
component: () => import("@/views/mes/qc/oqc/index"),
name: "oqcadd",
props: true,
meta: {title: '出厂检验', activeMenu: '/mes/qc/pendinginspect/oqc'}
}
]
}
]
meta: { title: "出厂检验", activeMenu: "/mes/qc/pendinginspect/oqc" },
},
],
},
];
// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err)
}
return routerPush.call(this, location).catch((err) => err);
};
export default new Router({
mode: 'history', // 去掉url中的#
mode: "history", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
routes: constantRoutes,
});
export function resetRouter() {
const newRouter = createRouter();
Router.matcher = newRouter.matcher; // 重制 router
}

View File

@ -0,0 +1,19 @@
const state = {
companyImg:localStorage.getItem("logo"),
isLogo:false
}
const mutations = {
SET_LOGO(state,img){
state.companyImg = img
},
SET_IS_LOGO(state,isLogo) {
state.isLogo = isLogo;
}
}
export default {
namespaced: true,
state,
mutations,
}

View File

@ -1,96 +1,106 @@
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { login, logout, getInfo } from "@/api/login";
import { getToken, setToken, removeToken } from "@/utils/auth";
const user = {
state: {
token: getToken(),
name: '',
avatar: '',
name: "",
avatar: "",
roles: [],
permissions: []
permissions: [],
},
mutations: {
SET_TOKEN: (state, token) => {
state.token = token
state.token = token;
},
SET_NAME: (state, name) => {
state.name = name
state.name = name;
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
state.avatar = avatar;
},
SET_ROLES: (state, roles) => {
state.roles = roles
state.roles = roles;
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
}
state.permissions = permissions;
},
},
actions: {
// 登录
Login({ commit }, userInfo) {
const username = userInfo.username.trim()
const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
const username = userInfo.username.trim();
const password = userInfo.password;
const code = userInfo.code;
const uuid = userInfo.uuid;
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
resolve()
}).catch(error => {
reject(error)
})
login(username, password, code, uuid)
.then((res) => {
setToken(res.token);
commit("SET_TOKEN", res.token);
resolve();
})
.catch((error) => {
reject(error);
});
});
},
// 获取用户信息
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
getInfo()
.then((res) => {
const user = res.user;
const avatar =
user.avatar == "" || user.avatar == null
? require("@/assets/images/profile.jpg")
: user.avatar;
if (res.roles && res.roles.length > 0) {
// 验证返回的roles是否是一个非空数组
commit("SET_ROLES", res.roles);
commit("SET_PERMISSIONS", res.permissions);
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
commit("SET_ROLES", ["ROLE_DEFAULT"]);
}
commit('SET_NAME', user.userName)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
reject(error)
})
commit("SET_NAME", user.userName);
commit("SET_AVATAR", avatar);
resolve(res);
})
.catch((error) => {
reject(error);
});
});
},
// 退出系统
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
removeToken()
resolve()
}).catch(error => {
reject(error)
})
logout(state.token)
.then(() => {
commit("SET_TOKEN", "");
commit("SET_ROLES", []);
commit("SET_PERMISSIONS", []);
removeToken();
resolve();
})
.catch((error) => {
reject(error);
});
});
},
// 前端 登出
FedLogOut({ commit }) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
removeToken()
resolve()
})
}
}
}
return new Promise((resolve) => {
commit("SET_TOKEN", "");
removeToken();
resolve();
});
},
},
};
export default user
export default user;

View File

@ -0,0 +1,513 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in statusArr"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>处理</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="abnormal" label="设备是否异常:">
<el-radio-group v-model="form.abnormal">
<el-radio :label="1">异常</el-radio>
<el-radio :label="2">无异常</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="status" label="是否解决:">
<el-radio-group v-model="form.status">
<el-radio :label="1">已解决</el-radio>
<el-radio :label="2">未解决</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 229,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
//
openTop: false,
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
openopenTop() {
this.openTop = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 处理 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "处理";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 置顶操作 */
handleDelete(row) {
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,362 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 229,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
top: 0,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<!-- 切换 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="异常报警" name="1">
<abnormalAGV />
</el-tab-pane>
<el-tab-pane label="历史异常报警" name="2">
<historicalAGV />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import abnormalAGV from "./abnormalAGV.vue";
import historicalAGV from "./historicalAGV.vue";
export default {
components: { abnormalAGV, historicalAGV },
data() {
return {
//tab1
activeName: "1",
};
},
methods: {
//tab
handleClick() {
this.activeName = "2";
},
},
};
</script>
<style scoped lang="scss">
.clearfix {
line-height: 40px;
display: flex;
}
</style>

View File

@ -0,0 +1,513 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="warnType">
<el-select
v-model="queryParams.warnType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in statusArr"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>处理</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="abnormal" label="设备是否异常:">
<el-radio-group v-model="form.abnormal">
<el-radio :label="1">异常</el-radio>
<el-radio :label="2">无异常</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="status" label="是否解决:">
<el-radio-group v-model="form.status">
<el-radio :label="1">已解决</el-radio>
<el-radio :label="2">未解决</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 230,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
//
openTop: false,
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
openopenTop() {
this.openTop = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 处理 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "处理";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 置顶操作 */
handleDelete(row) {
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,362 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 230,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
top: 0,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<!-- 切换 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="异常报警" name="1">
<abnormalLiku />
</el-tab-pane>
<el-tab-pane label="历史异常报警" name="2">
<historicalLiku />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import abnormalLiku from "./abnormalLiku.vue";
import historicalLiku from "./historicalLiku.vue";
export default {
components: { abnormalLiku, historicalLiku },
data() {
return {
//tab1
activeName: "1",
};
},
methods: {
//tab
handleClick() {
this.activeName = "2";
},
},
};
</script>
<style scoped lang="scss">
.clearfix {
line-height: 40px;
display: flex;
}
</style>

View File

@ -0,0 +1,514 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="warnType">
<el-select
v-model="queryParams.warnType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in statusArr"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>处理</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="abnormal" label="设备是否异常:">
<el-radio-group v-model="form.abnormal">
<el-radio :label="1">异常</el-radio>
<el-radio :label="2">无异常</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="status" label="是否解决:">
<el-radio-group v-model="form.status">
<el-radio :label="1">已解决</el-radio>
<el-radio :label="2">未解决</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 227,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
//
openTop: false,
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
openopenTop() {
this.openTop = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 处理 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "处理";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,362 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 227,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
top: 0,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<!-- 切换 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="异常报警" name="1">
<abnormalAlarm />
</el-tab-pane>
<el-tab-pane label="历史异常报警" name="2">
<historicalAnomalyAlarm />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import abnormalAlarm from "./abnormalAlarm.vue";
import historicalAnomalyAlarm from "./historicalAnomalyAlarm.vue";
export default {
components: { abnormalAlarm, historicalAnomalyAlarm },
data() {
return {
//tab1
activeName: "1",
};
},
methods: {
//tab
handleClick() {
this.activeName = "2";
},
},
};
</script>
<style scoped lang="scss">
.clearfix {
line-height: 40px;
display: flex;
}
</style>

View File

@ -0,0 +1,362 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="abnormal" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 228,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
top: 0,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,41 @@
<template>
<div class="app-container">
<!-- 切换 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="异常报警" name="1">
<roboticAlarm />
</el-tab-pane>
<el-tab-pane label="历史异常报警" name="2">
<historicalAlarm />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import roboticAlarm from "./roboticAlarm.vue";
import historicalAlarm from "./historicalAlarm.vue";
export default {
components: { roboticAlarm, historicalAlarm },
data() {
return {
//tab1
activeName: "1",
};
},
methods: {
//tab
handleClick() {
this.activeName = "2";
},
},
};
</script>
<style scoped lang="scss">
.clearfix {
line-height: 40px;
display: flex;
}
</style>

View File

@ -0,0 +1,514 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入设备编码/名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="异常报警类型" label-width="100px" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_alarm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="处理状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in statusArr"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="设备编码"
align="center"
prop="machineryCode"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备名称"
align="center"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备类别"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警类型"
align="center"
prop="warnType"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警内容"
align="center"
prop="message"
:show-overflow-tooltip="true"
/>
<el-table-column
label="异常报警时间"
align="center"
prop="warnTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="处理状态" align="center" prop="status">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.status == '0'"
>未处理</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '1'"
>已处理未解决</span
>
<span class="el-table-column-span-1" v-if="scope.row.status == '2'"
>已处理已完成</span
>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>查看</el-button
>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>处理</el-button
>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>置顶</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title="title"
:visible.sync="open"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="abnormal" label="设备是否异常:">
<el-radio-group v-model="form.abnormal">
<el-radio :label="1">异常</el-radio>
<el-radio :label="2">无异常</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item prop="status" label="是否解决:">
<el-radio-group v-model="form.status">
<el-radio :label="1">已解决</el-radio>
<el-radio :label="2">未解决</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 置顶 -->
<el-dialog
title="置顶"
:visible.sync="openTop"
center
width="400px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-row>
<el-col>
<el-form-item prop="top" label="设备是否异常:">
<el-radio-group v-model="form.top">
<el-radio :label="0">不置顶</el-radio>
<el-radio :label="1">置顶</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleForm"> </el-button>
<el-button @click="openopenTop"> </el-button>
</div>
</el-dialog>
<!-- 查看 -->
<el-dialog
:title="title"
:visible.sync="openQuery"
center
width="800px"
append-to-body
>
<el-form ref="form" :model="formQuery" label-width="130px">
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备编码:">
{{ formQuery.machineryCode }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="设备名称:">
{{ formQuery.machineryName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="设备类型:">
{{ formQuery.machineryTypeName }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警类型:">
{{ formQuery.warnType }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item prop="" label="异常报警内容:">
{{ formQuery.message }}
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item prop="" label="异常报警时间:">
{{ formQuery.warnTime }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelQuery"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, edit } from "@/api/abnormalityAlarm/machineTool";
import { getToken } from "@/utils/auth";
export default {
// name: "Dvsubject",
dicts: ["sys_yes_no", "mes_alarm_type"],
components: {},
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
openQuery: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineryTypeId: 228,
},
//
form: {
abnormal: 1,
status: "",
top: 0,
},
//
formQuery: {},
//
openTop: false,
statusArr: [
{
label: "未处理",
value: 0,
},
{
label: "已处理未解决",
value: 1,
},
{
label: "已处理已完成",
value: 2,
},
],
//
rules: {
abnormal: [
{ required: true, message: "设备是否异常不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "是否解决不能为空", trigger: "blur" },
],
top: [{ required: true, message: "是否置顶不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
cancelQuery() {
this.openQuery = false;
this.reset();
},
//
openopenTop() {
this.openTop = false;
this.reset();
},
//
reset() {
this.form = {
abnormal: 1,
status: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 查看 **/
handleExportArr(row) {
this.formQuery = row;
this.openQuery = true;
this.title = "查看";
},
/** 处理 */
handleUpdate(row) {
this.reset();
this.open = true;
this.title = "处理";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 置顶操作 */
handleDelete(row) {
console.log(row);
this.reset();
this.openTop = true;
},
/** 置顶提交按钮 */
handleForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
edit(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "处理成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,535 @@
<template>
<div class="app-containers">
<p class="title">
人员选择<span v-show="isshow == 2">多选</span
><span v-show="isshow == 1">单选</span>
</p>
<el-row>
<el-col :span="6"
><div class="grid-content one">
<!-- 部门的选择 -->
<el-container>
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>部门
</el-header>
<el-main class="smallmain">
<el-tree
v-loading="loading"
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
highlight-current
ref="tree"
node-key="deptId"
:filter-node-method="filterNode"
@node-click="handleNodeClick"
:default-expand-all="true"
>
</el-tree>
</el-main>
</el-container>
</div>
</el-col>
<el-col :span="12"
><div class="grid-content two">
<!-- 人员的选择 -->
<el-row>
<el-col>
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
label-width="68px"
style="height: 40px"
>
<el-form-item label="姓名" prop="nickName">
<el-input
v-model.trim="queryParams.userName"
placeholder="请输入姓名"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row>
<!-- 多选时 -->
<div>
<el-col :span="24" class="tableBox" v-show="isshow == 2">
<el-table
v-loading="loading"
ref="checked"
:data="userList"
tooltip-effect="dark"
row-key="userId"
style="width: 100%"
@select="selectionRow"
@select-all="selectionRowAll"
>
<el-table-column
type="selection"
width="55"
:reserve-selection="true"
>
</el-table-column>
<el-table-column
prop="nickName"
label="人员"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="sex"
label="性别"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="scope.row.sex == 0"></span>
<span v-else-if="scope.row.sex == 1"></span>
<span v-else>未知</span>
</template>
</el-table-column>
<el-table-column
prop="dept.deptName"
label="部门"
show-overflow-tooltip
>
</el-table-column>
</el-table>
</el-col>
</div>
<!-- 单选时 -->
<div class="wrapBox" v-show="isshow == 1">
<el-col :span="24" class="tableBox radio">
<el-table
v-loading="loading"
ref="radio"
:data="userList"
tooltip-effect="dark"
row-key="userId"
style="width: 100%"
highlight-current-row
@current-change="handleCurrentChange"
>
<el-table-column
prop="nickName"
label="人员"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop="sex"
label="性别"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="scope.row.sex == 0"></span>
<span v-else-if="scope.row.sex == 1"></span>
<span v-else>未知</span>
</template>
</el-table-column>
<el-table-column
prop="dept.deptName"
label="部门"
show-overflow-tooltip
>
</el-table-column>
</el-table>
</el-col>
</div>
</el-row>
</div>
</el-col>
<el-col :span="6"
><div class="grid-content three">
<!-- 已选人员 -->
<el-container style="padding: 0">
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>已选人员
<el-button
size="small"
plain
@click="toggleSelection()"
class="but1"
>删除全部</el-button
>
</el-header>
<el-main class="smallmain tableBox">
<p v-if="selectList.length == 0" class="nodata">暂无数据</p>
<div class="tagBox" v-else>
<el-tag
class="tag"
:key="tag.userId"
v-for="tag in selectList"
closable
:disable-transitions="false"
@close="handleClose(tag)"
>
<span class="tagItem">{{ tag.nickName }}</span>
<span v-if="tag.sex == 0" class="tagItem"></span>
<span v-else-if="tag.sex == 1" class="tagItem"></span>
<span v-else class="tagItem">未知</span>
<span class="tagItem">{{ tag.deptName }}</span>
</el-tag>
</div>
</el-main>
</el-container>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { treeselect } from "@/api/system/dept";
import { listUser } from "@/api/system/user";
export default {
name: "DepUser",
components: { treeselect, listUser },
props: ["inputValue"],
// props: {
// //
// inputValue: {
// type: Array,
// default: function () {
// return [];
// },
// },
// // 1 2
// // show: {
// // type: String,
// // required: false,
// // default: false,
// // },
// },
data() {
return {
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label",
},
//
userList: null,
// //
// nowList: [],
//
selectList: [],
// isshow=1,2
isshow: 2,
//
loading: true,
//
form: {},
//
queryParams: {
pageNum: 1,
pageSize: 10000,
userName: undefined,
nickName: undefined,
mobile: undefined,
deptId: undefined,
},
//
selectIdList: [],
addInvolvedUserIdVisible: false,
};
},
watch: {
inputValue(val) {
this.selectList = val;
this.getTreeselect();
this.$nextTick(() => {});
},
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getTreeselect();
this.$nextTick(() => {});
},
mounted() {
this.$nextTick(() => {
this.inputValue.forEach((item) => {
this.selectList.push(item);
});
// if (this.show) {
// this.isshow = this.show;
// }
});
},
computed: {
user() {
return this.$store.state.user;
},
},
methods: {
//
handleCurrentChange(val) {
this.selectList = [val];
this.$emit("getSelectList", this.selectList);
},
//
getTreeselect() {
treeselect().then((response) => {
let allobj = {
id: 0,
label: "全体人员",
};
this.deptOptions = response.data;
this.queryParams.deptId = this.user.deptId;
this.deptOptions.unshift(allobj);
this.loading = false;
this.getList();
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.queryParams).then((response) => {
this.userList = response.rows;
this.loading = false;
this.$refs.checked.clearSelection(); //
//
this.userList.forEach((i) => {
if (this.selectList != "") {
this.selectList.forEach((item) => {
if (i.userId == item.userId) {
this.isshow == 2
? this.$refs.checked.toggleRowSelection(item) //
: this.$refs.radio.setCurrentRow(item, true); //
}
});
}
});
});
},
// ===>>
toggleSelection(rows) {
this.selectList = [];
this.$refs.checked.clearSelection();
if (this.isshow == 1) {
this.$refs.radio.setCurrentRow();
this.selectList.splice(this.selectList.indexOf(rows), 1);
}
this.$emit("getSelectList", this.selectList);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// ===>>>
handleClose(tag) {
//
if (this.isshow == 2) {
this.selectList.splice(this.selectList.indexOf(tag), 1);
this.$refs.checked.toggleRowSelection(tag, false);
}
//
if (this.isshow == 1) {
this.$refs.radio.setCurrentRow();
this.selectList.splice(this.selectList.indexOf(tag), 1);
}
if (this.inputValue) {
this.$refs.checked.toggleRowSelection(tag, false); //
this.getList();
}
this.$emit("getSelectList", this.selectList);
},
//
selectionRow(selection, row) {
let selected = selection.length && selection.indexOf(row) !== -1; //true 0false
if (selected) {
this.selectList.unshift(row);
} else {
for (let i = 0; i < this.selectList.length; i++) {
if (row.userId == this.selectList[i].userId) {
this.selectList.splice(i, 1);
}
}
}
this.$emit("getSelectList", this.selectList);
},
//
selectionRowAll(selection) {
if (selection.length) {
let list = selection;
for (let i = 0; i < list.length; i++) {
for (let j = 0; j < this.selectList.length; j++) {
if (list[i].userId == this.selectList[j].userId) {
this.selectList.splice(j, 1);
}
}
}
list.forEach((item) => {
this.selectList.unshift(item);
});
} else {
this.getList({ id: this.queryParams.deptId });
this.userList.forEach((item) => {
this.selectList.splice(this.selectList.indexOf(item), 1);
});
}
this.submit();
},
submit() {
this.$emit("getSelectList", this.selectList);
},
//
parentHandleclick(e) {
this.$refs.checked.clearSelection();
},
},
};
</script>
<style scoped>
.app-containers ::-webkit-scrollbar {
display: none;
}
.one,
.three,
.two {
height: 510px;
width: 100%;
overflow: scroll;
border: solid 1px #dadada;
}
.one {
width: 95%;
}
.two {
border: 1px solid transparent;
}
.three {
width: 99%;
box-sizing: border-box;
margin-left: 5%;
}
.title {
line-height: 24px;
font-size: 18px;
color: #303133;
padding-bottom: 5px;
border-bottom: solid 1px #dadada;
margin-bottom: 15px;
margin-top: -23px;
}
.el-main,
.smallmain {
padding: 0;
}
.smallHeader {
background-color: #1890ff;
position: relative;
color: #fff;
font-weight: 700;
}
.but1 {
position: absolute;
right: 20px;
top: 4px;
}
.open,
.smallmain >>> .el-tree-node:focus > .el-tree-node__content {
background-color: #83bff8 !important;
}
.smallmain >>> .el-tree-node__content:hover {
background-color: #dadada;
}
.smallmain
>>> .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #83bff8;
}
.tableBox >>> .el-table {
margin: 0;
}
.radio {
position: relative;
}
.nodata {
width: 100%;
text-align: center;
line-height: 40px;
height: 40px;
}
.tagBox {
width: 100%;
}
.tag {
width: 100%;
height: 38px;
}
.tagItem {
display: inline-block;
width: calc(100% / 3.2);
text-align: center;
margin-top: 5px;
/* 单行文本溢出省略号 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-tag .el-icon-close {
top: -9px;
}
.wrapBox >>> .el-table__body tr.current-row > td {
background-color: #83bff8 !important;
}
.wrapBox >>> .el-table tbody tr:hover > td {
background-color: #dadada;
}
::v-deep .el-tag {
margin-left: 0px;
}
</style>

View File

@ -0,0 +1,721 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="5"
><div class="grid-content bg-purple">
<div class="grid-content three" style="height: 750px;border-radius: 10px">
<!-- 选择设备 -->
<el-container style="padding: 0">
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>选择设备
</el-header>
<el-main class="smallmain tableBox">
<p v-if="intelligent.length == 0" class="nodata">暂无数据</p>
<div class="tagBox" v-else>
<el-button
style="width: 100%"
v-for="item in intelligent"
:key="item"
@click="handleClose(item)"
>{{ item.machineryName }}</el-button
>
</div>
</el-main>
</el-container>
</div>
</div></el-col
>
<el-col :span="18" class="myfont"
><div class="content">
<div style="height: 100px">
<div style="width: 31px; margin-left: 9%">
<el-image
v-if="imgdata"
:src="img"
style="margin-top: 25px"
></el-image>
<el-image v-else :src="imgs" style="margin-top: 25px"></el-image>
</div>
</div>
<div style="height: 440px">
<div style="height: 105px">
<el-row
type="flex"
class="row-bg"
justify="center"
style="height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 22%">
{{ intelligentData.feedSpeed }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 25%">
{{ intelligentData.spindleSpeed }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 6px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 22%">
{{ intelligentData.rapidOverride }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 25%">
{{ intelligentData.spindle }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 7px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 22%">
{{ intelligentData.feedRate }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 25%">
{{ intelligentData.handWheel }}
</div></el-col
>
</el-row>
</div>
<div style="height: 158px">
<el-row
type="flex"
class="row-bg"
justify="center"
style="height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeX }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineX }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 10px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeY }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineY }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 15px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeZ }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineZ }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 12px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.relativeA }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.machineA }}
</div></el-col
>
</el-row>
</div>
<div>
<el-row
type="flex"
class="row-bg"
justify="center"
style="height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteX }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualX }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 10px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteY }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualY }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 15px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteZ }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualZ }}
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-top: 12px; height: 18px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 60%">
{{ intelligentData.absoluteA }}
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 65%">
{{ intelligentData.residualA }}
</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 350px">
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{1}} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 35%">
<!-- {{ 3 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 8%"
>
<!-- {{ 4 }} -->
</div></el-col
>
</el-row>
<el-row
type="flex"
class="row-bg"
justify="center"
style="margin-bottom: 15px; height: 50px"
>
<el-col :span="6"
><div class="grid-content bg-purple" style="margin-left: 40%">
<!-- {{ 1 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 20%"
>
<!-- {{ 2 }} -->
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="margin-left: 35%"
></div
></el-col>
<el-col :span="12"
><div
class="grid-content bg-purple-light"
style="margin-left: 59%"
>
<el-button
type="danger"
style="margin-top: 17%; height: 40px"
@click="off"
></el-button>
<el-button
type="success"
style="margin-top: 17%; height: 40px; margin-left: 18%"
@click="on"
></el-button></div
></el-col>
</el-row>
</div></div
></el-col>
</el-row>
</div>
</template>
<script>
import { listMachinery } from "@/api/mes/dv/machinery";
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
import axios from "axios";
import "@/assets/font/font.css";
export default {
data() {
return {
intelligent: [],
intelligentData: {},
//
loading: true,
id: "",
imgdata: true,
timer: null,
img: require("../../../assets/images/close.png"),
imgs: require("../../../assets/images/open.png"),
machineryTypeOptions: [],
machinerydata: {
pageNum: 1,
pageSize: 10,
machineryTypeId: "",
},
};
},
created() {
this.getList();
},
mounted() {
//
this.timer = setInterval(() => {
if (this.id != "") {
this.setInterval();
}
}, 1500);
// $oncebeforeDestroy
this.$once("hook:beforeDestroy", () => {
clearInterval(this.timer);
});
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// axios
// .get("http://192.168.3.53:8077/manage/device/devices")
// .then((res) => {
// this.intelligent = res.data.data;
// this.loading = false;
// });
listMachinerytype().then((response) => {
var data = "";
response.data.forEach((item) => {
if (item.machineryTypeCode == "M_TYPE_001") {
data = item.machineryTypeId;
}
});
this.machinerydata.machineryTypeId = data;
this.listMachineryitem();
});
},
listMachineryitem() {
listMachinery(this.machinerydata).then((response) => {
response.rows.forEach((item) => {
if (item.ip != null) {
this.intelligent.push(item);
}
});
this.loading = false;
});
},
handleClose(item) {
this.id = item.machineryId;
this.setInterval();
},
setInterval() {
axios
.get("http://192.168.3.53:8077/manage/modbus/data", {
params: {
id: this.id,
},
})
.then((res) => {
this.intelligentData = res.data.data;
});
},
off() {
if (this.id != "") {
axios
.get("http://192.168.3.53:8077/manage/modbus/operate", {
params: {
id: this.id,
type: 2,
},
})
.then((res) => {
this.imgdata = true;
this.$modal.msgSuccess("停止成功");
});
} else {
this.$message({
message: "请选择设备",
type: "warning",
});
}
},
on() {
if (this.id != "") {
axios
.get("http://192.168.3.53:8077/manage/modbus/operate", {
params: {
id: this.id,
type: 1,
},
})
.then((res) => {
this.imgdata = false;
this.$modal.msgSuccess("启动成功");
});
} else {
this.$message({
message: "请选择设备",
type: "warning",
});
}
},
},
};
</script>
<style lang="scss" scoped>
.myfont {
font-family: "Ayuthaya"; // Ayuthaya
}
::-webkit-scrollbar {
width: 0 !important;
}
::-webkit-scrollbar {
width: 0 !important;
height: 0;
}
.el-button + .el-button {
margin-left: 0px !important;
}
.app-containers ::-webkit-scrollbar {
display: none;
}
.image {
width: 300px;
height: 200px;
}
.one,
.three,
.two {
height: 510px;
width: 100%;
overflow: scroll;
border: solid 1px #dadada;
}
.one {
width: 95%;
}
.two {
border: 1px solid transparent;
}
.three {
width: 99%;
box-sizing: border-box;
margin-left: 5%;
}
.title {
line-height: 24px;
font-size: 18px;
color: #302933;
padding-bottom: 5px;
border-bottom: solid 1px #dadada;
margin-bottom: 15px;
margin-top: -23px;
}
.el-main,
.smallmain {
padding: 0;
}
.smallHeader {
background-color: #e0e8f0;
position: relative;
color: #7a8289;
font-weight: 700;
}
.content {
position: relative;
width: 70%;
margin: 0 auto 20px;
background: url("../../../assets/images/machine.png") no-repeat center;
background-size: 100% 100%;
}
.but1 {
position: absolute;
right: 20px;
top: 4px;
}
.open,
.smallmain >>> .el-tree-node:focus > .el-tree-node__content {
background-color: #83bff8 !important;
}
.smallmain >>> .el-tree-node__content:hover {
background-color: #dadada;
}
.smallmain
>>> .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #83bff8;
}
.tableBox >>> .el-table {
margin: 0;
}
.radio {
position: relative;
}
.nodata {
width: 100%;
text-align: center;
line-height: 40px;
height: 40px;
}
.tagBox {
width: 100%;
}
.tag {
width: 100%;
height: 38px;
}
.tagItem {
display: inline-block;
width: calc(100% / 3.2);
text-align: center;
margin-top: 5px;
/* 单行文本溢出省略号 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-tag .el-icon-close {
top: -9px;
}
.wrapBox >>> .el-table__body tr.current-row > td {
background-color: #83bff8 !important;
}
.wrapBox >>> .el-table tbody tr:hover > td {
background-color: #dadada;
}
::v-deep .el-tag {
margin-left: 0px;
}
</style>

View File

@ -0,0 +1,553 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="4"
><div class="grid-content bg-purple">
<div
class="grid-content three"
style="height: 750px; border-radius: 10px"
>
<!-- 选择设备 -->
<el-container style="padding: 0">
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>选择设备
</el-header>
<el-main class="smallmain tableBox">
<p v-if="intelligent.length == 0" class="nodata">暂无数据</p>
<div class="tagBox" v-else>
<el-button
style="width: 100%"
v-for="item in intelligent"
:key="item"
@click="handleClose(item)"
>{{ item.machineryName }}</el-button
>
</div>
</el-main>
</el-container>
</div>
</div></el-col
>
<el-col :span="14"
><div class="grid-content bg-purple">
<div>
<el-image :src="img"></el-image>
</div>
<div
style="
border: 1px solid rgb(217 216 216);
height: 60px;
width: 30%;
border-radius: 30px;
margin-left: 32%;
"
>
<p
v-if="Powersupply"
style="
font-size: 20px;
color: rgb(158, 158, 158);
margin: 19px;
text-align: center;
"
>
Power down
</p>
<p
v-else
style="
font-size: 20px;
color: rgb(158, 158, 158);
margin: 19px;
text-align: center;
"
>
Power on
</p>
</div>
<div
style="
border: 1px solid rgb(217, 216, 216);
height: 100px;
width: 30%;
border-radius: 50px;
margin-left: 32%;
margin-top: 2%;
background: rgba(204, 204, 221, 0.2);
"
>
<p
style="
font-size: 14px;
color: rgb(158, 158, 158);
margin: 0px;
text-align: center;
"
>
Control
</p>
<div style="margin-top: 2%">
<el-row type="flex" class="row-bg" justify="center">
<el-col :span="4"
><div class="grid-content bg-purple">
<div v-if="elimage">
<el-button @click="upbutton"
><el-image
:src="sd"
style="width: 20px; height: 20px"
></el-image
></el-button>
<p
style="
margin: auto;
margin-left: 25%;
font-size: 14px;
color: #9e9e9e;
"
>
上电
</p>
</div>
<div v-else>
<el-button @click="downbutton">
<el-image
:src="xd"
style="width: 20px; height: 20px"
></el-image>
</el-button>
<p
style="
margin: auto;
margin-left: 25%;
font-size: 14px;
color: #9e9e9e;
"
>
下电
</p>
</div>
</div></el-col
>
<el-col :span="6"
><div class="grid-content bg-purple-light"></div
></el-col>
<el-col :span="5"
><div class="grid-content bg-purple">
<div>
<el-button>
<el-image
:src="fw"
style="width: 20px; height: 20px"
></el-image>
</el-button>
<p
style="
margin: auto;
margin-left: 25%;
font-size: 14px;
color: #9e9e9e;
"
>
复位
</p>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</div></el-col
>
<el-col :span="5"
><div class="grid-content bg-purple">
<div
class="grid-content three"
style="width: 330px; height: 335px; border-radius: 10px"
>
<el-header
class="smallHeader"
style="height: 40px; line-height: 40px"
>Robot Operation Panel
</el-header>
<div style="margin: 6px">
<el-radio-group
v-model="radio4"
size="mini"
style="display: flex"
>
<el-radio-button :label="1">j1轴</el-radio-button>
<el-radio-button :label="2">j2轴</el-radio-button>
<el-radio-button :label="3">j3轴</el-radio-button>
<el-radio-button :label="4">j4轴</el-radio-button>
<el-radio-button :label="5">j5轴</el-radio-button>
<el-radio-button :label="6">j6轴</el-radio-button>
</el-radio-group>
</div>
<div
style="
width: 90%;
height: 120px;
margin: auto;
border-radius: 10px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
"
>
<el-header
class="smallHeader"
style="height: 30px; line-height: 30px"
>Coordinate
</el-header>
<div style="margin: 20px 10px">
<el-row type="flex" class="row-bg" justify="space-around">
<el-col :span="6"
><div
class="grid-content bg-purple"
style="text-align: center"
>
X:{{ 123 }}
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="text-align: center"
>
Y:{{ 123 }}
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple"
style="text-align: center"
>
Z:{{ 123 }}
</div></el-col
>
</el-row>
</div>
<div style="margin: 20px 10px">
<el-row type="flex" class="row-bg" justify="space-around">
<el-col :span="6"
><div
class="grid-content bg-purple"
style="text-align: center"
>
A:{{ 123 }}
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple-light"
style="text-align: center"
>
B:{{ 123 }}
</div></el-col
>
<el-col :span="6"
><div
class="grid-content bg-purple"
style="text-align: center"
>
C:{{ 123 }}
</div></el-col
>
</el-row>
</div>
</div>
<div
style="
width: 90%;
height: 88px;
margin: auto;
margin-top: 20px;
border-radius: 10px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
"
>
<el-header
class="smallHeader"
style="height: 30px; line-height: 30px"
>
Standard
</el-header>
<div style="margin: 20px 20px">Speed limit:{{ 1 }}</div>
</div>
</div>
</div></el-col
>
</el-row>
</div>
</template>
<script>
import { listMachinery } from "@/api/mes/dv/machinery";
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
import axios from "axios";
export default {
data() {
return {
intelligent: [],
intelligentData: {},
//
loading: true,
id: "",
imgdata: true,
timer: null,
machineryTypeOptions: [],
machinerydata: {
pageNum: 1,
pageSize: 10,
machineryTypeId: "",
},
elimage: true,
Powersupply: true,
radio4: "1",
img: require("../../../assets/images/robotic.png"),
sd: require("../../../assets/images/shangdian.png"),
xd: require("../../../assets/images/weishangdian.png"),
fw: require("../../../assets/images/fuwei-02.png"),
};
},
created() {
this.getList();
},
mounted() {
//
this.timer = setInterval(() => {
if (this.id != "") {
this.setInterval();
}
}, 1500);
// $oncebeforeDestroy
this.$once("hook:beforeDestroy", () => {
clearInterval(this.timer);
});
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
listMachinerytype().then((response) => {
var data = "";
response.data.forEach((item) => {
if (item.machineryTypeCode == "M_TYPE_002") {
data = item.machineryTypeId;
}
});
this.machinerydata.machineryTypeId = data;
this.listMachineryitem();
});
},
listMachineryitem() {
listMachinery(this.machinerydata).then((response) => {
response.rows.forEach((item) => {
if (item.ip != null) {
this.intelligent.push(item);
}
});
this.loading = false;
});
},
handleClose(item) {
this.id = item.machineryId;
this.setInterval();
},
setInterval() {
// axios
// .get("http://192.168.3.53:8077/manage/modbus/data", {
// params: {
// id: this.id,
// },
// })
// .then((res) => {
// this.intelligentData = res.data.data;
// });
},
upbutton() {
if (this.id != "") {
axios
.get("http://192.168.3.53:8077/manage/robot/powerOn", {
params: {
id: this.id,
},
})
.then((res) => {
if (res.data.code === 200) {
this.elimage = false;
this.Powersupply = false;
this.$modal.msgSuccess("上电成功");
} else {
this.$message.error(res.data.msg);
}
});
} else {
this.$message({
message: "请选择设备",
type: "warning",
});
}
},
downbutton() {
if (this.id != "") {
axios
.get("http://192.168.3.53:8077/manage/robot/powerOff", {
params: {
id: this.id,
},
})
.then((res) => {
if (res.data.code === 200) {
this.elimage = true;
this.Powersupply = true;
this.$modal.msgSuccess("下电成功");
} else {
this.$message.error(res.data.msg);
}
});
} else {
this.$message({
message: "请选择设备",
type: "warning",
});
}
},
},
};
</script>
<style lang="scss" scoped>
.app-containers ::-webkit-scrollbar {
display: none;
}
::-webkit-scrollbar {
width: 0 !important;
}
::-webkit-scrollbar {
width: 0 !important;
height: 0;
}
.el-button + .el-button {
margin-left: 0px !important;
}
.image {
width: 300px;
height: 200px;
}
.one,
.three,
.two {
height: 510px;
width: 100%;
overflow: scroll;
border: solid 1px #dadada;
}
.one {
width: 95%;
}
.two {
border: 1px solid transparent;
}
.three {
width: 99%;
box-sizing: border-box;
margin-left: 5%;
}
.title {
line-height: 24px;
font-size: 18px;
color: #302933;
padding-bottom: 5px;
border-bottom: solid 1px #dadada;
margin-bottom: 15px;
margin-top: -23px;
}
.el-main,
.smallmain {
padding: 0;
}
.smallHeader {
background-color: #e0e8f0;
position: relative;
color: #7a8289;
font-weight: 700;
}
.content {
position: relative;
width: 70%;
margin: 0 auto 20px;
background: url("../../../assets/images/machine.png") no-repeat center;
background-size: 100% 100%;
}
.but1 {
position: absolute;
right: 20px;
top: 4px;
}
.open,
.smallmain >>> .el-tree-node:focus > .el-tree-node__content {
background-color: #83bff8 !important;
}
.smallmain >>> .el-tree-node__content:hover {
background-color: #dadada;
}
.smallmain
>>> .el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #83bff8;
}
.tableBox >>> .el-table {
margin: 0;
}
.radio {
position: relative;
}
.nodata {
width: 100%;
text-align: center;
line-height: 40px;
height: 40px;
}
.tagBox {
width: 100%;
}
.tag {
width: 100%;
height: 38px;
}
.tagItem {
display: inline-block;
width: calc(100% / 3.2);
text-align: center;
margin-top: 5px;
/* 单行文本溢出省略号 */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-tag .el-icon-close {
top: -9px;
}
.wrapBox >>> .el-table__body tr.current-row > td {
background-color: #83bff8 !important;
}
.wrapBox >>> .el-table tbody tr:hover > td {
background-color: #dadada;
}
::v-deep .el-tag {
margin-left: 0px;
}
</style>

View File

@ -1,9 +1,8 @@
<template>
<div class="dashboard-editor-container">
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row :gutter="32" style="padding:16px 16px 0;margin-bottom:32px;">
<el-row :gutter="32" style="padding: 16px 16px 0; margin-bottom: 32px">
<el-card>
<div slot="header" class="clearfix">
<span>生产进度</span>
@ -13,39 +12,82 @@
:data="workorderList"
row-key="workorderId"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column label="工单编码" width="180" prop="workorderCode" >
<el-table-column label="工单编码" width="180" prop="workorderCode">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleView(scope.row)"
v-hasPermi="['mes:pro:workorder:query']"
>{{scope.row.workorderCode}}</el-button>
>{{ scope.row.workorderCode }}</el-button
>
</template>
</el-table-column>
<el-table-column label="订单编号" width="140" align="center" prop="sourceCode" />
<el-table-column label="客户名称" align="center" prop="clientName" :show-overflow-tooltip="true"/>
<el-table-column label="产品编号" width="120" align="center" prop="productCode" />
<el-table-column label="产品名称" width="250px" align="center" prop="productName" :show-overflow-tooltip="true"/>
<el-table-column label="规格型号" align="center" prop="productSpc" :show-overflow-tooltip="true"/>
<el-table-column
label="订单编号"
width="140"
align="center"
prop="sourceCode"
/>
<el-table-column
label="客户名称"
align="center"
prop="clientName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="产品编号"
width="120"
align="center"
prop="productCode"
/>
<el-table-column
label="产品名称"
width="250px"
align="center"
prop="productName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="center"
prop="productSpc"
:show-overflow-tooltip="true"
/>
<el-table-column label="单位" align="center" prop="unitOfMeasure" />
<el-table-column label="生产进度" align="center" width="200px" >
<el-table-column label="生产进度" align="center" width="200px">
<template slot-scope="scope">
<el-progress :text-inside="true" :stroke-width="20" :percentage="parseFloat(((scope.row.quantityProduced/scope.row.quantity*100).toFixed(2)))"></el-progress>
<el-progress
:text-inside="true"
:stroke-width="20"
:percentage="
parseFloat(
(
(scope.row.quantityProduced / scope.row.quantity) *
100
).toFixed(2)
)
"
></el-progress>
</template>
</el-table-column>
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">
<el-table-column
label="需求日期"
align="center"
prop="requestDate"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.requestDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.requestDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
</el-table>
</el-card>
</el-row>
<el-row style="background:#fff;padding:16px 16px 0; margin-bottom:32px;">
<el-row style="background: #fff; padding: 16px 16px 0; margin-bottom: 32px">
<line-chart :chart-data="lineChartData" />
</el-row>
@ -66,71 +108,69 @@
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import { listWorkorder } from "@/api/mes/pro/workorder";
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
import PanelGroup from "./dashboard/PanelGroup";
import LineChart from "./dashboard/LineChart";
import RaddarChart from "./dashboard/RaddarChart";
import PieChart from "./dashboard/PieChart";
import BarChart from "./dashboard/BarChart";
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
actualData: [120, 82, 91, 154, 162, 140, 145],
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
actualData: [180, 160, 151, 106, 145, 150, 130],
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
actualData: [120, 90, 100, 138, 142, 130, 130],
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
actualData: [120, 82, 91, 154, 162, 140, 130],
},
};
export default {
name: 'Index',
name: "Index",
components: {
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
BarChart,
},
data() {
return {
loading: true,
queryParams: {status:'CONFIRMED'},
queryParams: {},
workorderList: [],
lineChartData: lineChartData.newVisitis
}
lineChartData: lineChartData.newVisitis,
};
},
created(){
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
listWorkorder(this.queryParams).then(response => {
this.workorderList = response.rows;
listWorkorder(this.queryParams).then((response) => {
this.workorderList = response.data;
this.loading = false;
});
},
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}
}
}
this.lineChartData = lineChartData[type];
},
},
};
</script>
<style lang="scss" scoped>
@ -146,7 +186,7 @@ export default {
}
}
@media (max-width:1024px) {
@media (max-width: 1024px) {
.chart-wrapper {
padding: 8px;
}

View File

@ -1,119 +1,272 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">苦糖果生产执行管理系统</h3>
<div class="login-container ng-scope">
<div class="login-wrap">
<div class="bg-opacity">
<div class="logo" />
<div class="title" />
</div>
<el-card class="card-container">
<el-tabs type="card" :tab-position="tabPosition" style="height: 350px">
<el-tab-pane>
<span slot="label" style="width: 248px"
><i class="el-icon-user" /> 账号登录</span
>
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
autocomplete="on"
label-position="left"
>
<div class="title-container">
<h1 class="title">登录</h1>
</div>
<el-form-item prop="username">
<span class="svg-container">
<svg-icon icon-class="user" />
</span>
<el-input
ref="username"
v-model="loginForm.username"
placeholder="请输入账号"
name="username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
tabindex="1"
auto-complete="on"
/>
</el-form-item>
<el-tooltip
v-model="capsTooltip"
content="密码明文查看"
placement="right"
manual
>
<el-form-item prop="password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
:key="passwordType"
ref="password"
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
:type="passwordType"
placeholder="请填写密码"
name="password"
tabindex="2"
autocomplete="on"
@keyup.native="checkCapslock"
@blur="capsTooltip = false"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon
:icon-class="
passwordType === 'password' ? 'eye' : 'eye-open'
"
/>
</span>
</el-form-item>
<el-form-item prop="code" v-if="captchaOnOff">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
</el-tooltip>
<el-checkbox
v-model="loginForm.rememberMe"
style="margin: 0px 76px 0px -155px"
>记住密码</el-checkbox
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:100%;">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin"
<el-button type="primary" @click.native.prevent="handleLogin"
> </el-button
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right;" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
<!-- <span style="font-size:13px;cursor:pointer;color:#9b9ea0;text-decoration:none;position: absolute;right:20px;padding-top:20px;" @click="forgetPwd">忘记密码</span> -->
<!-- <el-row>
<el-col :span="24" style="text-align:right;margin-top:-20px"><span style="font-size:13px;cursor:pointer;color:#9b9ea0;text-decoration:none" @click="forgetPwd">忘记密码</span></el-col>
</el-row> -->
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span @click="toIPC">陕ICP备2022002135号-1</span>
</el-tab-pane>
<el-tab-pane>
<span slot="label" style="width: 249px"
><i class="el-icon-phone" /> 手机号登录</span
>
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginPhoneRules"
class="login-form"
autocomplete="on"
label-position="left"
>
<div class="title-container">
<h1 class="title">登录</h1>
</div>
<el-form-item prop="username">
<span class="svg-container">
<img
src="@/assets/images/shoujitianchong.png"
class="svgImg"
/>
</span>
<el-input
ref="phone"
v-model="loginForm.username"
placeholder="请输入手机号码"
name="phone"
type="text"
tabindex="1"
auto-complete="on"
/>
</el-form-item>
<el-tooltip
v-model="capsTooltip"
content="密码明文查看"
placement="right"
manual
>
<el-form-item prop="password">
<span class="svg-container">
<svg-icon icon-class="password" />
</span>
<el-input
:key="passwordType"
ref="password"
v-model="loginForm.password"
:type="passwordType"
placeholder="请填写密码"
name="password"
tabindex="2"
autocomplete="on"
@keyup.native="checkCapslock"
@blur="capsTooltip = false"
/>
<span class="show-pwd" @click="showPwd">
<svg-icon
:icon-class="
passwordType === 'password' ? 'eye' : 'eye-open'
"
/>
</span>
</el-form-item>
</el-tooltip>
<el-checkbox
v-model="loginForm.rememberMe"
style="margin: 0px 76px 0px -155px"
>记住密码</el-checkbox
>
<el-button type="primary" @click.native.prevent="handleLogin"
> </el-button
>
<!-- <span style="font-size:13px;cursor:pointer;color:#9b9ea0;text-decoration:none;position: absolute;right:20px;padding-top:20px;" @click="forgetPwd">忘记密码</span> -->
<!-- <el-row>
<el-col :span="24" style="text-align:right;margin-top:-20px">
<span style="font-size:13px;cursor:pointer;color:#9b9ea0;text-decoration:none" @click="forgetPwd">忘记密码</span></el-col>
</el-row> -->
</el-form>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
<el-dialog
title="忘记密码"
:visible.sync="dialogVisible"
width="30%"
append-to-body
center
>
<p>机构员工遗失密码请联系本机构管理员进行密码重置</p>
<p>
机构管理员遗失密码请联系平台客服QQ2546125360并提供相关身份证明材料
</p>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"
> </el-button
>
</span>
</el-dialog>
<Footer />
</div>
</template>
<script>
import Footer from "@/components/Footer";
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import { encrypt, decrypt } from "@/utils/jsencrypt";
export default {
components: { Footer },
name: "Login",
data() {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: ""
uuid: "",
},
loginPhoneForm: {
phone: "",
password: "",
},
tabPosition: "",
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
{ required: true, trigger: "blur", message: "请输入用户名称" },
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
password: [{ required: true, trigger: "blur", message: "请录入密码" }],
},
loginPhoneRules: {
username: [{ required: true, trigger: "blur", message: "请输入手机号码" }],
// username: [
// { required: true, message: "", trigger: "blur" },
// {
// pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
// message: "",
// trigger: "blur",
// },
// ],
password: [{ required: true, trigger: "blur", message: "请录入密码" }],
},
passwordType: "password",
capsTooltip: false,
loading: false,
//
captchaOnOff: true,
//
register: false,
redirect: undefined
redirect: undefined,
otherQuery: {},
dialogVisible: false,
};
},
watch: {
$route: {
handler: function(route) {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
immediate: true,
},
},
created() {
this.getCode();
this.getCookie();
},
mounted() {
if (this.loginForm.username === "") {
this.$refs.username.focus();
} else if (this.loginForm.password === "") {
this.$refs.password.focus();
}
window.addEventListener("keydown", this.keyDown); //
},
destroyed() {
window.removeEventListener("keydown", this.keyDown, false); //
},
methods: {
toIPC(){
window.open("https://beian.miit.gov.cn/","_blank");
toIPC() {
window.open("https://beian.miit.gov.cn/", "_blank");
},
getCode() {
getCodeImg().then(res => {
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
getCodeImg().then((res) => {
this.captchaOnOff =
res.captchaOnOff === undefined ? true : res.captchaOnOff;
if (this.captchaOnOff) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
@ -123,29 +276,51 @@ export default {
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe')
const rememberMe = Cookies.get("rememberMe");
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
password:
password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
checkCapslock(e) {
const { key } = e;
this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
},
showPwd() {
if (this.passwordType === "password") {
this.passwordType = "";
} else {
this.passwordType = "password";
}
this.$nextTick(() => {
this.$refs.password.focus();
});
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.remove("rememberMe");
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false;
if (this.captchaOnOff) {
this.getCode();
@ -153,70 +328,292 @@ export default {
});
}
});
}
}
},
phoneLogin() {
// this.$refs.loginPhoneForm.validate((valid) => {
// if (valid) {
// this.loading = true;
// this.$store
// .dispatch("user/phoneLogin", this.loginPhoneForm)
// .then(() => {
// debugger;
// this.$router.push({ path: "/", query: this.otherQuery });
// this.loading = false;
// })
// .catch(() => {
// this.loading = false;
// });
// } else {
// console.log("error submit!!");
// return false;
// }
// });
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.login {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
<style lang="scss">
$bg: #fff;
$light_gray: #000;
$cursor: #858585;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input {
color: $cursor;
line-height: 44px;
}
}
.login-form {
border-radius: 6px;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
/* reset element-ui css */
.login-container {
.el-input {
height: 38px;
display: inline-block;
height: 44px;
width: 85%;
input {
height: 38px;
background: transparent;
border: 0px;
-webkit-appearance: none;
border-radius: 0px;
padding: 6px 5px 12px 15px;
border-bottom: 1px solid #e0e0e0;
color: $light_gray;
height: 44px;
caret-color: $cursor;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg inset !important;
-webkit-text-fill-color: $cursor !important;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
.el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1);
// background: rgba(0, 0, 0, 0.1);
border-radius: 5px;
color: #454545;
}
}
</style>
<style lang="scss" scoped>
$bg: #2d3a4b;
$dark_gray: rgb(29, 27, 27);
$light_gray: #eee;
.login-container {
height: 65%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background: url("../../src/assets/images/login_bg.jpg") no-repeat center;
background-size: 100%;
content: "";
z-index: 0;
.bg-opacity {
padding-bottom: 10px;
background-color: rgba(0, 0, 0, 0.3);
}
.logo {
position: relative;
width: 25%;
height: 140px;
margin: 0 auto 20px;
background: url("../../src/assets/images/logo_white.png") no-repeat center;
background-size: 100% 100%;
}
.logo:after {
position: absolute;
content: "";
left: -15%;
bottom: 0;
height: 1px;
width: 129%;
border-bottom: 1px solid #fff;
}
.logo + .title {
width: 666px;
height: 44px;
margin: 0 auto;
background: url("../../src/assets/images/login_title.png") no-repeat center;
background-size: 100% 100%;
color: white;
// font-size: 24px;
// letter-spacing: 4px
}
.login-content {
overflow: hidden;
height: 100%;
}
.card-container {
width: 500px;
margin: 0 auto;
padding: 0 auto;
}
.el-card {
// padding: 5px 10px 0px 0px;
padding: 0px;
}
::v-deep .el-card__body {
padding: 0px !important;
.el-tabs__item {
width: 250px;
}
}
.login-form {
display: block;
position: relative;
width: 520px;
max-width: 100%;
padding: 0px 15px;
margin: 0 auto;
overflow: hidden;
}
.tips {
font-size: 14px;
color: #fff;
margin-bottom: 10px;
span {
&:first-of-type {
margin-right: 16px;
}
}
}
.svg-container {
padding: 0px 0px 6px 5px;
margin-bottom: -10px;
color: $dark_gray;
vertical-align: middle;
width: 30px;
display: inline-block;
.svgImg {
width: 1em;
height: 1em;
vertical-align: -0.16em;
fill: currentColor;
overflow: hidden;
}
}
.title-container {
.title {
color: #7e7e7e;
text-align: center;
letter-spacing: -0.05em;
line-height: 20px;
font-weight: 500;
font-family: "Helvetica Neue", Helvetica, "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
margin-bottom: 10px;
}
h1.title:before,
h1.title:after {
content: "";
height: 1px;
position: absolute;
top: 37px;
width: 35%;
}
h1.title:before {
background: rgb(126, 126, 126);
background: -moz-linear-gradient(
to left,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -webkit-linear-gradient(
to left,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -moz-linear-gradient(
to left,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -ms-linear-gradient(
to left,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: linear-gradient(
to left,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
left: 0px;
}
h1.title:after {
background: rgb(126, 126, 126);
background: -moz-linear-gradient(
to right,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -webkit-linear-gradient(
to right,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -moz-linear-gradient(
to right,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: -ms-linear-gradient(
to right,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
background: linear-gradient(
to right,
rgba(126, 126, 126, 1) 0%,
rgba(255, 255, 255, 1) 100%
);
right: 0px;
}
}
.show-pwd {
position: absolute;
right: 10px;
top: 3px;
font-size: 16px;
color: $dark_gray;
cursor: pointer;
user-select: none;
}
.thirdparty-button {
position: absolute;
right: 0;
bottom: 6px;
}
@media only screen and (max-width: 470px) {
.thirdparty-button {
display: none;
}
}
.login-wrap {
position: absolute;
top: 70%;
left: 0;
right: 0;
width: 100%;
height: 418px;
text-align: center;
transform: translate(0, -50%);
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
</style>

View File

@ -0,0 +1,662 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="代码名称" prop="subjectCode">
<el-input
v-model="queryParams.subjectCode"
placeholder="请输入代码名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="项目名称" prop="subjectName">
<el-input
v-model="queryParams.subjectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="" prop="subjectType">
<el-select
v-model="queryParams.subjectType"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in dict.type.mes_dvsubject_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:dv:dvsubject:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
'text-align': 'center',
}"
stripe
style="width: 100%"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="代码程序名称"
align="center"
prop="codeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="代码程序编号"
align="center"
prop="code"
:show-overflow-tooltip="true"
/>
<el-table-column
label="版本号"
align="center"
prop="version"
:show-overflow-tooltip="true"
/>
<el-table-column
label="所属设备类型"
align="center"
prop="machineryTypeName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="关联设备"
align="center"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<span
v-for="(val, index) in scope.row.cadCodeMachineryList"
:key="index"
>
<span class="apostrophe">{{ val.machineryName }}</span>
</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="更新时间"
align="center"
prop="updateTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-download"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>导出</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="代码名称" prop="codeName">
<el-input v-model="form.codeName" placeholder="请输入代码名称" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="代码编号" prop="code">
<el-input v-model="form.code" placeholder="请输入代码编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
label="所属设备类别"
label-width="120px"
prop="machineryTypeId"
>
<treeselect
v-model="form.machineryTypeId"
:options="machineryTypeOptions"
:normalizer="normalizer"
placeholder="请选择所属分类"
@select="handleNodeClick"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="代码上传" prop="" label-width="100px">
<el-upload
ref="codeName"
class="upload-demo"
:headers="this.headers"
action="/prod-api/common/uploadMinio"
:before-remove="beforeRemove"
:on-change="customUploadChangeImage2"
:before-upload="beforeUpload"
:on-exceed="handleExceedImage1"
accept=".PDF"
name="file"
multiple
:limit="1"
:file-list="fileList"
>
<el-button size="small" type="primary" icon="el-icon-upload2"
>点击上传</el-button
>
<el-button type="primary" size="small" @click.stop="previewFile"
>&nbsp;预览文件</el-button
>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="关联设备" prop="machineryIdsArr">
<el-select
v-model="machineryIdsArr"
placeholder="请选择关联设备"
clearable
filterable
multiple
style="width: 100%"
value-key="machineryId"
@change="handleAccompanyId"
>
<el-option
v-for="dict in listTypeArr"
:key="dict.machineryId"
:label="dict.machineryName"
:value="dict"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
list,
updateTeam,
reviseFile,
delTeam,
listMachinery,
} from "@/api/management/codeprogram";
import { genCode } from "@/api/system/autocode/rule";
import { getToken } from "@/utils/auth";
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Dvsubject",
dicts: ["sys_yes_no", "mes_dvsubject_type"],
components: { Treeselect },
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
ids: null,
subjectCode: null,
subjectName: null,
subjectType: null,
subjectContent: null,
subjectStandard: null,
enableFlag: null,
machineryTypeId: null,
},
machineryIdsArr: null,
//
form: {
subjectId: null,
machineryTypeId: null,
url: "",
originalName: "",
machineryIds: "",
machineryTypeName: "",
},
fileList: [],
listTypeArr: {},
//
machineryTypeOptions: [],
machineryName: [],
//
rules: {
codeName: [
{ required: true, message: "代码名称不能为空", trigger: "blur" },
],
code: [
{ required: true, message: "代码编码不能为空", trigger: "blur" },
],
version: [
{ required: true, message: "版本号不能为空", trigger: "blur" },
],
machineryTypeId: [
{ required: true, message: "所属设备类别不能为空", trigger: "blur" },
],
machineryIds: [
{ required: true, message: "关联设备不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.data;
this.total = response.data.length;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
subjectId: null,
machineryTypeId: null,
url: "",
originalName: "",
machineryIds: "",
machineryTypeName: "",
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.codeId);
this.queryParams.ids = this.ids.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.fileList = [];
this.machineryIdsArr = {};
this.listTypeArr = {};
this.open = true;
this.title = "新增代码";
},
/** 查询设备类型下拉树结构 */
getTreeselect() {
listMachinerytype().then((response) => {
this.machineryTypeOptions = [];
const data = this.handleTree(
response.data,
"machineryTypeId",
"parentTypeId"
)[0];
this.machineryTypeOptions.push(data);
});
},
/** 转换设备类型数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.machineryTypeId,
label: node.machineryTypeName,
children: node.children,
};
},
//
handleNodeClick(data) {
this.machineryIdsArr = [];
this.form.machineryTypeName = data.machineryTypeName;
let arr = {
pageNum: 1,
pageSize: 9999,
machineryTypeId: null,
};
arr.machineryTypeId = data.machineryTypeId;
listMachinery(arr).then((response) => {
this.listTypeArr = response.rows;
});
},
//
handleAccompanyId(val) {
var arrid = [];
for (var item of val) {
arrid.push(item.machineryId);
this.form.machineryIds = arrid.join(",");
}
},
beforeUpload(e) {
// console.log(e);
this.files = e;
},
customUploadChangeImage2(files) {
if (files.status === "ready") return;
if (files.status === "success") {
const res = files.response || {};
if (res && res.code === 200) {
this.form.url = files.response.url;
this.form.originalName = files.response.originalFileName;
this.$message({
type: "success",
message: "上传成功!",
});
this.uploadVisible = false;
} else {
this.$message.error("上传失败!");
this.fileList = [];
}
} else {
this.$message.error("上传失败!");
this.fileList = [];
}
},
//
beforeRemove(files, fileList) {
return this.$confirm(`确定移除 ${files.name}`);
},
//
handleChangeUpload(file, fileList) {
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 10MB!");
return false;
}
},
handleExceedImage1(file, fileList) {
// console.log(file);
this.$message.warning(`当前限制上传 1 个文件,以上传 ${file.length}`);
},
//
previewFile() {
if (this.form.url != undefined && this.form.url != "") {
var url = this.form.url;
window.open(url);
} else {
this.$message.warning(`请上传文件`);
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.fileList = [];
this.machineryIdsArr = {};
this.form = row;
var name = {};
if (row.originalName != undefined && row.originalName != "") {
this.$set(name, "name", row.originalName);
this.fileList.push(name);
}
let arr = {
pageNum: 1,
pageSize: 9999,
machineryTypeId: null,
};
arr.machineryTypeId = row.machineryTypeId;
listMachinery(arr).then((response) => {
this.listTypeArr = response.rows;
});
let arr1 = row.cadCodeMachineryList.map((item) => item.machineryName);
this.machineryIdsArr = arr1;
let arr2 = row.cadCodeMachineryList.map((item) => item.machineryId);
this.form.machineryIds = arr2.join(",");
this.form.subjectId = row.codeId || this.ids;
this.open = true;
this.title = "修改代码";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.subjectId != null) {
reviseFile(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "修改成功",
message: response.msg,
type: "success",
});
this.listTypeArr = {};
this.machineryIdsArr = {};
this.open = false;
this.getList();
}
});
} else {
updateTeam(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "新增成功",
message: response.msg,
type: "success",
});
this.listTypeArr = {};
this.machineryIdsArr = {};
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const subjectIds = row.codeId || this.ids;
this.$modal
.confirm("是否确认删除当前的数据项?")
.then(function () {
return delTeam(subjectIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
/** 单选导出按钮操作 */
handleExportArr(e) {
this.queryParams.ids = e.codeId;
this.download(
"/cad/code/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
::v-deep .el-table {
.cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>

View File

@ -0,0 +1,722 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="文档名称" prop="fileName">
<el-input
v-model="queryParams.fileName"
placeholder="请输入文档名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="项目名称" prop="subjectName">
<el-input
v-model="queryParams.subjectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="" prop="type">
<el-select
v-model="queryParams.type"
placeholder="请选择"
clearable
style="width: 150px"
>
<el-option
v-for="dict in listTypeArr"
:key="dict.id"
:label="dict.name"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:dv:dvsubject:add']"
>新增</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col>
</el-col>
<!-- <el-col :span="1">
<el-button type="primary" size="mini" @click="Notificationsettings"
>文档类型管理</el-button
>
</el-col> -->
<!-- <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar> -->
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="文档名称" align="center" prop="fileName" />
<el-table-column label="文档编号" align="center" prop="fileCode" />
<el-table-column
label="版本号"
align="center"
prop="version"
:show-overflow-tooltip="true"
/>
<el-table-column
label="文档类型"
align="center"
prop="typeName"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.enableFlag"
/>
</template>
</el-table-column> -->
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:show-overflow-tooltip="true"
/>
<el-table-column
label="更新时间"
align="center"
prop="updateTime"
:show-overflow-tooltip="true"
/>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-download"
@click="handleExportArr(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>导出</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备点检保养项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="文档名称" prop="fileName">
<el-input v-model="form.fileName" placeholder="请输入文档名称" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="文档编号" prop="fileCode">
<el-input v-model="form.fileCode" placeholder="请输入文档编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="请输入版本号" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="文档类别" prop="typeName">
<el-select
v-model="form.typeName"
placeholder="请选择文档类别"
clearable
style="width: 100%"
@change="typeNameArr($event)"
value-key="id"
>
<el-option
v-for="dict in listTypeArr"
:key="dict.id"
:label="dict.name"
:value="dict"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="文件上传:"
prop="originalName"
label-width="100px"
>
<el-upload
ref="originalName"
class="upload-demo"
:headers="this.headers"
action="/prod-api/common/uploadMinio"
:before-remove="beforeRemove"
:on-change="customUploadChangeImage2"
:before-upload="beforeUpload"
:on-exceed="handleExceedImage1"
accept=".PDF"
name="file"
multiple
:limit="1"
:file-list="fileList"
>
<el-button size="small" type="primary" icon="el-icon-upload2"
>点击上传</el-button
>
<el-button type="primary" size="small" @click.stop="previewFile"
>&nbsp;预览文件</el-button
>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="4"
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 文档类型管理 -->
<!-- <el-dialog
title="文档类型管理"
:visible.sync="NotificationsettingsV"
center
>
<el-form ref="documentType" :model="documentType">
<span>
<el-form-item label-width="130px" label="新增文档类型名称">
<el-input
size="small"
v-model="addPriceForm.unit"
style="width: 30%"
/>&nbsp;&nbsp;
<el-button type="primary" size="small" @click="showAddPrice"
>添加</el-button
>
</el-form-item>
</span>
<el-card shadow="never">
<div slot="header">
<span>现有文件类型</span>
</div>
<el-row>
<el-col
:span="6"
v-for="(item, index) in documentType"
:key="index"
>
<el-form-item label-width="30px">
<el-input
v-model="item.unit"
size="small"
:disabled="true"
:max="99999.99"
style="width: 60%"
/>
<el-button
type="danger"
plain
size="small"
icon="el-icon-close"
@click.prevent="removeDomain(item)"
></el-button>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="NotificationsettingsV = false">取消</el-button>
<el-button type="primary" @click="validatoProInput">确认</el-button>
</div>
</el-dialog> -->
</div>
</template>
<script>
import {
list,
updateTeam,
reviseFile,
delTeam,
listType,
} from "@/api/management/document";
import { genCode } from "@/api/system/autocode/rule";
import { getToken } from "@/utils/auth";
export default {
name: "Dvsubject",
dicts: ["sys_yes_no", "mes_dvsubject_type"],
data() {
return {
//
headers: { Authorization: "Bearer " + getToken() },
autoGenFlag: false,
//
loading: false,
// s
id: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
fileName: null,
type: null,
ids: null,
},
//
form: { typeName: "", type: "", url: "", originalName: "" },
//
// NotificationsettingsV: false,
//
documentType: [
{
unit: "第一方",
},
{
unit: "第二方",
},
{
unit: "第三方",
},
{
unit: "第四方",
},
{
unit: "第五方",
},
],
addPriceForm: {
unit: "",
},
//
listTypeArr: {},
fileList: [],
//
rules: {
fileName: [
{ required: true, message: "文档名称不能为空", trigger: "blur" },
],
fileCode: [
{ required: true, message: "文档编号不能为空", trigger: "blur" },
],
type: [{ required: true, message: "请选择项目类型", trigger: "blur" }],
originalName: [
{ required: true, message: "文件上传不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
listType().then((response) => {
this.listTypeArr = response.rows;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
subjectId: null,
fileName: null,
fileCode: null,
type: null,
remark: null,
createTime: null,
updateTime: null,
url: null,
originalName: null,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.id = selection.map((item) => item.id);
this.queryParams.ids = this.id.join(",");
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.fileList = [];
listType().then((response) => {
this.listTypeArr = response.rows;
});
this.open = true;
this.title = "新增文档";
},
typeNameArr(e) {
this.form.typeName = e.name;
this.form.type = e.id;
},
beforeUpload(e) {
// console.log(e);
this.files = e;
},
customUploadChangeImage2(files) {
if (files.status === "ready") return;
if (files.status === "success") {
const res = files.response || {};
if (res && res.code === 200) {
this.form.url = files.response.url;
this.form.originalName = files.response.originalFileName;
this.$message({
type: "success",
message: "上传成功!",
});
this.uploadVisible = false;
} else {
this.$message.error("上传失败!");
this.fileList = [];
}
} else {
this.$message.error("上传失败!");
this.fileList = [];
}
},
//
beforeRemove(files, fileList) {
return this.$confirm(`确定移除 ${files.name}`);
},
//
handleChangeUpload(file, fileList) {
const isLt2M = file.size / 1024 / 1024 < 10;
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 10MB!");
return false;
}
},
handleExceedImage1(file, fileList) {
// console.log(file);
this.$message.warning(`当前限制上传 1 个文件,以上传 ${file.length}`);
},
//
previewFile() {
if (this.form.url != undefined && this.form.url != "") {
var url = this.form.url;
window.open(url);
} else {
this.$message.warning(`请上传文件`);
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.fileList = [];
this.form = row;
var name = {};
this.$set(name, "name", row.originalName);
this.fileList.push(name);
this.form.subjectId = row.id || this.id;
this.open = true;
this.title = "修改文档";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.subjectId != null) {
reviseFile(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "修改成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
} else {
updateTeam(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "新增成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const subjectIds = row.id || this.id;
this.$modal
.confirm("是否确认删除当前的数据项?")
.then(function () {
return delTeam(subjectIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/cad/file/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
/** 单选导出按钮操作 */
handleExportArr(e) {
this.queryParams.ids = e.id;
this.download(
"/cad/file/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
// //
// Notificationsettings() {
// this.addPriceForm = {
// unit: "",
// type: 1,
// };
// this.NotificationsettingsV = true;
// // reagentsGlance.unitDropDown().then(res => {
// // console.log(res);
// // if (res.code === 200) {
// // this.documentType.measureList = res.result.measureList || [];
// // this.documentType.smallList = res.result.smallList || [];
// // this.documentType.bigList = res.result.bigList || [];
// // }
// // });
// },
//
// showAddPrice() {
// // if (this.addPriceForm.unit != "") {
// // this.orderForm.bigList.push({
// // unit: this.addPriceForm.unit,
// // type: 1,
// // });
// // reagentsGlance
// // .addReagentUnit({ unit: this.addPriceForm.unit, type: 1 })
// // .then((res) => {
// // console.log(22);
// // if (res.code === 200) {
// // console.log(res);
// // this.$notify({
// // title: "",
// // message: res.message,
// // type: "success",
// // });
// // this.orderDialogVisible = false;
// // } else {
// // this.$notify({
// // title: "",
// // message: res.message,
// // type: "error",
// // });
// // }
// // });
// // } else {
// // this.$message.warning("");
// // }
// },
//
// removeDomain(item) {
// // this.$confirm('"' + item.unit + '"?', "", {
// // confirmButtonText: "",
// // cancelButtonText: "",
// // type: "warning",
// // }).then(() => {
// // reagentsGlance
// // .removeUnit({
// // id: item.id,
// // })
// // .then((result) => {
// // if (result.code === 200) {
// // var index = this.orderForm.smallList.indexOf(item);
// // if (index !== -1) {
// // this.orderForm.smallList.splice(index, 1);
// // }
// // this.$notify({
// // title: "",
// // message: result.message,
// // type: "success",
// // });
// // } else {
// // this.$notify({
// // title: "",
// // message: result.message,
// // type: "error",
// // });
// // }
// // });
// // });
// },
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
</style>

View File

@ -0,0 +1,428 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="类型名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入类型名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="项目名称" prop="subjectName">
<el-input
v-model="queryParams.subjectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="是否启用" prop="active">
<el-select
v-model="queryParams.active"
placeholder="请选择是否启用"
clearable
style="width: 150px"
>
<el-option
v-for="dict in whetherEnabled"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:dv:dvsubject:add']"
>新增</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col> -->
</el-col>
<!-- <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar> -->
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="文档类型名称" align="center" prop="name" />
<el-table-column label="是否启用" align="center" prop="active">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.active == '0'"
></span
>
<span class="el-table-column-span-1" v-if="scope.row.active == '2'"
></span
>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label-width="120px" label="文档类型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入文档类型名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="active">
<!-- <el-radio-group v-model="form.enableFlag">
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group> -->
<el-radio-group v-model="form.active">
<el-radio :label="0"></el-radio>
<el-radio :label="2"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="4"
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
list,
updateTeam,
reviseFile,
delTeam,
} from "@/api/management/documentType";
import { genCode } from "@/api/system/autocode/rule";
export default {
name: "Dvsubject",
dicts: ["sys_yes_no", "mes_dvsubject_type"],
data() {
return {
autoGenFlag: false,
//
loading: false,
// s
id: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
active: null,
},
//
form: {
subjectId: null,
active: 0,
},
whetherEnabled: [
{
value: "0",
label: "是",
},
{
value: "2",
label: "否",
},
],
//
rules: {
name: [
{ required: true, message: "文档类型名称不能为空", trigger: "blur" },
],
active: [
{ required: true, message: "是否启用不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询设备点检保养项目列表 */
getList() {
this.loading = true;
list(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
subjectId: null,
name: null,
active: 0,
remark: null,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.id = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增代码";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = row;
this.form.subjectId = row.id;
this.open = true;
this.title = "修改代码";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.subjectId != null) {
reviseFile(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "修改成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
} else {
updateTeam(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "新增成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const subjectIds = row.id || this.id;
this.$modal
.confirm("是否确认删除当前的数据项?")
.then(function () {
return delTeam(subjectIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download(
// "dv/dvsubject/export",
// {
// ...this.queryParams,
// },
// `dvsubject_${new Date().getTime()}.xlsx`
// );
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
.el-table-column-span {
background-color: #e8f4ff;
border-color: #d1e9ff;
color: #1890ff;
display: inline-block;
padding: 0 15px;
line-height: 30px;
font-size: 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
}
.el-table-column-span-1 {
background-color: #ffeded;
border-color: #ffdbdb;
color: #ff4949;
display: inline-block;
padding: 0 15px;
line-height: 30px;
font-size: 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
}
</style>

View File

@ -1,8 +1,18 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="班组类型" prop="calendarType">
<el-select v-model="queryParams.calendarType" placeholder="请选择班组类型">
<el-select
v-model="queryParams.calendarType"
placeholder="请选择班组类型"
>
<el-option
v-for="dict in dict.type.mes_calendar_type"
:key="dict.value"
@ -28,24 +38,36 @@
/>
</el-form-item>
<el-form-item label="开始日期" prop="startDate">
<el-date-picker clearable
<el-date-picker
clearable
v-model="queryParams.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开始日期">
placeholder="请选择开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期" prop="endDate">
<el-date-picker clearable
<el-date-picker
clearable
v-model="queryParams.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择结束日期">
placeholder="请选择结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
@ -58,7 +80,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['mes:cal:calplan:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -69,7 +92,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:cal:calplan:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -79,77 +103,120 @@
size="mini"
@click="handleExport"
v-hasPermi="['mes:cal:calplan:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="calplanList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="calplanList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="计划编号" align="center" prop="planCode" >
<el-table-column label="计划编号" align="center" prop="planCode">
<template slot-scope="scope">
<el-button
type="text"
@click="handleView(scope.row)"
v-hasPermi="['mes:cal:calplan:query']"
>{{scope.row.planCode}}</el-button>
v-hasPermi="['mes:cal:plan:query']"
>{{ scope.row.planCode }}</el-button
>
</template>
</el-table-column>
<el-table-column label="计划名称" width="200px" align="center" prop="planName" :show-overflow-tooltip="true"/>
<el-table-column
label="计划名称"
width="200px"
align="center"
prop="planName"
:show-overflow-tooltip="true"
/>
<el-table-column label="班组类型" align="center" prop="calendarType">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_calendar_type" :value="scope.row.calendarType"/>
<dict-tag
:options="dict.type.mes_calendar_type"
:value="scope.row.calendarType"
/>
</template>
</el-table-column>
<el-table-column label="开始日期" align="center" prop="startDate" width="120">
<el-table-column
label="开始日期"
align="center"
prop="startDate"
width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.startDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="结束日期" align="center" prop="endDate" width="120">
<el-table-column
label="结束日期"
align="center"
prop="endDate"
width="120"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
<span>{{ parseTime(scope.row.endDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="轮班方式" align="center" prop="shiftType" >
<el-table-column label="轮班方式" align="center" prop="shiftType">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_shift_type" :value="scope.row.shiftType"/>
<dict-tag
:options="dict.type.mes_shift_type"
:value="scope.row.shiftType"
/>
</template>
</el-table-column>
<el-table-column label="倒班方式" align="center" prop="shiftMethod" >
<el-table-column label="倒班方式" align="center" prop="shiftMethod">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_shift_method" :value="scope.row.shiftMethod"/>
<dict-tag
:options="dict.type.mes_shift_method"
:value="scope.row.shiftMethod"
/>
</template>
</el-table-column>
<el-table-column label="单据状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
<dict-tag
:options="dict.type.mes_order_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="scope.row.status =='PREPARE'"
v-if="scope.row.status == 'PREPARE'"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:cal:calplan:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
v-if="scope.row.status =='PREPARE'"
v-if="scope.row.status == 'PREPARE'"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:cal:calplan:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -157,7 +224,13 @@
/>
<!-- 添加或修改排班计划对话框 -->
<el-dialog :title="title" v-loading="formLoading" :visible.sync="open" width="960px" append-to-body>
<el-dialog
:title="title"
v-loading="formLoading"
:visible.sync="open"
width="960px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="8">
@ -167,10 +240,13 @@
</el-col>
<el-col :span="4">
<el-form-item label-width="80">
<el-switch v-model="autoGenFlag"
<el-switch
v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'" >
@change="handleAutoGenChange(autoGenFlag)"
v-if="optType != 'view'"
>
</el-switch>
</el-form-item>
</el-col>
@ -183,27 +259,34 @@
<el-row>
<el-col :span="8">
<el-form-item label="开始日期" prop="startDate">
<el-date-picker clearable
<el-date-picker
clearable
v-model="form.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开始日期">
placeholder="请选择开始日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结束日期" prop="endDate">
<el-date-picker clearable
<el-date-picker
clearable
v-model="form.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择结束日期">
placeholder="请选择结束日期"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组类型" prop="calendarType">
<el-select v-model="form.calendarType" placeholder="请选择班组类型">
<el-select
v-model="form.calendarType"
placeholder="请选择班组类型"
>
<el-option
v-for="dict in dict.type.mes_calendar_type"
:key="dict.value"
@ -222,13 +305,18 @@
v-for="dict in dict.type.mes_shift_type"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-if="form.shiftType !='SINGLE'" :span="6">
<el-col v-if="form.shiftType != 'SINGLE'" :span="6">
<el-form-item label="倒班方式" prop="shiftMethod">
<el-select style="width:100px" v-model="form.shiftMethod" placeholder="请选择倒班方式">
<el-select
style="width: 100px"
v-model="form.shiftMethod"
placeholder="请选择倒班方式"
>
<el-option
v-for="dict in dict.type.mes_shift_method"
:key="dict.value"
@ -238,9 +326,16 @@
</el-select>
</el-form-item>
</el-col>
<el-col v-if="form.shiftMethod =='DAY' && form.shiftType !='SINGLE'" :span="6">
<el-col
v-if="form.shiftMethod == 'DAY' && form.shiftType != 'SINGLE'"
:span="6"
>
<el-form-item label-width="20" prop="shiftCount">
<el-input-number :min="1" controls-position="right" v-model="form.shiftCount" >
<el-input-number
:min="1"
controls-position="right"
v-model="form.shiftCount"
>
</el-input-number>
</el-form-item>
</el-col>
@ -248,23 +343,53 @@
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs type="border-card" v-if="form.planId != null">
<el-tab-pane label="班次">
<Shift ref="shiftTab" :planId="form.planId" :optType="optType"></Shift>
<Shift
ref="shiftTab"
:planId="form.planId"
:optType="optType"
></Shift>
</el-tab-pane>
<el-tab-pane label="班组">
<Team ref="teamTab" :planId="form.planId" :calendarType="form.calendarType" :optType="optType"></Team>
<Team
ref="teamTab"
:planId="form.planId"
:calendarType="form.calendarType"
:optType="optType"
></Team>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE'">返回</el-button>
<el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' "> </el-button>
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.planId !=null">完成</el-button>
<el-button
type="primary"
@click="cancel"
v-if="optType == 'view' || form.status != 'PREPARE'"
>返回</el-button
>
<el-button
type="primary"
@click="submitForm"
v-if="form.status == 'PREPARE' && optType != 'view'"
> </el-button
>
<el-button
type="success"
@click="handleFinish"
v-if="
form.status == 'PREPARE' && optType != 'view' && form.planId != null
"
>完成</el-button
>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -272,18 +397,29 @@
</template>
<script>
import { listCalplan, getCalplan, delCalplan, addCalplan, updateCalplan } from "@/api/mes/cal/calplan";
import {
listCalplan,
getCalplan,
delCalplan,
addCalplan,
updateCalplan,
} from "@/api/mes/cal/calplan";
import Shift from "./shift";
import Team from "./team";
import {genCode} from "@/api/system/autocode/rule"
import { genCode } from "@/api/system/autocode/rule";
export default {
name: "Calplan",
dicts: ['mes_shift_method','mes_shift_type','mes_calendar_type','mes_order_status'],
components: {Shift,Team},
dicts: [
"mes_shift_method",
"mes_shift_type",
"mes_calendar_type",
"mes_order_status",
],
components: { Shift, Team },
data() {
return {
//
autoGenFlag:false,
autoGenFlag: false,
optType: undefined,
//
loading: true,
@ -310,7 +446,7 @@ export default {
pageSize: 10,
planCode: null,
planName: null,
calendarType:null,
calendarType: null,
startDate: null,
endDate: null,
shiftType: null,
@ -321,21 +457,21 @@ export default {
//
rules: {
planCode: [
{ required: true, message: "计划编号不能为空", trigger: "blur" }
{ required: true, message: "计划编号不能为空", trigger: "blur" },
],
planName: [
{ required: true, message: "计划名称不能为空", trigger: "blur" }
{ required: true, message: "计划名称不能为空", trigger: "blur" },
],
calendarType:[
{ required: true, message: "请选择班组类型", trigger: "blur" }
calendarType: [
{ required: true, message: "请选择班组类型", trigger: "blur" },
],
startDate: [
{ required: true, message: "开始日期不能为空", trigger: "blur" }
{ required: true, message: "开始日期不能为空", trigger: "blur" },
],
endDate: [
{ required: true, message: "结束日期不能为空", trigger: "blur" }
{ required: true, message: "结束日期不能为空", trigger: "blur" },
],
}
},
};
},
created() {
@ -345,7 +481,7 @@ export default {
/** 查询排班计划列表 */
getList() {
this.loading = true;
listCalplan(this.queryParams).then(response => {
listCalplan(this.queryParams).then((response) => {
this.calplanList = response.rows;
this.total = response.total;
this.loading = false;
@ -362,11 +498,11 @@ export default {
planId: null,
planCode: null,
planName: null,
calendarType:null,
calendarType: null,
startDate: null,
endDate: null,
shiftType: 'SHIFT_TWO',
shiftMethod: 'MONTH',
shiftType: "SHIFT_TWO",
shiftMethod: "MONTH",
shiftCount: 1,
status: "PREPARE",
remark: null,
@ -377,7 +513,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -393,9 +529,9 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.planId)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.planId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -405,10 +541,10 @@ export default {
this.optType = "add";
},
//
handleView(row){
handleView(row) {
this.reset();
const planId = row.planId || this.ids
getCalplan(planId).then(response => {
const planId = row.planId || this.ids;
getCalplan(planId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "查看排班计划";
@ -418,8 +554,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const planId = row.planId || this.ids
getCalplan(planId).then(response => {
const planId = row.planId || this.ids;
getCalplan(planId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改排班计划";
@ -428,16 +564,23 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.formLoading = true;
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.planId != null) {
updateCalplan(this.form).then(response => {
updateCalplan(this.form).then(
(response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.formLoading = false;
},
(err) => {
this.formLoading = false;
}
);
} else {
addCalplan(this.form).then(response => {
addCalplan(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -449,29 +592,38 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const planIds = row.planId || this.ids;
this.$modal.confirm('是否确认删除排班计划编号为"' + planIds + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除排班计划编号为"' + planIds + '"的数据项?')
.then(function () {
return delCalplan(planIds);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
.catch(() => {});
},
handleFinish(){
handleFinish() {
let that = this;
this.$modal.confirm('是否完成计划编制?【完成后将不能更改】').then(function(){
that.form.status = 'CONFIRMED';
that.$refs["form"].validate(valid => {
this.$modal
.confirm("是否完成计划编制?【完成后将不能更改】")
.then(function () {
that.form.status = "CONFIRMED";
that.$refs["form"].validate((valid) => {
if (valid) {
if (that.form.planId != null) {
updateCalplan(that.form).then(response => {
updateCalplan(that.form).then(
(response) => {
that.$modal.msgSuccess("已完成");
that.open = false;
that.getList();
that.formLoading = false;
},err =>{
that.form.status = 'PREPARE';
},
(err) => {
that.form.status = "PREPARE";
that.formLoading = false;
});
}
);
}
}
});
@ -479,20 +631,24 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('cal/calplan/export', {
...this.queryParams
}, `calplan_${new Date().getTime()}.xlsx`)
this.download(
"/cad/file/export",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
//
handleAutoGenChange(autoGenFlag){
if(autoGenFlag){
genCode('CAL_PLAN_CODE').then(response =>{
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
genCode("CAL_PLAN_CODE").then((response) => {
this.form.planCode = response;
});
}else{
} else {
this.form.planCode = null;
}
},
}
},
};
</script>

View File

@ -191,7 +191,7 @@ export default {
data() {
return {
//
autoGenFlag:false,
autoGenFlag:true,
optType: undefined,
//
loading: true,
@ -294,6 +294,9 @@ export default {
this.open = true;
this.title = "添加班组";
this.optType = "add";
genCode('CAL_TEAM_CODE').then(response =>{
this.form.teamCode = response;
});
},
//
handleView(row){

View File

@ -386,7 +386,7 @@ export default {
updateBy: null,
updateTime: null
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */

View File

@ -0,0 +1,162 @@
<template>
<div class="app-container">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<div id="AGVrate" style="width: 100%; height: 150px"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { echarts, Treeselect },
props: ["message"], //
data() {
return {
echartData: [],
};
},
watch: {
message: {
immediate: true,
handler(val) {
// console.log(val,'=============');
this.echartData = val;
// val.forEach((item) => {
// this.getDataNum.push(Number(item.ytdUvNew))
// this.getDataTime.push(moment(item.dt).format('YYYY-MM-DD'))
// })
this.$nextTick(() => {
//
this.drawLine();
});
},
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById("AGVrate"));
let value = "10%";
let title = "设备在线率";
var option = {
title: [
{
text: "{a|" + value + "}\n{c|" + title + "}",
x: "center",
top: "35%",
textStyle: {
rich: {
a: {
fontSize: 15,
color: "#ffffff",
},
c: {
fontSize: 10,
color: "#ffffff",
padding: [5, 0],
},
},
},
},
],
// backgroundColor: "#111",
polar: {
radius: ["70%", "95%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 90,
showBackground: true,
backgroundStyle: {
color: "rgba(66, 66, 66, .3)",
},
data: [10],
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: "#717171",
},
{
offset: 1,
color: "#717171",
},
]),
},
},
},
// {
// name: '',
// type: 'pie',
// startAngle: 80,
// radius: ['6%'],
// hoverAnimation: false,
// center: ['50%', '50%'],
// itemStyle: {
// color: 'rgba(66, 66, 66, .1)',
// borderWidth: 1,
// borderColor: '#5269EE',
// },
// data: [100],
// },
{
name: "",
type: "pie",
startAngle: 80,
radius: ["100%"],
hoverAnimation: false,
center: ["50%", "50%"],
itemStyle: {
color: "rgba(66, 66, 66, .1)",
borderWidth: 1,
borderColor: "#5269EE",
},
data: [100],
},
],
};
// 使
myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px !important;
min-height: calc(0vh - 0px) !important;
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<div class="app-container">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<div id="fault" style="width: 100%; height: 70px"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { echarts, Treeselect },
props: ["message"], //
data() {
return {
echartData: [],
};
},
watch: {
message: {
immediate: true,
handler(val) {
// console.log(val,'=============');
this.echartData = val;
// val.forEach((item) => {
// this.getDataNum.push(Number(item.ytdUvNew))
// this.getDataTime.push(moment(item.dt).format('YYYY-MM-DD'))
// })
this.$nextTick(() => {
//
this.drawLine();
});
},
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById("fault"));
var option = {
title: [
{
text: "1%",
x: "center",
top: "35%",
textStyle: {
fontSize: "15",
color: "#FFFFFF",
fontFamily: "DINAlternate-Bold, DINAlternate",
foontWeight: "100",
},
},
],
// backgroundColor: "#111",
polar: {
radius: ["75%", "90%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 90,
showBackground: true,
backgroundStyle: {
color: "rgba(66, 66, 66, .3)",
},
data: [1],
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: "#717171",
},
{
offset: 1,
color: "#717171",
},
]),
},
},
},
// {
// name: '',
// type: 'pie',
// startAngle: 80,
// radius: ['6%'],
// hoverAnimation: false,
// center: ['50%', '50%'],
// itemStyle: {
// color: 'rgba(66, 66, 66, .1)',
// borderWidth: 1,
// borderColor: '#5269EE',
// },
// data: [100],
// },
{
name: "",
type: "pie",
startAngle: 80,
radius: ["100%"],
hoverAnimation: false,
center: ["50%", "50%"],
itemStyle: {
color: "rgba(66, 66, 66, .1)",
borderWidth: 1,
borderColor: "#5269EE",
},
data: [100],
},
],
};
// 使
myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px !important;
min-height: calc(0vh - 0px) !important;
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<div class="app-container">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<div id="offline" style="width: 100%; height: 70px"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { echarts, Treeselect },
props: ["message"], //
data() {
return {
echartData: [],
};
},
watch: {
message: {
immediate: true,
handler(val) {
// console.log(val,'=============');
this.echartData = val;
// val.forEach((item) => {
// this.getDataNum.push(Number(item.ytdUvNew))
// this.getDataTime.push(moment(item.dt).format('YYYY-MM-DD'))
// })
this.$nextTick(() => {
//
this.drawLine();
});
},
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById("offline"));
var option = {
title: [
{
text: "5%",
x: "center",
top: "35%",
textStyle: {
fontSize: "15",
color: "#FFFFFF",
fontFamily: "DINAlternate-Bold, DINAlternate",
foontWeight: "100",
},
},
],
// backgroundColor: "#111",
polar: {
radius: ["75%", "90%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 90,
showBackground: true,
backgroundStyle: {
color: "rgba(66, 66, 66, .3)",
},
data: [5],
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: "#717171",
},
{
offset: 1,
color: "#717171",
},
]),
},
},
},
// {
// name: '',
// type: 'pie',
// startAngle: 80,
// radius: ['6%'],
// hoverAnimation: false,
// center: ['50%', '50%'],
// itemStyle: {
// color: 'rgba(66, 66, 66, .1)',
// borderWidth: 1,
// borderColor: '#5269EE',
// },
// data: [100],
// },
{
name: "",
type: "pie",
startAngle: 80,
radius: ["100%"],
hoverAnimation: false,
center: ["50%", "50%"],
itemStyle: {
color: "rgba(66, 66, 66, .1)",
borderWidth: 1,
borderColor: "#5269EE",
},
data: [100],
},
],
};
// 使
myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px !important;
min-height: calc(0vh - 0px) !important;
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<div class="app-container">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 100%; height: 70px"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { echarts, Treeselect },
props: ["message"], //
data() {
return {
echartData: [],
};
},
watch: {
message: {
immediate: true,
handler(val) {
// console.log(val,'=============');
this.echartData = val;
// val.forEach((item) => {
// this.getDataNum.push(Number(item.ytdUvNew))
// this.getDataTime.push(moment(item.dt).format('YYYY-MM-DD'))
// })
this.$nextTick(() => {
//
this.drawLine();
});
},
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById("main"));
var option = {
title: [
{
text: "10%",
x: "center",
top: "35%",
textStyle: {
fontSize: "15",
color: "#FFFFFF",
fontFamily: "DINAlternate-Bold, DINAlternate",
foontWeight: "100",
},
},
],
// backgroundColor: "#111",
polar: {
radius: ["75%", "90%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 90,
showBackground: true,
backgroundStyle: {
color: "rgba(66, 66, 66, .3)",
},
data: [10],
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: "#717171",
},
{
offset: 1,
color: "#717171",
},
]),
},
},
},
// {
// name: '',
// type: 'pie',
// startAngle: 80,
// radius: ['6%'],
// hoverAnimation: false,
// center: ['50%', '50%'],
// itemStyle: {
// color: 'rgba(66, 66, 66, .1)',
// borderWidth: 1,
// borderColor: '#5269EE',
// },
// data: [100],
// },
{
name: "",
type: "pie",
startAngle: 80,
radius: ["100%"],
hoverAnimation: false,
center: ["50%", "50%"],
itemStyle: {
color: "rgba(66, 66, 66, .1)",
borderWidth: 1,
borderColor: "#5269EE",
},
data: [100],
},
],
};
// 使
myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px !important;
min-height: calc(0vh - 0px) !important;
}
</style>

View File

@ -0,0 +1,162 @@
<template>
<div class="app-container">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<div id="onlineRate" style="width: 100%; height: 150px"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { echarts, Treeselect },
props: ["message"], //
data() {
return {
echartData: [],
};
},
watch: {
message: {
immediate: true,
handler(val) {
// console.log(val,'=============');
this.echartData = val;
// val.forEach((item) => {
// this.getDataNum.push(Number(item.ytdUvNew))
// this.getDataTime.push(moment(item.dt).format('YYYY-MM-DD'))
// })
this.$nextTick(() => {
//
this.drawLine();
});
},
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById("onlineRate"));
let value = "50%";
let title = "设备在线率";
var option = {
title: [
{
text: "{a|" + value + "}\n{c|" + title + "}",
x: "center",
top: "35%",
textStyle: {
rich: {
a: {
fontSize: 15,
color: "#ffffff",
},
c: {
fontSize: 10,
color: "#ffffff",
padding: [5, 0],
},
},
},
},
],
// backgroundColor: "#111",
polar: {
radius: ["70%", "95%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 90,
showBackground: true,
backgroundStyle: {
color: "rgba(66, 66, 66, .3)",
},
data: [50],
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: "#717171",
},
{
offset: 1,
color: "#717171",
},
]),
},
},
},
// {
// name: '',
// type: 'pie',
// startAngle: 80,
// radius: ['6%'],
// hoverAnimation: false,
// center: ['50%', '50%'],
// itemStyle: {
// color: 'rgba(66, 66, 66, .1)',
// borderWidth: 1,
// borderColor: '#5269EE',
// },
// data: [100],
// },
{
name: "",
type: "pie",
startAngle: 80,
radius: ["100%"],
hoverAnimation: false,
center: ["50%", "50%"],
itemStyle: {
color: "rgba(66, 66, 66, .1)",
borderWidth: 1,
borderColor: "#5269EE",
},
data: [100],
},
],
};
// 使
myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px !important;
min-height: calc(0vh - 0px) !important;
}
</style>

View File

@ -0,0 +1,162 @@
<template>
<div class="app-container">
<!-- ECharts 准备一个定义了宽高的 DOM -->
<div id="roboticRate" style="width: 100%; height: 150px"></div>
</div>
</template>
<script>
import * as echarts from "echarts";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
components: { echarts, Treeselect },
props: ["message"], //
data() {
return {
echartData: [],
};
},
watch: {
message: {
immediate: true,
handler(val) {
// console.log(val,'=============');
this.echartData = val;
// val.forEach((item) => {
// this.getDataNum.push(Number(item.ytdUvNew))
// this.getDataTime.push(moment(item.dt).format('YYYY-MM-DD'))
// })
this.$nextTick(() => {
//
this.drawLine();
});
},
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById("roboticRate"));
let value = "30%";
let title = "设备在线率";
var option = {
title: [
{
text: "{a|" + value + "}\n{c|" + title + "}",
x: "center",
top: "35%",
textStyle: {
rich: {
a: {
fontSize: 15,
color: "#ffffff",
},
c: {
fontSize: 10,
color: "#ffffff",
padding: [5, 0],
},
},
},
},
],
// backgroundColor: "#111",
polar: {
radius: ["70%", "95%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: "category",
show: true,
axisLabel: {
show: false,
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 90,
showBackground: true,
backgroundStyle: {
color: "rgba(66, 66, 66, .3)",
},
data: [30],
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: "#717171",
},
{
offset: 1,
color: "#717171",
},
]),
},
},
},
// {
// name: '',
// type: 'pie',
// startAngle: 80,
// radius: ['6%'],
// hoverAnimation: false,
// center: ['50%', '50%'],
// itemStyle: {
// color: 'rgba(66, 66, 66, .1)',
// borderWidth: 1,
// borderColor: '#5269EE',
// },
// data: [100],
// },
{
name: "",
type: "pie",
startAngle: 80,
radius: ["100%"],
hoverAnimation: false,
center: ["50%", "50%"],
itemStyle: {
color: "rgba(66, 66, 66, .1)",
borderWidth: 1,
borderColor: "#5269EE",
},
data: [100],
},
],
};
// 使
myChart.setOption(option);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
padding: 0px !important;
min-height: calc(0vh - 0px) !important;
}
</style>

View File

@ -0,0 +1,678 @@
<template>
<div class="shopping-classify">
<div class="right-menu" id="container">
<!-- -->
<div style="height: 10%">
<el-row type="flex" justify="space-between" style="height: 100%">
<el-col :span="10">
<div
class="grid-content bg-purple"
style="display: flex; flex-direction: row-reverse"
>
<!-- <svg-icon
:icon-class="isFullscreen ? 'exit-fullscreen' : 'fullscreen'"
style="
width: 20px;
height: 20px;
color: #f4deb0;
margin: 0% -70% 1% 0%;
"
@click="buttoncli"
/> -->
<img
@click="buttoncli"
style="height: 40px; margin: 5% 4.3% 0% 0%"
src="../../../../assets/images/return.png"
/></div
></el-col>
<el-col
:span="5"
style="
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
"
><div style="color: #fff; font-size: 30px; font-weight: 700">
{{ this.title }}
</div>
<div
style="color: rgb(9 207 255); font-size: 18px; margin-bottom: 4%"
>
<span>{{ this.dateYear }}</span> {{ this.dateDay }}
<span>{{ this.dateWeek }}</span>
</div>
</el-col>
<el-col :span="10"
><div class="grid-content bg-purple" style="display: flex">
<img
style="height: 40px; margin: 5% 0% 0% 4%"
src="../../../../assets/images/biaotixiugai.png"
@click="handleChange"
/>
</div>
</el-col>
</el-row>
</div>
<!-- 第一部分 -->
<div style="height: 10%">
<el-row type="flex" class="row-bg-1" justify="space-between">
<el-col :span="8"
><div class="grid-content bg-purple">
<el-row
:gutter="8"
style="display: flex; justify-content: center"
>
<el-col :span="3"
><div class="grid-content bg-purple" style="width: 70px">
<online :message="this.barquantity" /></div
></el-col>
<el-col :span="4"
><div class="grid-content bg-purple" style="margin-top: 10%">
<div style="font-size: 25px">12</div>
<div>当前在线</div>
</div></el-col
>
</el-row>
</div></el-col
>
<el-col :span="8"
><div class="grid-content bg-purple">
<el-row
:gutter="8"
style="display: flex; justify-content: center"
>
<el-col :span="3"
><div class="grid-content bg-purple" style="width: 70px">
<offline :message="this.offlineData" /></div
></el-col>
<el-col :span="4"
><div class="grid-content bg-purple" style="margin-top: 10%">
<div style="font-size: 25px">12</div>
<div>当前离线</div>
</div></el-col
>
</el-row>
</div></el-col
>
<el-col :span="8"
><div class="grid-content bg-purple">
<el-row
:gutter="8"
style="display: flex; justify-content: center"
>
<el-col :span="3"
><div class="grid-content bg-purple" style="width: 70px">
<fault :message="this.faultData" /></div
></el-col>
<el-col :span="4"
><div class="grid-content bg-purple" style="margin-top: 10%">
<div style="font-size: 25px">12</div>
<div>当前故障</div>
</div></el-col
>
</el-row>
</div></el-col
>
</el-row>
</div>
<!-- 第二部分 -->
<div style="height: 80%">
<el-row type="flex" class="row-bg-3" justify="space-between">
<el-col :span="8"
><div style="display: flex; flex-direction: column; height: 100%">
<div style="height: 10%">
<el-radio-group
size="mini"
v-model="radio1"
style="
display: flex;
justify-content: flex-end;
margin: 2% 5% 0% 0%;
"
>
<el-radio-button :label="1">当前</el-radio-button>
<el-radio-button :label="2">本月</el-radio-button>
</el-radio-group>
</div>
<div style="height: 20%">
<div style="height: 100%">
<el-row :gutter="20">
<el-col :span="6"
><div style="margin-left: 28%">
<onlineRate :message="this.onlineRateData" /></div
></el-col>
<el-col :span="6"
><div style="margin: 45% 0% 0% 17%">2</div></el-col
>
<el-col :span="6"
><div style="margin: 45% 27% 0% 0%; color: #2cc195">
3
</div></el-col
>
<el-col :span="6"
><div style="margin: 45% 55% 0% 0%; color: #ec1821">
4
</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 25%">
<div style="height: 100%">
<el-row :gutter="24">
<el-col :span="8"
><div style="margin: 40% 0% 0% 3%">2</div></el-col
>
<el-col :span="8"
><div style="margin: 40% 7% 0% 0%; color: #f5c959">
3
</div></el-col
>
<el-col :span="8"
><div style="margin: 40% 18% 0% 0%">4</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 45%">
<div style="height: 100%">
<el-row :gutter="20">
<el-col :span="6"
><div style="margin: 25% 0% 0% 33%">1</div></el-col
>
<el-col :span="6"
><div style="margin: 25% 0% 0% 5%; color: #f5c959">
2
</div></el-col
>
<el-col :span="6"
><div style="margin: 25% 27% 0% 0%; color: #ec1821">
3
</div></el-col
>
<el-col :span="6"
><div style="margin: 25% 60% 0% 0%; color: #2cc195">
4
</div></el-col
>
</el-row>
</div>
</div>
</div>
</el-col>
<el-col :span="8">
<div style="display: flex; flex-direction: column; height: 100%">
<div style="height: 10%">
<el-radio-group
size="mini"
v-model="radio2"
style="
display: flex;
justify-content: flex-end;
margin: 2% 5% 0% 0%;
"
>
<el-radio-button :label="1">当前</el-radio-button>
<el-radio-button :label="2">本月</el-radio-button>
</el-radio-group>
</div>
<div style="height: 20%">
<div style="height: 100%">
<el-row :gutter="20">
<el-col :span="6"
><div style="margin-left: 28%">
<roboticRate :message="this.roboticRateData" /></div
></el-col>
<el-col :span="6"
><div style="margin: 45% 0% 0% 30%">2</div></el-col
>
<el-col :span="6"
><div style="margin: 45% 15% 0% 0%; color: #2cc195">
3
</div></el-col
>
<el-col :span="6"
><div style="margin: 45% 40% 0% 0%; color: #ec1821">
4
</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 25%">
<div style="height: 100%">
<el-row :gutter="24">
<el-col :span="8"
><div style="margin: 40% 0% 0% 12%">2</div></el-col
>
<el-col :span="8"
><div style="margin: 40% 0% 0% 2%; color: #f5c959">
3
</div></el-col
>
<el-col :span="8"
><div style="margin: 40% 10% 0% 0%">4</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 45%">
<div style="height: 100%">
<el-row :gutter="20">
<el-col :span="6"
><div style="margin: 25% 0% 0% 46%">1</div></el-col
>
<el-col :span="6"
><div style="margin: 25% 0% 0% 17%; color: #f5c959">
2
</div></el-col
>
<el-col :span="6"
><div style="margin: 25% 17% 0% 0%; color: #ec1821">
3
</div></el-col
>
<el-col :span="6"
><div style="margin: 25% 50% 0% 0%; color: #2cc195">
4
</div></el-col
>
</el-row>
</div>
</div>
</div>
</el-col>
<el-col :span="8">
<div style="display: flex; flex-direction: column; height: 100%">
<div style="height: 10%">
<el-radio-group
size="mini"
v-model="radio3"
style="
display: flex;
justify-content: flex-end;
margin: 2% 5% 0% 0%;
"
>
<el-radio-button :label="1">当前</el-radio-button>
<el-radio-button :label="2">本月</el-radio-button>
</el-radio-group>
</div>
<div style="height: 20%">
<div style="height: 100%">
<el-row :gutter="20">
<el-col :span="6"
><div style="margin-left: 28%">
<AGVrate :message="this.AGVrateData" /></div
></el-col>
<el-col :span="6"
><div style="margin: 45% 0% 0% 32%">2</div></el-col
>
<el-col :span="6"
><div style="margin: 45% 0% 0% 0%; color: #2cc195">
3
</div></el-col
>
<el-col :span="6"
><div style="margin: 45% 40% 0% 0%; color: #ec1821">
4
</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 25%">
<div style="height: 100%">
<el-row :gutter="24">
<el-col :span="8"
><div style="margin: 40% 0% 0% 17%">2</div></el-col
>
<el-col :span="8"
><div style="margin: 40% 0% 0% 6%; color: #f5c959">
3
</div></el-col
>
<el-col :span="8"
><div style="margin: 40% 4% 0% 0%">4</div></el-col
>
</el-row>
</div>
</div>
<div style="height: 45%">
<div style="height: 100%"></div>
</div></div
></el-col>
</el-row>
</div>
<!--标题修改-->
<el-dialog :visible.sync="titleVisible" append-to-body width="30%">
<el-form ref="installForm" :model="installForm" label-width="80px">
<el-form-item label="标题修改">
<el-input
maxlength="11"
show-word-limit
v-model="installForm.name"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="titleVisible = false">取消</el-button>
<el-button type="primary" @click="sumitInstall">确认</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import dayjs from "dayjs";
// import * as statisServer from "@/api/statistics";
// import { getInfo } from "@/api/user";
import screenfull from "screenfull";
import online from "./components/online.vue";
import offline from "./components/offline.vue";
import fault from "./components/fault.vue";
import onlineRate from "./components/onlineRate.vue";
import roboticRate from "./components/roboticRate.vue";
import AGVrate from "./components/AGVrate.vue";
export default {
components: {
online,
offline,
fault,
onlineRate,
roboticRate,
AGVrate,
dayjs,
},
data() {
return {
dateDay: null,
dateYear: null,
dateWeek: null,
weekday: [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
],
timer: null,
screenfull: false,
title: "设备监控分析",
titleVisible: false,
installForm: { name: "" },
taskForm: {
total_num: 0, // /
completed_num: 0,
incompleted_num: 0,
},
lineChartData: {},
totalarr: 0, //
month: "", //
Contracts: "",
barquantity: [],
offlineData: [],
faultData: [],
onlineRateData: [],
roboticRateData: [],
AGVrateData: [],
signarr: [],
detection: [],
reports: "",
issue: "1",
accumulation: true,
thisYear: false,
isFullscreen: false,
radio1: 1,
radio2: 1,
radio3: 1,
};
},
created() {
this.timer = setInterval(() => {
const date = dayjs(new Date());
this.dateDay = date.format("HH:mm:ss");
this.dateYear = date.format("YYYY-MM-DD");
this.dateWeek = date.format(this.weekday[date.day()]);
}, 1000);
//
window.addEventListener("resize", this.onresize);
this.getList();
this.findTasks();
this.findContactList();
this.findSampleClass();
this.findvalid();
this.findSortContNumList();
this.NumberReports();
this.factorNumber();
},
beforeDestroy() {
if (this.timer) {
clearInterval(this.timer);
}
//
window.removeEventListener("resize", this.onresize);
},
methods: {
//
onresize(event) {
// windowIE
let winFlag = window.innerHeight === window.screen.height;
// window -- IE
let isFull = window.fullScreen || document.webkitIsFullScreen;
if (isFull === undefined) {
this.isFullscreen = winFlag;
} else {
this.isFullscreen = winFlag || isFull;
}
// console.log(winFlag); // true false
},
buttoncli() {
const element = document.getElementById("container");
if (!screenfull) {
this.$message({
message: "浏览器不能全屏,安装其他版本试试",
type: "warning",
});
return false;
}
screenfull.toggle(element);
this.findSampleClass();
this.findSortContNumList();
this.factorNumber();
},
buttoncliArr() {
const element = document.getElementById("container");
if (!screenfull) {
this.$message({
message: "浏览器不能全屏,安装其他版本试试",
type: "warning",
});
return false;
}
screenfull.toggle(element);
},
getList() {
// getInfo().then(res => {
// this.title = res.result.screenName;
// });
},
//
findTasks() {
// statisServer.findCompleteTask({ type: 1 }).then(res => {
// if (res.code === 200) {
// const taskForm = res.result.find(i => i.name === "");
// this.taskForm.total_num = taskForm.totalCnt;
// this.taskForm.completed_num = Number(
// taskForm.totalCnt - taskForm.completeCnt
// ).toFixed(0);
// this.taskForm.incompleted_num = taskForm.completeCnt;
// }
// });
},
//
findContactList() {
// statisServer.findValidContractsForPass11Month().then(res => {
// if (res.code === 200) {
// this.lineChartData = res.result || [];
// //
// this.lineChartData.contactNum.forEach(item => {
// this.totalarr += item;
// });
// //
// this.month = this.lineChartData.contactNum.pop();
// }
// });
},
//
findSampleClass() {
// statisServer.findStoredSampleClassificationCnt({ limit: 6 }).then(res => {
// if (res.code === 200) {
// var arr = [];
// var barData = res.result.xNameData;
// var barquantity = res.result.xValData;
// //
// barData.forEach((item, i) => {
// arr.push({
// name: item,
// value: barquantity[i]
// });
// });
// this.barquantity = arr;
// }
// });
},
findvalid() {
// statisServer.findValidContracts({ type: 0 }).then(res => {
// if (res.code === 200) {
// this.Contracts = res.result.cusSum;
// }
// });
},
//
findSortContNumList() {
// statisServer.findSortContNum({ type: 1, limit: 5 }).then(res => {
// if (res.code === 200) {
// var arr = [];
// var barData = res.result.xNameData;
// var barquantity = res.result.xValData;
// //
// barData.forEach((item, i) => {
// arr.push({
// code: item,
// fundPost: barquantity[i]
// });
// });
// arr.sort((a, b) => {
// return b.fundPost - a.fundPost;
// }); //
// this.signarr = arr.slice(0, 10);
// }
// });
},
//
NumberReports() {
// statisServer.getReport({ type: this.issue }).then(res => {
// if (res.code === 200) {
// this.reports = res.result;
// }
// });
},
//
factorNumber() {
// statisServer.detectorFactor().then(res => {
// if (res.code === 200) {
// var arr = res.result;
// arr.sort((a, b) => {
// return b.value - a.value;
// }); //
// this.detection = arr.slice(0, 10);
// }
// });
},
handleChange() {
this.titleVisible = true;
},
//
sumitInstall() {
// statisServer.updateName(this.installForm).then(res => {
// if (res.code === 200) {
// this.$notify({
// title: "",
// message: res.message,
// type: "success"
// });
// this.titleVisible = false;
// this.getList();
// }
// });
},
accumulationClick() {
this.issue = 2;
this.accumulation = false;
this.thisYear = true;
this.NumberReports();
},
thisYearClick() {
this.issue = 1;
this.accumulation = true;
this.thisYear = false;
this.NumberReports();
},
},
};
</script>
<style lang="scss" scoped>
#container {
display: flex;
flex-direction: column;
width: 100%;
height: 100vh;
background: url("../../../../assets/images/zhubeijing.png") center center
no-repeat;
background-size: 100% 100%;
}
.row-bg-1 {
height: 70px;
color: #fff;
text-align: center;
}
.row-bg-3 {
height: 100%;
text-align: center;
color: #fff;
font-size: 20px;
font-weight: 700;
}
.row-bg-4 {
color: #8bdbe6;
font-size: 25px;
margin-top: 27%;
font-weight: 500;
}
.row-bg-5 {
height: 365px;
text-align: center;
color: #fff;
font-size: 20px;
font-weight: 700;
}
</style>

View File

@ -16,7 +16,7 @@
<div class="head-container">
<el-tree
:data="machineryTypeOptions"
:props="defaultProps"
:props="defaultPropss"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
@ -27,7 +27,14 @@
</el-col>
<!--设备数据-->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="设备编码" prop="machineryCode">
<el-input
v-model="queryParams.machineryCode"
@ -47,8 +54,16 @@
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
@ -61,7 +76,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['mes:dv:machinery:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -72,7 +88,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:dv:machinery:edit']"
>修改</el-button>
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -83,7 +100,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:dv:machinery:remove']"
>删除</el-button>
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -93,7 +111,8 @@
size="mini"
@click="handleImport"
v-hasPermi="['mes:dv:machinery:import']"
>导入</el-button>
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -103,33 +122,86 @@
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:machinery:export']"
>导出</el-button>
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="machineryList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="machineryList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="设备编码" width = "120" align="center" key="machineryCode" prop="machineryCode">
<el-table-column
label="设备编码"
width="120"
align="center"
key="machineryCode"
prop="machineryCode"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleView(scope.row)"
v-hasPermi="['mes:dv:machinery:query']"
>{{scope.row.machineryCode}}</el-button>
>{{ scope.row.machineryCode }}</el-button
>
</template>
</el-table-column>
<el-table-column label="设备名称" min-width="120" align="left" key="machineryName" prop="machineryName" :show-overflow-tooltip="true" />
<el-table-column label="品牌" align="left" key="machineryBrand" prop="machineryBrand" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="left" key="machinerySpec" prop="machinerySpec" :show-overflow-tooltip="true" />
<el-table-column label="所属车间" align="center" key="machineryTypeName" prop="machineryTypeName" :show-overflow-tooltip="true" />
<el-table-column label="设备状态" align="center" key="status" prop="status" >
<el-table-column
label="设备名称"
min-width="120"
align="left"
key="machineryName"
prop="machineryName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="品牌"
align="left"
key="machineryBrand"
prop="machineryBrand"
:show-overflow-tooltip="true"
/>
<el-table-column
label="规格型号"
align="left"
key="machinerySpec"
prop="machinerySpec"
:show-overflow-tooltip="true"
/>
<el-table-column
label="所属车间"
align="center"
key="workshopName"
prop="workshopName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="设备状态"
align="center"
key="status"
prop="status"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_machinery_status" :value="scope.row.status"/>
<dict-tag
:options="dict.type.mes_machinery_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="160"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
@ -147,20 +219,22 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:machinery:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:machinery:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@ -174,79 +248,223 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="设备编码" prop="itemCode">
<el-input v-model="form.machineryCode" readonly="readonly" maxlength="64" v-if="optType == 'view'"/>
<el-input v-model="form.machineryCode" placeholder="请输入设备编码" maxlength="64" v-else/>
<el-form-item label="设备编码" prop="machineryCode">
<el-input
v-model="form.machineryCode"
readonly="readonly"
maxlength="64"
v-if="optType == 'view'"
/>
<el-input
v-model="form.machineryCode"
placeholder="请输入设备编码"
maxlength="64"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="80">
<el-switch v-model="autoGenFlag"
<el-switch
v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
@change="handleAutoGenChange(autoGenFlag)"
v-if="optType != 'view'"
>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="itemName">
<el-input v-model="form.machineryName" maxlength="255" readonly="readonly" v-if="optType=='view'" />
<el-input v-model="form.machineryName" placeholder="请输入设备名称" maxlength="255" v-else/>
<el-form-item label="设备名称" prop="machineryName">
<el-input
v-model="form.machineryName"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.machineryName"
placeholder="请输入设备名称"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="品牌" prop="machineryBrand">
<el-input v-model="form.machineryBrand" maxlength="255" readonly="readonly" v-if="optType=='view'" />
<el-input v-model="form.machineryBrand" placeholder="请输入品牌" maxlength="255" v-else/>
<el-input
v-model="form.machineryBrand"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.machineryBrand"
placeholder="请输入品牌"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备分类" prop="machineryTypeId">
<treeselect v-model="form.machineryTypeId" :options="machineryTypeOptions" :normalizer="normalizer" disabled v-if="optType=='view'" />
<treeselect v-model="form.machineryTypeId" :options="machineryTypeOptions" :normalizer="normalizer" placeholder="请选择所属分类" v-else :disable-branch-nodes='true' />
<treeselect
v-model="form.machineryTypeId"
:options="machineryTypeOptions"
:normalizer="normalizer"
placeholder="请选择设备类型"
@select="handleNode"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="ip地址" prop="ip">
<el-input
v-model="form.ip"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.ip"
placeholder="请输入ip地址"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="端口号" prop="port">
<el-input
v-model="form.port"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.port"
placeholder="请输入端口号"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="规格型号" prop="machinerySpec">
<el-input v-model="form.machinerySpec" type="textarea" maxlength="255" readonly="readonly" v-if="optType=='view'" />
<el-input v-model="form.machinerySpec" type="textarea" placeholder="请输入规格型号" maxlength="255" v-else/>
<el-input
v-model="form.machinerySpec"
type="textarea"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.machinerySpec"
type="textarea"
placeholder="请输入规格型号"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属车间" prop="workshopId">
<el-select v-model="form.workshopId" placeholder="请选择车间">
<!-- <el-form-item label="所属车间" prop="workshopName">
<el-select
v-model="form.workshopName"
placeholder="请选择车间"
style="width: 100%"
value-key="workshopId"
@change="handleAccompanyId"
>
<el-option
v-for="item in workshopOptions"
:key="item.workshopId"
:label="item.workshopName"
:value="item.workshopId"
:value="item"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="关联代码程序" prop="idList">
<el-select
v-model="form.idList"
placeholder="请选择关联代码程序"
clearable
filterable
multiple
style="width: 100%"
>
<el-option
v-for="dict in listTypeArr"
:key="dict.codeId"
:label="dict.codeName"
:value="dict.codeId"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="异常报警通知" prop="userName">
<el-input
style="width: 90%"
v-model="userName"
:readonly="true"
/>
<el-button type="text" @click="addInvolvedUserId"
>&nbsp;选择通知人</el-button
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" readonly v-if="optType=='view'"></el-input>
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" v-else></el-input>
<el-input
v-model="form.remark"
type="textarea"
readonly
v-if="optType == 'view'"
></el-input>
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
v-else
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button>
<el-button type="primary" @click="cancel" v-if="optType == 'view'"
>返回</el-button
>
<el-button type="primary" @click="submitForm" v-else> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 物料导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
@ -263,10 +481,17 @@
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的设备数据
<el-checkbox v-model="upload.updateSupport" />
是否更新已经存在的设备数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -274,26 +499,55 @@
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<el-dialog
title="添加"
:visible.sync="addInvolvedUserIdVisible"
center
width="70%"
>
<!-- 人员选择 -->
<personnelSelection
ref="checked"
:inputValue="inputName"
@getSelectList="getSelectList"
/>
<div style="margin-top: -97px; text-align: center">
<el-button @click="addInvolvedUserIdVisible = false">取消</el-button>
<el-button type="primary" @click="saveInvolvedUserId">保存</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMachinery, getMachinery, delMachinery, addMachinery, updateMachinery } from "@/api/mes/dv/machinery";
import {
listMachinery,
getMachinery,
delMachinery,
addMachinery,
updateMachinery,
listMes,
UserArr,
machineryUsers,
} from "@/api/mes/dv/machinery";
import { listMachinerytype } from "@/api/mes/dv/machinerytype";
import { listAllWorkshop } from "@/api/mes/md/workshop";
import {genCode} from "@/api/system/autocode/rule"
import { genCode } from "@/api/system/autocode/rule";
import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import personnelSelection from "../../../components/personnelSelection.vue";
export default {
name: "Machinery",
dicts: ['sys_yes_no','mes_machinery_status'],
components: { Treeselect },
dicts: ["sys_yes_no", "mes_machinery_status"],
components: { Treeselect, personnelSelection },
data() {
return {
//
autoGenFlag:false,
autoGenFlag: false,
optType: undefined,
//
loading: true,
@ -314,7 +568,7 @@ export default {
//
machineryTypeOptions: [],
//
workshopOptions:[],
workshopOptions: [],
//
open: false,
//
@ -322,10 +576,15 @@ export default {
//
autoGenFlag: false,
//
form: {},
defaultProps: {
form: {
idList: "",
workshopCode: "",
workshopName: "",
workshopId: "214",
},
defaultPropss: {
children: "children",
label: "machineryTypeName"
label: "machineryTypeName",
},
//
upload: {
@ -340,8 +599,10 @@ export default {
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/mes/dv/machinery/importData"
url: process.env.VUE_APP_BASE_API + "/mes/dv/machinery/importData",
},
machineryIdsArr: null,
listTypeArr: {},
//
queryParams: {
pageNum: 1,
@ -356,32 +617,55 @@ export default {
workshopId: null,
workshopCode: null,
workshopName: null,
status: null
status: null,
},
addInvolvedUserIdVisible: false,
//
deptName: undefined,
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label",
},
userName: undefined,
UserAdd: {
userIds: [],
machineryId: "",
},
inputName: "",
queryParamsdata: {},
//
rules: {
machineryCode: [
{ required: true, message: "设备编码不能为空", trigger: "blur" },
{ max: 64, message: '设备编码长度必须小于64个字符', trigger: 'blur' }
{ max: 64, message: "设备编码长度必须小于64个字符", trigger: "blur" },
],
machineryName: [
{ required: true, message: "设备名称不能为空", trigger: "blur" }
],
workshopId: [
{ required: true, message: "车间不能为空",trigger: "blur"}
{ required: true, message: "设备名称不能为空", trigger: "blur" },
],
// workshopId: [
// { required: true, message: "", trigger: "blur" },
// ],
machineryTypeId: [
{ required: true, message: "设备分类不能为空", trigger: "blur" },
]
}
],
// workshopName: [
// { required: true, message: "", trigger: "blur" },
// ],
},
};
},
watch: {
//
machineryTypeName(val) {
this.$refs.tree.filter(val);
}
},
},
created() {
this.getList();
@ -391,16 +675,15 @@ export default {
/** 查询物料编码列表 */
getList() {
this.loading = true;
listMachinery(this.queryParams).then(response => {
listMachinery(this.queryParams).then((response) => {
this.machineryList = response.rows;
this.total = response.total;
this.loading = false;
}
);
});
},
getWorkshops(){
listAllWorkshop().then( response => {
this.workshopOptions =response.data;
getWorkshops() {
listAllWorkshop().then((response) => {
this.workshopOptions = response.data;
});
},
/** 转换设备类型数据结构 */
@ -411,15 +694,18 @@ export default {
return {
id: node.machineryTypeId,
label: node.machineryTypeName,
children: node.children
children: node.children,
};
},
/** 查询设备类型下拉树结构 */
getTreeselect() {
listMachinerytype().then(response => {
debugger;
listMachinerytype().then((response) => {
this.machineryTypeOptions = [];
const data = this.handleTree(response.data, "machineryTypeId", "parentTypeId")[0];
const data = this.handleTree(
response.data,
"machineryTypeId",
"parentTypeId"
)[0];
this.machineryTypeOptions.push(data);
});
},
@ -431,8 +717,15 @@ export default {
//
handleNodeClick(data) {
this.queryParams.machineryTypeId = data.machineryTypeId;
this.queryParamsdata = data;
this.handleQuery();
},
//
handleNode(data) {
console.log(data);
this.form.machineryTypeName = data.machineryTypeName;
this.form.machineryTypeCode = data.code;
},
//
cancel() {
this.open = false;
@ -449,7 +742,7 @@ export default {
machineryTypeId: null,
machineryTypeCode: null,
machineryTypeName: null,
workshopId: null,
workshopId: "214",
workshopCode: null,
workshopName: null,
status: "STOP",
@ -457,9 +750,10 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
idList: "",
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
@ -474,17 +768,17 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.machineryId);
this.ids = selection.map((item) => item.machineryId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
//
handleView(row){
handleView(row) {
this.reset();
this.getTreeselect();
this.getWorkshops();
const machineryId = row.machineryId || this.ids;
getMachinery(machineryId).then(response => {
getMachinery(machineryId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "查看设备信息";
@ -493,46 +787,73 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
debugger;
this.reset();
this.getTreeselect();
this.getWorkshops();
if(this.queryParams.machineryTypeId != 0){
this.form.machineryTypeId = this.queryParams.machineryTypeId;
}
this.userName = "";
this.inputName = "";
// if (this.queryParamsdata.machineryTypeId != 0) {
// this.form = this.queryParamsdata;
// }
this.optType = "add";
this.open = true;
this.title = "新增设备";
genCode("MACHINERY_CODE").then((response) => {
this.form.machineryCode = response;
});
},
saveInvolvedUserId() {
this.addInvolvedUserIdVisible = false;
// this.$emit("getSelectList", this.selectList);
},
//
handleAccompanyId(val) {
this.form.workshopCode = val.workshopCode;
this.form.workshopName = val.workshopName;
this.form.workshopId = val.workshopId;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
this.getWorkshops();
const machineryId = row.machineryId || this.ids
getMachinery(machineryId).then(response => {
const machineryId = row.machineryId || this.ids;
getMachinery(machineryId).then((response) => {
this.form = response.data;
let arr = response.data.cadCodeMachineryList.map((item) => item.codeId);
this.form.idList = arr;
this.open = true;
this.title = "修改设备";
this.optType = "edit";
});
this.UserAdd.machineryId = row.machineryId;
machineryUsers(this.UserAdd).then((response) => {
this.userName = response.data.map((item) => item.nickName);
this.inputName = response.data;
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.machineryId != undefined) {
updateMachinery(this.form).then(response => {
updateMachinery(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.exceptionAlert();
this.open = false;
this.getList();
});
} else {
debugger;
addMachinery(this.form).then(response => {
addMachinery(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
if (response.data != null) {
this.UserAdd.machineryId = response.data;
this.exceptionAlert();
}
});
}
}
@ -541,18 +862,26 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const machineryIds = row.machineryId || this.ids;
this.$modal.confirm('确认删除数据项?').then(function() {
this.$modal
.confirm("确认删除数据项?")
.then(function () {
return delMachinery(machineryIds);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/dv/machinery/export', {
...this.queryParams
}, `user_${new Date().getTime()}.xlsx`)
this.download(
"mes/dv/machinery/export",
{
...this.queryParams,
},
`user_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handleImport() {
@ -561,8 +890,11 @@ export default {
},
/** 下载模板操作 */
importTemplate() {
this.download('mes/dv/machinery/importTemplate', {
}, `md_item_${new Date().getTime()}.xlsx`)
this.download(
"mes/dv/machinery/importTemplate",
{},
`md_item_${new Date().getTime()}.xlsx`
);
},
//
handleFileUploadProgress(event, file, fileList) {
@ -573,7 +905,13 @@ export default {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
@ -581,15 +919,35 @@ export default {
this.$refs.upload.submit();
},
//
handleAutoGenChange(autoGenFlag){
if(autoGenFlag){
genCode('MACHINERY_CODE').then(response =>{
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
genCode("MACHINERY_CODE").then((response) => {
this.form.machineryCode = response;
});
}else{
} else {
this.form.machineryCode = null;
}
}
}
},
// 使
addInvolvedUserId() {
this.addInvolvedUserIdVisible = true;
// this.$refs.checked.addInvolvedUserId(); // 访,ref
},
//
getSelectList(value) {
this.userName = "";
this.userName = value.map((item) => item.nickName);
this.UserAdd.userIds = value.map((item) => item.userId);
},
//
exceptionAlert() {
UserArr(this.UserAdd).then((response) => {
// this.$modal.msgSuccess("");
});
},
},
};
</script>

View File

@ -1,6 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="类型名称" prop="machineryTypeName">
<el-input
v-model="queryParams.machineryTypeName"
@ -10,7 +17,11 @@
/>
</el-form-item>
<el-form-item label="是否启用" prop="enableFlag">
<el-select v-model="queryParams.enableFlag" placeholder="选择是或否" clearable>
<el-select
v-model="queryParams.enableFlag"
placeholder="选择是或否"
clearable
>
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
@ -20,8 +31,16 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
@ -30,17 +49,28 @@
:data="machinerytypeList"
row-key="machineryTypeId"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column label="设备类型编码" prop="machineryTypeCode" />
<el-table-column label="设备类型名称" align="center" prop="machineryTypeName" />
<el-table-column label="是否启用" align="center" prop="enableFlag" >
<el-table-column
label="设备类型名称"
align="center"
prop="machineryTypeName"
/>
<el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/>
<dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.enableFlag"
/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
@ -48,14 +78,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:machinerytype:edit']"
>修改</el-button>
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['mes:dv:machinerytype:add']"
>新增</el-button>
>新增</el-button
>
<el-button
v-if="scope.row.parentTypeId != 0"
size="mini"
@ -63,7 +95,8 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:machinerytype:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -74,39 +107,70 @@
<el-row>
<el-col :span="24" v-if="form.parentTypeId !== 0">
<el-form-item label="父类型" prop="parentTypeId">
<treeselect v-model="form.parentTypeId" :options="machinerytypeOptions" :normalizer="normalizer" placeholder="请选择父类型" />
<treeselect
v-model="form.parentTypeId"
:options="machinerytypeOptions"
:normalizer="normalizer"
placeholder="请选择父类型"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备类型名称" prop="machineryTypeName">
<el-input v-model="form.machineryTypeName" placeholder="请输入设备类型名称" />
<el-input
v-model="form.machineryTypeName"
placeholder="请输入设备类型名称"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="默认设备类型" prop="code">
<el-select v-model="form.code" placeholder="请选择默认设备类型">
<el-option
v-for="dict in dict.type.dv_m_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="enableFlag">
<el-radio-group v-model="form.enableFlag" disabled v-if="optType=='view'">
<el-radio-group
v-model="form.enableFlag"
disabled
v-if="optType == 'view'"
>
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
>{{ dict.label }}</el-radio
>
</el-radio-group>
<el-radio-group v-model="form.enableFlag" v-else>
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
@ -120,19 +184,25 @@
</template>
<script>
import { listMachinerytype, getMachinerytype, delMachinerytype, addMachinerytype, updateMachinerytype } from "@/api/mes/dv/machinerytype";
import {
listMachinerytype,
getMachinerytype,
delMachinerytype,
addMachinerytype,
updateMachinerytype,
} from "@/api/mes/dv/machinerytype";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Machinerytype",
dicts: ['sys_yes_no'],
dicts: ["sys_yes_no", "dv_m_type"],
components: {
Treeselect
Treeselect,
},
data() {
return {
optType:undefined,
optType: undefined,
//
loading: true,
//
@ -158,15 +228,18 @@ export default {
//
rules: {
parentTypeId: [
{ required: true, message: "父类型不能为空", trigger: "blur" }
{ required: true, message: "父类型不能为空", trigger: "blur" },
],
machineryTypeName: [
{ required: true, message: "设备类型名称不能为空", trigger: "blur" }
{ required: true, message: "设备类型名称不能为空", trigger: "blur" },
],
enableFlag: [
{ required: true, message: "是否启用不能为空", trigger: "blur" }
{ required: true, message: "是否启用不能为空", trigger: "blur" },
],
}
code: [
{ required: true, message: "请默认设备类型不能为空", trigger: "blur" },
],
},
};
},
created() {
@ -176,8 +249,12 @@ export default {
/** 查询设备类型列表 */
getList() {
this.loading = true;
listMachinerytype(this.queryParams).then(response => {
this.machinerytypeList = this.handleTree(response.data, "machineryTypeId", "parentTypeId");
listMachinerytype(this.queryParams).then((response) => {
this.machinerytypeList = this.handleTree(
response.data,
"machineryTypeId",
"parentTypeId"
);
this.loading = false;
});
},
@ -189,15 +266,19 @@ export default {
return {
id: node.machineryTypeId,
label: node.machineryTypeName,
children: node.children
children: node.children,
};
},
/** 查询设备类型下拉树结构 */
getTreeselect() {
listMachinerytype().then(response => {
listMachinerytype().then((response) => {
debugger;
this.machinerytypeOptions = [];
const data = this.handleTree(response.data, "machineryTypeId", "parentTypeId")[0];
const data = this.handleTree(
response.data,
"machineryTypeId",
"parentTypeId"
)[0];
this.machinerytypeOptions.push(data);
});
},
@ -213,12 +294,12 @@ export default {
machineryTypeName: null,
parentTypeId: 1,
ancestors: null,
enableFlag: 'Y',
enableFlag: "Y",
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
this.resetForm("form");
},
@ -250,7 +331,7 @@ export default {
if (row != null) {
this.form.parentTypeId = row.machineryTypeId;
}
getMachinerytype(row.machineryTypeId).then(response => {
getMachinerytype(row.machineryTypeId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改设备类型";
@ -258,16 +339,16 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.machineryTypeId != null) {
updateMachinerytype(this.form).then(response => {
updateMachinerytype(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMachinerytype(this.form).then(response => {
addMachinerytype(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -278,13 +359,19 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除设备类型编号为"' + row.machineryTypeId + '"的数据项?').then(function() {
this.$modal
.confirm(
'是否确认删除设备类型编号为"' + row.machineryTypeId + '"的数据项?'
)
.then(function () {
return delMachinerytype(row.machineryTypeId);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
})
.catch(() => {});
},
},
};
</script>

View File

@ -294,7 +294,7 @@ export default {
components: {Repairline,MachinerySelectSingle},
data() {
return {
autoGenFlag:false,
autoGenFlag:true,
optType: undefined,
//
loading: true,
@ -427,6 +427,9 @@ export default {
this.reset();
this.open = true;
this.title = "添加设备维修单";
genCode('REPAIR_CODE').then(response =>{
this.form.repairCode = response;
});
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -0,0 +1,501 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="线路名称" prop="lineName">
<el-input
v-model="queryParams.lineName"
placeholder="请输入线路名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否启用" prop="enableFlag">
<el-select
v-model="queryParams.enableFlag"
placeholder="请选择是否启用"
clearable
style="width: 150px"
>
<el-option
v-for="dict in whetherEnabled"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:dv:dvsubject:add']"
>新增线路</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col> -->
</el-col>
<!-- <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar> -->
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="AGV线路编码"
width="120"
align="center"
prop="lineCode"
/>
<el-table-column label="AGV线路名称" align="center" prop="lineName" />
<el-table-column label="所属车间" align="center" prop="workshopName" />
<el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.enableFlag == 'Y'"
></span
>
<span
class="el-table-column-span-1"
v-if="scope.row.enableFlag == 'N'"
></span
>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="AGV线路编码" prop="lineCode">
<el-input
v-model="form.lineCode"
placeholder="请输入AGV线路编码"
maxlength="64"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="80">
<el-switch
v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)"
>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label-width="120px"
label="AGV线路名称"
prop="lineName"
>
<el-input
v-model="form.lineName"
placeholder="请输入AGV线路名称"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<!-- <el-form-item label="所属车间" prop="workshopId">
<el-select
v-model="form.workshopId"
placeholder="请选择车间"
style="width: 100%"
value-key="workshopId"
>
<el-option
v-for="item in workshopOptions"
:key="item.workshopId"
:label="item.workshopName"
:value="item.workshopId"
></el-option>
</el-select>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="enableFlag">
<el-radio-group v-model="form.enableFlag">
<el-radio label="Y"></el-radio>
<el-radio label="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="4"
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
findProAgvline,
findLineCode,
addProAgvline,
updateProAgvline,
deleteProAgvline,
} from "@/api/mes/dv/route";
import { listAllWorkshop } from "@/api/mes/md/workshop";
import { genCode } from "@/api/system/autocode/rule";
export default {
name: "Dvsubject",
dicts: ["sys_yes_no", "mes_dvsubject_type"],
data() {
return {
autoGenFlag: false,
//
loading: false,
// s
id: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
lineName: null,
enableFlag: null,
},
//
workshopOptions: [],
//
form: {},
whetherEnabled: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
],
//
rules: {
lineCode: [
{ required: true, message: "AGV线路编码不能为空", trigger: "blur" },
],
workshopId: [
{ required: true, message: "所属车间不能为空", trigger: "blur" },
],
lineName: [
{ required: true, message: "AGV线路名称不能为空", trigger: "blur" },
],
enableFlag: [
{ required: true, message: "是否启用不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 列表 */
getList() {
this.loading = true;
findProAgvline(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getWorkshops() {
listAllWorkshop().then((response) => {
this.workshopOptions = response.data;
});
},
//
cancel() {
this.reset();
this.getList();
this.open = false;
},
//
reset() {
this.form = {
subjectId: null,
proAgvlineId: null,
lineCode: null,
lineName: null,
workshopId: "214",
enableFlag: "Y",
remark: null,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.id = selection.map((item) => item.proAgvlineId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getWorkshops();
this.open = true;
this.title = "新增AGV线路";
findLineCode().then((response) => {
this.form.lineCode = response.data.lineCode;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getWorkshops();
this.form = row;
this.form.subjectId = row.proAgvlineId;
this.open = true;
this.title = "修改AGV线路";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.subjectId != null) {
updateProAgvline(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "修改成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
} else {
addProAgvline(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "新增成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
deleteProAgvline({ proAgvlineId: row.proAgvlineId }).then((response) => {
this.$modal
.confirm("是否确认删除当前的数据项?")
.then(() => {
if (response.code === 200) {
this.$notify({
title: "删除成功",
message: response.msg,
type: "success",
});
this.getList();
}
})
.catch(() => {});
});
},
/** 导出按钮操作 */
handleExport() {
// this.download(
// "dv/dvsubject/export",
// {
// ...this.queryParams,
// },
// `dvsubject_${new Date().getTime()}.xlsx`
// );
},
//
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
findLineCode().then((response) => {
this.form.lineCode = response.data.lineCode;
});
} else {
this.form.lineCode = null;
}
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
.el-table-column-span {
background-color: #e8f4ff;
border-color: #d1e9ff;
color: #1890ff;
display: inline-block;
padding: 0 15px;
line-height: 30px;
font-size: 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
}
.el-table-column-span-1 {
background-color: #ffeded;
border-color: #ffdbdb;
color: #ff4949;
display: inline-block;
padding: 0 15px;
line-height: 30px;
font-size: 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
}
</style>

View File

@ -0,0 +1,531 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="线路名称" prop="siteName">
<el-input
v-model="queryParams.siteName"
placeholder="请输入线路名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否启用" prop="enableFlag">
<el-select
v-model="queryParams.enableFlag"
placeholder="请选择是否启用"
clearable
style="width: 150px"
>
<el-option
v-for="dict in whetherEnabled"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col style="width: 90%">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:dv:dvsubject:add']"
>新增站点</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:dv:dvsubject:edit']"
>修改</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:dv:dvsubject:remove']"
>删除</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:dv:dvsubject:export']"
>导出</el-button
>
</el-col> -->
</el-col>
<!-- <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar> -->
</el-row>
<el-table
v-loading="loading"
:data="dvsubjectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="AGV站点编码" align="center" prop="siteCode" />
<!-- <el-table-column-->
<!-- label="AGV站点编码11"-->
<!-- width="120"-->
<!-- align="center"-->
<!-- key="siteCode"-->
<!-- prop="siteCode"-->
<!-- v-if="1"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- @click="handleView(scope.row)"-->
<!-- v-hasPermi="['mes:dv:route']"-->
<!-- >{{ scope.row.siteCode }}</el-button-->
<!-- >-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="AGV站点名称" align="center" prop="siteName" />
<el-table-column label="所属线路" align="center" prop="agvlineName" />
<el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<span class="el-table-column-span" v-if="scope.row.enableFlag == 'Y'"
></span
>
<span
class="el-table-column-span-1"
v-if="scope.row.enableFlag == 'N'"
></span
>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="AGV站点编码" prop="siteCode">
<el-input
v-model="form.siteCode"
placeholder="请输入AGV站点编码"
maxlength="64"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="80">
<el-switch
v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)"
>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label-width="120px"
label="AGV站点名称"
prop="siteName"
>
<el-input
v-model="form.siteName"
placeholder="请输入AGV站点名称"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="所属线路" prop="agvlineId">
<el-select
v-model="form.agvlineId"
placeholder="请选择所属线路"
style="width: 100%"
value-key="proAgvlineId"
>
<el-option
v-for="item in workshopOptions"
:key="item.proAgvlineId"
:label="item.lineName"
:value="item.proAgvlineId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="enableFlag">
<el-radio-group v-model="form.enableFlag">
<el-radio label="Y"></el-radio>
<el-radio label="N"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="PLC IP地址" prop="plcIpAddress">
<el-input
v-model="form.plcIpAddress"
placeholder="请输PLC IP地址"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:rows="4"
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { findProAgvline } from "@/api/mes/dv/route";
import {
findProAgvsite,
findSiteCode,
addProAgvsite,
updateProAgvsite,
deleteProAgvsite,
} from "@/api/mes/dv/siteConfiguration";
import { genCode } from "@/api/system/autocode/rule";
export default {
name: "Dvsubject",
dicts: ["sys_yes_no", "mes_dvsubject_type"],
data() {
return {
autoGenFlag: false,
//
loading: false,
// s
id: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dvsubjectList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
siteName: null,
enableFlag: null,
},
//
workshopOptions: [],
//
form: {
proAgvsiteId: "",
siteCode: "",
siteName: "",
agvlineId: "",
agvlineName: "",
enableFlag: "Y",
remark: "",
},
whetherEnabled: [
{
value: "Y",
label: "是",
},
{
value: "N",
label: "否",
},
],
//
rules: {
siteCode: [
{ required: true, message: "AGV站点编码不能为空", trigger: "blur" },
],
agvlineId: [
{ required: true, message: "所属线路不能为空", trigger: "blur" },
],
siteName: [
{ required: true, message: "AGV站点名称不能为空", trigger: "blur" },
],
enableFlag: [
{ required: true, message: "是否启用不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 列表 */
getList() {
this.loading = true;
findProAgvsite(this.queryParams).then((response) => {
this.dvsubjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getWorkshops() {
findProAgvline(this.queryParams).then((response) => {
this.workshopOptions = response.rows;
});
},
//
cancel() {
this.reset();
this.getList();
this.open = false;
},
//
reset() {
this.form = {
subjectId: null,
proAgvsiteId: null,
siteCode: null,
siteName: null,
agvlineId: null,
enableFlag: "Y",
remark: null,
agvlineName: null,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.id = selection.map((item) => item.proAgvsiteId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getWorkshops();
this.open = true;
this.title = "新增AGV站点";
findSiteCode().then((response) => {
this.form.siteCode = response.data.siteCode;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getWorkshops();
this.form = row;
this.form.subjectId = row.proAgvsiteId;
this.open = true;
this.title = "修改AGV站点";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.subjectId != null) {
updateProAgvsite(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "修改成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
} else {
addProAgvsite(this.form).then((response) => {
if (response.code === 200) {
this.$notify({
title: "新增成功",
message: response.msg,
type: "success",
});
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
deleteProAgvsite({ proAgvsiteId: row.proAgvsiteId }).then((response) => {
this.$modal
.confirm("是否确认删除当前的数据项?")
.then(() => {
if (response.code === 200) {
this.$notify({
title: "删除成功",
message: response.msg,
type: "success",
});
this.getList();
}
})
.catch(() => {});
});
},
/** 导出按钮操作 */
handleExport() {
// this.download(
// "dv/dvsubject/export",
// {
// ...this.queryParams,
// },
// `dvsubject_${new Date().getTime()}.xlsx`
// );
},
//
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
findSiteCode().then((response) => {
this.form.siteCode = response.data.siteCode;
});
} else {
this.form.siteCode = null;
}
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-card .el-card__header {
padding: 10px 20px;
background: #f3f2f2;
}
.el-table-column-span {
background-color: #e8f4ff;
border-color: #d1e9ff;
color: #1890ff;
display: inline-block;
padding: 0 15px;
line-height: 30px;
font-size: 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
}
.el-table-column-span-1 {
background-color: #ffeded;
border-color: #ffdbdb;
color: #ff4949;
display: inline-block;
padding: 0 15px;
line-height: 30px;
font-size: 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
white-space: nowrap;
}
</style>

View File

@ -281,7 +281,7 @@ export default {
updateBy: null,
updateTime: null
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */

View File

@ -464,7 +464,7 @@ export default {
maxStock: 0,
remark: undefined
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */

View File

@ -353,7 +353,7 @@ export default {
data() {
return {
//
autoGenFlag:false,
autoGenFlag:true,
optType: undefined,
//
loading: true,
@ -485,7 +485,7 @@ export default {
updateBy: null,
updateTime: null
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
@ -510,6 +510,9 @@ export default {
this.open = true;
this.title = "添加客户";
this.optType = "add";
genCode('CLIENT_CODE').then(response =>{
this.form.clientCode = response;
});
},
//
handleView(row){

View File

@ -160,12 +160,10 @@ export default{
},
//
handleImgUplaoded(imgUrl){
console.log(imgUrl);
this.form.sopUrl = imgUrl;
},
//
handleImgRemoved(imgUrl){
console.log(imgUrl);
this.form.sopUrl = null;
},
//

View File

@ -242,7 +242,7 @@
<el-col :span="12">
<el-form-item label="物料/产品分类" prop="itemTypeId">
<treeselect v-model="form.itemTypeId" :options="itemTypeOptions" :show-count="true" disabled v-if="optType=='view'" />
<treeselect v-model="form.itemTypeId" :options="itemTypeOptions" :show-count="true" placeholder="请选择所属分类" v-else :disable-branch-nodes="true"/>
<treeselect v-model="form.itemTypeId" :options="itemTypeOptions" :show-count="true" placeholder="请选择所属分类" v-else/>
</el-form-item>
</el-col>
</el-row>
@ -531,7 +531,7 @@ export default {
optType: undefined,
remark: undefined
};
this.autoGenFlag = false;
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
@ -572,6 +572,9 @@ export default {
this.optType = "add";
this.open = true;
this.title = "新增物料/产品";
genCode('ITEM_CODE').then(response =>{
this.form.itemCode = response;
});
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -0,0 +1,640 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<!--数据-->
<el-col>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="queryParams.palletCode"
placeholder="请输入托盘编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:md:mditem:add']"
>新增</el-button
>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:md:mditem:edit']"
>修改</el-button
>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDeleteData"
v-hasPermi="['mes:md:mditem:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['mes:md:mditem:import']"
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:md:mditem:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="itemList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="托盘码"
width="120"
align="center"
key="palletCode"
prop="palletCode"
>
</el-table-column>
<el-table-column
label="托盘尺寸"
align="center"
key="palletSize"
prop="palletSize"
:show-overflow-tooltip="true"
/>
<el-table-column
label="动裁承重"
align="center"
key="dynamicBear"
prop="dynamicBear"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
{{ scope.row.dynamicBear + "kg" }}
</template>
</el-table-column>
<el-table-column
label="静载承重"
align="center"
key="staticBear"
prop="staticBear"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
{{ scope.row.staticBear + "kg" }}
</template>
</el-table-column>
<el-table-column
label="当前位置"
align="center"
key="currentLocation"
prop="currentLocation"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="160"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:md:mditem:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:md:mditem:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改物料产品编码对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="托盘编码" prop="palletCode">
<el-input
v-model="form.palletCode"
readonly="readonly"
maxlength="64"
v-if="optType == 'view'"
/>
<el-input
v-model="form.palletCode"
placeholder="请输入托盘编码"
maxlength="64"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="80">
<el-switch
v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)"
v-if="optType != 'view'"
>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="托盘尺寸" prop="palletSize">
<el-input
v-model="form.palletSize"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
/>
<el-input
v-model="form.palletSize"
placeholder="请输入托盘尺寸"
maxlength="255"
v-else
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="动载承重" prop="dynamicBear">
<el-input
v-model="form.dynamicBear"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
>
<i
slot="suffix"
style="
font-style: normal;
margin-right: 10px;
line-height: 30px;
color: #1e1e1e;
"
>kg</i
>
</el-input>
<el-input
v-model="form.dynamicBear"
placeholder="请输入动载承重"
maxlength="255"
v-else
>
<i
slot="suffix"
style="
font-style: normal;
margin-right: 10px;
line-height: 30px;
color: #1e1e1e;
"
>kg</i
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="静载承重" prop="staticBear">
<el-input
v-model="form.staticBear"
maxlength="255"
readonly="readonly"
v-if="optType == 'view'"
>
<i
slot="suffix"
style="
font-style: normal;
margin-right: 10px;
line-height: 30px;
color: #1e1e1e;
"
>kg</i
>
</el-input>
<el-input
v-model="form.staticBear"
placeholder="请输入静载承重"
maxlength="255"
v-else
>
<i
slot="suffix"
style="
font-style: normal;
margin-right: 10px;
line-height: 30px;
color: #1e1e1e;
"
>kg</i
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType == 'view'"
>返回</el-button
>
<el-button type="primary" @click="submitForm" v-else> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 物料导入对话框 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />
是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMdItem,
delMdItem,
addMdItem,
updateMdItem,
findPalletCode,
batchDeleteProPallet,
exportProPallet,
} from "@/api/mes/md/pallet";
import { genCode } from "@/api/system/autocode/rule";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Pallet",
dicts: ["sys_yes_no", "mes_item_product"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
itemList: null,
//
title: "",
//
open: false,
// view add edit
optType: undefined,
//
autoGenFlag: false,
//
dateRange: [],
//
measureOptions: [],
//
form: {},
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/mes/md/mditem/importData",
},
//
headers: { Authorization: "Bearer " + getToken() },
//
queryParams: {
pageNum: 1,
pageSize: 10,
palletCode: undefined,
itemName: undefined,
},
//
rules: {
palletCode: [
{ required: true, message: "托盘编码不能为空", trigger: "blur" },
{
max: 64,
message: "物料/产品编码长度必须小于64个字符",
trigger: "blur",
},
],
itemName: [
{ required: true, message: "物托盘尺寸不能为空", trigger: "blur" },
],
unitOfMeasure: [
{ required: true, message: "单位不能为空", trigger: "blur" },
],
},
};
},
created() {
this.getList();
},
methods: {
/** 查询物料编码列表 */
getList() {
this.loading = false;
listMdItem(this.queryParams).then((response) => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
proPalletId: undefined,
palletCode: undefined,
palletSize: undefined,
dynamicBear: undefined,
staticBear: undefined,
currentLocation: undefined,
};
this.autoGenFlag = true;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.proPalletId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.optType = "add";
this.open = true;
this.title = "新增托盘";
findPalletCode().then((response) => {
this.form.palletCode = response.data.palletCode;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = row;
this.open = true;
this.optType = "edit";
this.title = "修改";
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.proPalletId != undefined) {
updateMdItem(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
debugger;
addMdItem(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const itemIds = row.proPalletId;
delMdItem({ proPalletId: itemIds }).then((response) => {
this.$modal
.confirm("是否确认删除当前的数据项?")
.then(() => {
if (response.code === 200) {
this.$notify({
title: "删除成功",
message: response.msg,
type: "success",
});
this.getList();
}
})
.catch(() => {});
});
},
/** 批量删除按钮操作 */
handleDeleteData() {
const itemIds = this.ids;
this.$modal
.confirm("是否确认删除班次?")
.then(function () {
return batchDeleteProPallet(itemIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/propallet/exportProPallet",
{
...this.queryParams,
},
`calplan_${new Date().getTime()}.xlsx`
);
},
/** 导入按钮操作 */
handleImport() {
// this.upload.title = "/";
// this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
// this.download(
// "mes/md/mditem/importTemplate",
// {},
// `md_item_${new Date().getTime()}.xlsx`
// );
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
findPalletCode().then((response) => {
this.form.palletCode = response.data.palletCode;
});
} else {
this.form.palletCode = null;
}
},
},
};
</script>

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