第一次提交
This commit is contained in:
parent
4340e57d98
commit
33582c8d1b
@ -1,11 +1,11 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 苦糖果MES-软件开发记录
|
||||
VUE_APP_TITLE = 智能工厂MES系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = '/dev-api'
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 苦糖果MES-软件开发记录
|
||||
VUE_APP_TITLE = 智能工厂MES系统
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 苦糖果MES-软件开发记录
|
||||
VUE_APP_TITLE = 智能工厂MES系统
|
||||
|
||||
NODE_ENV = production
|
||||
|
||||
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -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
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 3.1 KiB |
@ -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>智能工厂MES系统</title>
|
||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||
<style>
|
||||
html,
|
||||
|
16
src/App.vue
16
src/App.vue
@ -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>
|
||||
|
19
src/api/abnormalityAlarm/machineTool.js
Normal file
19
src/api/abnormalityAlarm/machineTool.js
Normal 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,
|
||||
});
|
||||
}
|
45
src/api/management/codeprogram.js
Normal file
45
src/api/management/codeprogram.js
Normal 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,
|
||||
});
|
||||
}
|
45
src/api/management/document.js
Normal file
45
src/api/management/document.js
Normal 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,
|
||||
});
|
||||
}
|
36
src/api/management/documentType.js
Normal file
36
src/api/management/documentType.js
Normal 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",
|
||||
});
|
||||
}
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -51,10 +51,3 @@ export function listItems(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function dofinish(workorderId){
|
||||
return request({
|
||||
url: '/mes/pro/workorder/'+workorderId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
BIN
src/assets/logo/favicon.png
Normal file
BIN
src/assets/logo/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -245,13 +245,10 @@ export default {
|
||||
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 {
|
||||
if(this.warehouseCode.indexOf('VIR') == -1){
|
||||
//如果不是查询线边库的物资,则在查询结果中过滤掉线边库的数据
|
||||
this.wmstockList = response.rows.filter((el) =>{
|
||||
return el.warehouseCode.indexOf('VIR') == -1;
|
||||
return el.warehouseCode.indexOf('VIR') == -1;
|
||||
});
|
||||
}
|
||||
this.total = response.total;
|
||||
|
@ -9,13 +9,13 @@
|
||||
<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" />
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import logoImg from '@/assets/logo/logo.png'
|
||||
import logoImg from '@/assets/logo/favicon.png'
|
||||
import variables from '@/assets/styles/variables.scss'
|
||||
|
||||
export default {
|
||||
@ -35,7 +35,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '苦糖果MES',
|
||||
title: '智能工厂MES系统',
|
||||
logo: logoImg
|
||||
}
|
||||
}
|
||||
|
@ -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,203 +31,203 @@ 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: '',
|
||||
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/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:schedule:edit'],
|
||||
permissions: ["mes:pro:schedule: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" },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// 防止连续点击多次路由报错
|
||||
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,
|
||||
});
|
||||
|
@ -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)
|
||||
} else {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
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_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;
|
||||
|
484
src/views/abnormalityAlarm/machineTool/abnormalAlarm.vue
Normal file
484
src/views/abnormalityAlarm/machineTool/abnormalAlarm.vue
Normal file
@ -0,0 +1,484 @@
|
||||
<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_dvsubject_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="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_dvsubject_type"],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
autoGenFlag: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组s
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设备点检保养项目表格数据
|
||||
dvsubjectList: [
|
||||
{
|
||||
machineryCode: 1,
|
||||
abnormal: 1,
|
||||
status: "",
|
||||
top: 0,
|
||||
},
|
||||
{
|
||||
machineryCode: 2,
|
||||
abnormal: 1,
|
||||
status: "",
|
||||
top: 0,
|
||||
},
|
||||
{
|
||||
machineryCode: 3,
|
||||
abnormal: 1,
|
||||
status: "",
|
||||
top: 0,
|
||||
},
|
||||
],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查看
|
||||
openQuery: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
status: 1,
|
||||
},
|
||||
// 表单参数
|
||||
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) => {
|
||||
console.log(response);
|
||||
// this.dvsubjectList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 取消按钮
|
||||
cancelQuery() {
|
||||
this.openQuery = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
abnormal: 1,
|
||||
status: "",
|
||||
top: 0,
|
||||
};
|
||||
this.autoGenFlag = false;
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
console.log(selection);
|
||||
this.ids = selection.map((item) => item.codeId);
|
||||
console.log(this.ids);
|
||||
|
||||
this.queryParams.ids = this.ids.join(",");
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 查看 **/
|
||||
handleExportArr(row) {
|
||||
console.log(row);
|
||||
this.formQuery = row;
|
||||
this.openQuery = true;
|
||||
this.title = "查看";
|
||||
},
|
||||
/** 处理 */
|
||||
handleUpdate(row) {
|
||||
console.log(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);
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
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>
|
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>2222222222</h1>
|
||||
</template>
|
41
src/views/abnormalityAlarm/machineTool/index.vue
Normal file
41
src/views/abnormalityAlarm/machineTool/index.vue
Normal 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 {
|
||||
//默认tab切换为1
|
||||
activeName: "1",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//点击tab切换
|
||||
handleClick() {
|
||||
this.activeName = "2";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.clearfix {
|
||||
line-height: 40px;
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
537
src/views/components/personnelSelection.vue
Normal file
537
src/views/components/personnelSelection.vue
Normal file
@ -0,0 +1,537 @@
|
||||
<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: this.inputValue,
|
||||
// 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时选中,为 0(或者false)时未选中
|
||||
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>
|
@ -1,51 +1,93 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
|
||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||
|
||||
<el-row :gutter="32" style="padding:16px 16px 0;margin-bottom:32px;">
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>生产进度</span>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="workorderList"
|
||||
row-key="workorderId"
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
>
|
||||
<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>
|
||||
</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="单位" align="center" prop="unitOfMeasure" />
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="需求日期" align="center" prop="requestDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.requestDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-row :gutter="32" style="padding: 16px 16px 0; margin-bottom: 32px">
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>生产进度</span>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="workorderList"
|
||||
row-key="workorderId"
|
||||
default-expand-all
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<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
|
||||
>
|
||||
</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="单位" align="center" prop="unitOfMeasure" />
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="需求日期"
|
||||
align="center"
|
||||
prop="requestDate"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<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'},
|
||||
workorderList: [],
|
||||
lineChartData: lineChartData.newVisitis
|
||||
}
|
||||
loading: true,
|
||||
queryParams: {},
|
||||
workorderList: [],
|
||||
lineChartData: lineChartData.newVisitis,
|
||||
};
|
||||
},
|
||||
created(){
|
||||
this.getList();
|
||||
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;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">苦糖果生产执行管理系统</h3>
|
||||
<h3 class="title">智能工厂MES系统</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
},
|
||||
loading: false,
|
||||
// 验证码开关
|
||||
captchaOnOff: true,
|
||||
captchaOnOff: false,
|
||||
// 注册开关
|
||||
register: false,
|
||||
redirect: undefined
|
||||
|
680
src/views/management/codeprogram.vue
Normal file
680
src/views/management/codeprogram.vue
Normal file
@ -0,0 +1,680 @@
|
||||
<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="请选择所属分类"
|
||||
:disable-branch-nodes="true"
|
||||
@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"
|
||||
> 预览文件</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) => {
|
||||
console.log(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 = false;
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
console.log(selection);
|
||||
this.ids = selection.map((item) => item.codeId);
|
||||
console.log(this.ids);
|
||||
|
||||
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) {
|
||||
console.log(data);
|
||||
this.machineryIdsArr = [];
|
||||
this.form.machineryTypeName = data.machineryTypeName;
|
||||
let arr = {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
machineryTypeId: null,
|
||||
};
|
||||
arr.machineryTypeId = data.machineryTypeId;
|
||||
|
||||
listMachinery(arr).then((response) => {
|
||||
console.log(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) {
|
||||
console.log(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() {
|
||||
console.log(this.form);
|
||||
if (this.form.url != undefined && this.form.url != "") {
|
||||
var url = this.form.url;
|
||||
window.open(url);
|
||||
} else {
|
||||
this.$message.warning(`请上传文件`);
|
||||
}
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
console.log(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);
|
||||
console.log(this.fileList);
|
||||
}
|
||||
let arr = {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
machineryTypeId: null,
|
||||
};
|
||||
arr.machineryTypeId = row.machineryTypeId;
|
||||
|
||||
listMachinery(arr).then((response) => {
|
||||
console.log(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) {
|
||||
console.log(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) {
|
||||
console.log(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>
|
730
src/views/management/document.vue
Normal file
730
src/views/management/document.vue
Normal file
@ -0,0 +1,730 @@
|
||||
<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"
|
||||
> 预览文件</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%"
|
||||
/>
|
||||
<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) => {
|
||||
console.log(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 = false;
|
||||
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(",");
|
||||
console.log(this.queryParams.ids);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.fileList = [];
|
||||
listType().then((response) => {
|
||||
console.log(response);
|
||||
this.listTypeArr = response.rows;
|
||||
});
|
||||
this.open = true;
|
||||
this.title = "新增文档";
|
||||
},
|
||||
|
||||
typeNameArr(e) {
|
||||
console.log(e);
|
||||
this.form.typeName = e.name;
|
||||
this.form.type = e.id;
|
||||
},
|
||||
|
||||
beforeUpload(e) {
|
||||
// console.log(e);
|
||||
this.files = e;
|
||||
},
|
||||
customUploadChangeImage2(files) {
|
||||
console.log(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() {
|
||||
console.log(this.form);
|
||||
if (this.form.url != undefined && this.form.url != "") {
|
||||
var url = this.form.url;
|
||||
window.open(url);
|
||||
} else {
|
||||
this.$message.warning(`请上传文件`);
|
||||
}
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
console.log(row);
|
||||
this.reset();
|
||||
this.fileList = [];
|
||||
this.form = row;
|
||||
var name = {};
|
||||
this.$set(name, "name", row.originalName);
|
||||
this.fileList.push(name);
|
||||
console.log(this.fileList);
|
||||
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>
|
429
src/views/management/documentType.vue
Normal file
429
src/views/management/documentType.vue
Normal file
@ -0,0 +1,429 @@
|
||||
<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 = false;
|
||||
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) {
|
||||
console.log(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>
|
@ -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" >
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:cal:plan:query']"
|
||||
>{{scope.row.planCode}}</el-button>
|
||||
</template>
|
||||
<el-table-column label="计划编号" align="center" prop="planCode">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
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">
|
||||
@ -166,11 +239,14 @@
|
||||
</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-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>
|
||||
@ -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 Team from "./team";
|
||||
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 => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
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,50 +592,63 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const planIds = row.planId || this.ids;
|
||||
this.$modal.confirm('是否确认删除排班计划编号为"' + planIds + '"的数据项?').then(function() {
|
||||
return delCalplan(planIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm('是否确认删除排班计划编号为"' + planIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delCalplan(planIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleFinish(){
|
||||
handleFinish() {
|
||||
let that = this;
|
||||
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 => {
|
||||
that.$modal.msgSuccess("已完成");
|
||||
that.open = false;
|
||||
that.getList();
|
||||
that.formLoading = false;
|
||||
},err =>{
|
||||
that.form.status = 'PREPARE';
|
||||
that.formLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
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) => {
|
||||
that.$modal.msgSuccess("已完成");
|
||||
that.open = false;
|
||||
that.getList();
|
||||
that.formLoading = false;
|
||||
},
|
||||
(err) => {
|
||||
that.form.status = "PREPARE";
|
||||
that.formLoading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
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>
|
||||
|
@ -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">
|
||||
<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>
|
||||
</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="设备编码"
|
||||
width="120"
|
||||
align="center"
|
||||
key="machineryCode"
|
||||
prop="machineryCode"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.mes_machinery_status" :value="scope.row.status"/>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:dv:machinery:query']"
|
||||
>{{ scope.row.machineryCode }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
<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"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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,197 @@
|
||||
<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"
|
||||
active-color="#13ce66"
|
||||
active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
|
||||
<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="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' />
|
||||
<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"
|
||||
/>
|
||||
</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-option
|
||||
v-for="item in workshopOptions"
|
||||
:key="item.workshopId"
|
||||
:label="item.workshopName"
|
||||
:value="item.workshopId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<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"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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"
|
||||
> 选择通知人</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 +455,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>仅允许导入xls、xlsx格式文件。</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 +473,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 +542,7 @@ export default {
|
||||
// 设备类型树选项
|
||||
machineryTypeOptions: [],
|
||||
//车间选项
|
||||
workshopOptions:[],
|
||||
workshopOptions: [],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 设备类型名称
|
||||
@ -322,10 +550,15 @@ export default {
|
||||
//自动生成物料编码标识
|
||||
autoGenFlag: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
defaultProps: {
|
||||
form: {
|
||||
idList: "",
|
||||
workshopCode: "",
|
||||
workshopName: "",
|
||||
workshopId: "",
|
||||
},
|
||||
defaultPropss: {
|
||||
children: "children",
|
||||
label: "machineryTypeName"
|
||||
label: "machineryTypeName",
|
||||
},
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
@ -340,8 +573,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,51 +591,79 @@ 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: "",
|
||||
|
||||
// 表单校验
|
||||
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" }
|
||||
{ required: true, message: "设备名称不能为空", trigger: "blur" },
|
||||
],
|
||||
workshopId: [
|
||||
{ required: true, message: "车间不能为空",trigger: "blur"}
|
||||
{ required: true, message: "车间不能为空", trigger: "blur" },
|
||||
],
|
||||
machineryTypeId: [
|
||||
{ required: true, message: "设备分类不能为空", trigger: "blur" },
|
||||
]
|
||||
}
|
||||
],
|
||||
// idList: [
|
||||
// { required: true, message: "关联代码程序不能为空", trigger: "blur" },
|
||||
// ],
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据设备分类名称筛选分类树
|
||||
machineryTypeName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
this.listMesArr();
|
||||
},
|
||||
methods: {
|
||||
/** 查询物料编码列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMachinery(this.queryParams).then(response => {
|
||||
this.machineryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
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;
|
||||
});
|
||||
},
|
||||
|
||||
listMesArr() {
|
||||
listMes().then((response) => {
|
||||
console.log(response);
|
||||
this.listTypeArr = response.data;
|
||||
});
|
||||
},
|
||||
/** 转换设备类型数据结构 */
|
||||
@ -411,15 +674,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);
|
||||
});
|
||||
},
|
||||
@ -430,6 +696,7 @@ export default {
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
console.log(data);
|
||||
this.queryParams.machineryTypeId = data.machineryTypeId;
|
||||
this.handleQuery();
|
||||
},
|
||||
@ -457,7 +724,8 @@ export default {
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
updateTime: null,
|
||||
idList: "",
|
||||
};
|
||||
this.autoGenFlag = false;
|
||||
this.resetForm("form");
|
||||
@ -474,17 +742,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 +761,71 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
debugger;
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
this.getWorkshops();
|
||||
if(this.queryParams.machineryTypeId != 0){
|
||||
this.userName = "";
|
||||
this.inputName = "";
|
||||
if (this.queryParams.machineryTypeId != 0) {
|
||||
this.form.machineryTypeId = this.queryParams.machineryTypeId;
|
||||
}
|
||||
this.optType = "add";
|
||||
this.open = true;
|
||||
this.title = "新增设备";
|
||||
},
|
||||
|
||||
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 +834,26 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const machineryIds = row.machineryId || this.ids;
|
||||
this.$modal.confirm('确认删除数据项?').then(function() {
|
||||
return delMachinery(machineryIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm("确认删除数据项?")
|
||||
.then(function () {
|
||||
return delMachinery(machineryIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.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 +862,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 +877,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 +891,36 @@ 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) {
|
||||
console.log(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>
|
@ -414,8 +414,6 @@ export default {
|
||||
workstationId: null,
|
||||
workstationCode: null,
|
||||
workstationName: null,
|
||||
routeId: null,
|
||||
routeCode: null,
|
||||
processId: null,
|
||||
processCode: null,
|
||||
processName: null,
|
||||
@ -593,8 +591,6 @@ export default {
|
||||
this.form.processId = row.processId;
|
||||
this.form.processCode = row.processCode;
|
||||
this.form.processName = row.processName;
|
||||
this.form.routeId = row.routeId;
|
||||
this.form.routeCode = row.routeCode;
|
||||
this.form.isCheck = row.isCheck;
|
||||
}
|
||||
},
|
||||
|
@ -339,7 +339,7 @@ export default {
|
||||
requestDate: null,
|
||||
parentId: null,
|
||||
ancestors: null,
|
||||
status: 'CONFIRMED',
|
||||
status: null,
|
||||
},
|
||||
tasks:{
|
||||
data: [],
|
||||
|
@ -179,16 +179,8 @@
|
||||
icon="el-icon-plus"
|
||||
v-if="scope.row.status =='CONFIRMED'"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['mes:pro:workorder:update']"
|
||||
v-hasPermi="['mes:pro:workorder:add']"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-circle-check"
|
||||
v-if="scope.row.status =='CONFIRMED'"
|
||||
@click="handleFinish(scope.row)"
|
||||
v-hasPermi="['mes:pro:workorder:update']"
|
||||
>完成</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@ -358,7 +350,7 @@
|
||||
<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="handleConfirm" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
||||
<el-button type="success" @click="handleFinish" v-if="form.status =='PREPARE' && optType !='view' && form.workorderId !=null">完成</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -366,7 +358,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder ,dofinish} from "@/api/mes/pro/workorder";
|
||||
import { listWorkorder, getWorkorder, delWorkorder, addWorkorder, updateWorkorder } from "@/api/mes/pro/workorder";
|
||||
import Workorderbom from "./bom/bom.vue";
|
||||
import WorkorderItemList from "./items/item.vue";
|
||||
import ItemSelect from "@/components/itemSelect/single.vue";
|
||||
@ -647,22 +639,13 @@ export default {
|
||||
...this.queryParams
|
||||
}, `workorder_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleConfirm(){
|
||||
handleFinish(){
|
||||
let that = this;
|
||||
this.$modal.confirm('是确认完成工单编制?【确认后将不能更改】').then(function(){
|
||||
this.$modal.confirm('是否完成工单编制?【完成后将不能更改】').then(function(){
|
||||
that.form.status = 'CONFIRMED';
|
||||
that.submitForm();
|
||||
});
|
||||
},
|
||||
handleFinish(row){
|
||||
const workorderIds = row.workorderId || this.ids;
|
||||
this.$modal.confirm('确认完成工单?一旦完成,此工单将无法继续报工').then(function() {
|
||||
return dofinish(workorderIds) //完成工单
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("更改成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
//物料选择弹出框
|
||||
onItemSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
|
@ -475,15 +475,6 @@ export default {
|
||||
quantityCheck: [
|
||||
{ required: true, message: "检测数量不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
quantityUnqualified: [
|
||||
{ required: true, message: "不合格品数量不能为空", trigger: "blur" }
|
||||
],
|
||||
|
||||
quantityQualified: [
|
||||
{ required: true, message: "合格品数量不能为空", trigger: "blur" }
|
||||
]
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -201,27 +201,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--仓库-->
|
||||
<el-row v-if="form.barcodeType=='WAREHOUSE'">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="储位" prop="warehouseId">
|
||||
<!-- <el-cascader v-model="warehouseInfo"
|
||||
:options="warehouseOptions"
|
||||
:props="warehouseProps"
|
||||
@change="handleWarehouseChanged"
|
||||
>
|
||||
</el-cascader> -->
|
||||
<el-cascader v-model="warehouseInfo"
|
||||
ref="warehouseRef"
|
||||
:options="warehouseOptions"
|
||||
:props="warehouseProps"
|
||||
@change="handleWarehouseChanged"
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--箱条码-->
|
||||
<el-row v-if="form.barcodeType=='BOX'">
|
||||
<el-col :span="12">
|
||||
@ -255,7 +234,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 工作站 -->
|
||||
<el-row v-else-if="form.barcodeType=='WORKSTATION'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作站" prop="bussinessCode">
|
||||
@ -272,23 +250,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 库存 -->
|
||||
<el-row v-else-if="form.barcodeType=='STOCK'">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物资编码" prop="bussinessCode">
|
||||
<el-input v-model="form.bussinessCode" placeholder="请选择库存记录" >
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleMaterialStockSelect"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<StockSelect ref="stockSelect" @onSelected="onMaterialStockSelected"> </StockSelect>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="物资信息" prop="bussinessName">
|
||||
<el-input v-model="form.bussinessName" readonly="readonly" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--根据不同的条码类型展示不同的业务内容选择 end-->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
@ -331,25 +292,16 @@ import ItemSelect from "@/components/itemSelect/single.vue";
|
||||
import VendorSelect from "@/components/vendorSelect/single.vue";
|
||||
import PackageSelectSingle from "@/components/package/single.vue";
|
||||
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
|
||||
import StockSelect from "@/components/stockSelect/single.vue"
|
||||
import Barcodeconfig from "./config.vue"
|
||||
import BarcodeBatchPrint from "./batchprint.vue"
|
||||
import {getTreeList} from "@/api/mes/wm/warehouse"
|
||||
export default {
|
||||
name: "Barcode",
|
||||
dicts: ['mes_barcode_type','mes_barcode_formart','sys_yes_no'],
|
||||
components: {
|
||||
ItemSelect,VendorSelect,PackageSelectSingle,Barcodeconfig,WorkstationSelect,StockSelect,BarcodeBatchPrint
|
||||
ItemSelect,VendorSelect,PackageSelectSingle,Barcodeconfig,WorkstationSelect,BarcodeBatchPrint
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
warehouseInfo:[],
|
||||
warehouseOptions:[],
|
||||
warehouseProps:{
|
||||
multiple: false,
|
||||
value: 'pId',
|
||||
label: 'pName',
|
||||
},
|
||||
optType: null,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
@ -400,7 +352,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getWarehouseList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询条码清单列表 */
|
||||
@ -534,40 +485,6 @@ export default {
|
||||
this.form.barcodeContent= "".concat(this.form.barcodeType,'-',this.form.bussinessCode);
|
||||
}
|
||||
},
|
||||
//选择仓库、库区、库位
|
||||
getWarehouseList(){
|
||||
getTreeList().then( response =>{
|
||||
if(response.data){
|
||||
this.warehouseOptions = response.data.filter((el) =>{
|
||||
return el.warehouseCode.indexOf('VIR') == -1;
|
||||
});;
|
||||
}
|
||||
this.warehouseOptions.map(w =>{
|
||||
debugger;
|
||||
w.children.map(l =>{
|
||||
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
|
||||
l.children = JSON.parse(lstr);
|
||||
});
|
||||
|
||||
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
|
||||
w.children = JSON.parse(wstr);
|
||||
|
||||
});
|
||||
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
|
||||
this.warehouseOptions = JSON.parse(ostr);
|
||||
debugger;
|
||||
});
|
||||
},
|
||||
handleWarehouseChanged(obj){
|
||||
debugger;
|
||||
const checkedNode = this.$refs['warehouseRef'].getCheckedNodes();
|
||||
if(obj !=null){
|
||||
this.form.bussinessId = checkedNode[0].data.pId;
|
||||
this.form.bussinessCode = checkedNode[0].data.areaCode;
|
||||
this.form.bussinessName = checkedNode[0].data.pName;
|
||||
this.form.barcodeContent = "".concat(this.form.barcodeType,'-',this.form.bussinessCode);
|
||||
}
|
||||
},
|
||||
//装箱单选择
|
||||
handleSelectPackage(){
|
||||
this.$refs.packageSelect.showFlag=true;
|
||||
@ -594,22 +511,6 @@ export default {
|
||||
this.form.barcodeContent= "".concat(this.form.barcodeType,'-',this.form.bussinessCode);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 选择库存
|
||||
*/
|
||||
handleMaterialStockSelect(){
|
||||
this.$refs.stockSelect.showFlag = true;
|
||||
},
|
||||
|
||||
/**库存选择返回 */
|
||||
onMaterialStockSelected(obj){
|
||||
if(obj != undefined && obj != null){
|
||||
this.form.bussinessId = obj.materialStockId;
|
||||
this.form.bussinessCode = obj.itemCode;
|
||||
this.form.bussinessName = "".concat(obj.itemName,'|',obj.specification,'|',obj.vendorName,'|',obj.batchCode);
|
||||
this.form.barcodeContent= "".concat(this.form.barcodeType,'-',this.form.bussinessId);
|
||||
}
|
||||
},
|
||||
handleConfig(){
|
||||
this.$refs.barcodeconfig.showFlag = true;
|
||||
},
|
||||
|
@ -88,7 +88,7 @@
|
||||
<el-button slot="append" @click="handleSelectStock" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<StockSelect ref="stockSelect" :batchCode="form.batchCode" :vendorId="form.vendorId" @onSelected="onStockSelected"></StockSelect>
|
||||
<StockSelect ref="stockSelect" :batchCode="batchCdoe" :vendorId="vendorId" @onSelected="onStockSelected"></StockSelect>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品物料名称" prop="itemName">
|
||||
@ -302,8 +302,10 @@ export default {
|
||||
this.reset();
|
||||
const lineId = row.lineId || this.ids
|
||||
getIssueline(lineId).then(response => {
|
||||
debugger;
|
||||
this.form = response.data;
|
||||
this.warehouseInfo[0] = response.data.warehouseId;
|
||||
this.warehouseInfo[1] = response.data.locationId;
|
||||
this.warehouseInfo[2] = response.data.areaId;
|
||||
this.open = true;
|
||||
this.title = "修改生产领料单行";
|
||||
});
|
||||
|
@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item label="菜单名称" prop="menuName">
|
||||
<el-input
|
||||
v-model="queryParams.menuName"
|
||||
@ -10,7 +16,11 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="菜单状态"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
@ -20,8 +30,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>
|
||||
|
||||
@ -34,7 +52,8 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:menu:add']"
|
||||
>新增</el-button>
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -43,9 +62,13 @@
|
||||
icon="el-icon-sort"
|
||||
size="mini"
|
||||
@click="toggleExpandAll"
|
||||
>展开/折叠</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
|
||||
@ -54,20 +77,40 @@
|
||||
:data="menuList"
|
||||
row-key="menuId"
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
|
||||
<el-table-column
|
||||
prop="menuName"
|
||||
label="菜单名称"
|
||||
:show-overflow-tooltip="true"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<el-table-column prop="icon" label="图标" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<svg-icon :icon-class="scope.row.icon" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNum" label="排序" width="60"></el-table-column>
|
||||
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column
|
||||
prop="orderNum"
|
||||
label="排序"
|
||||
width="60"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="perms"
|
||||
label="权限标识"
|
||||
:show-overflow-tooltip="true"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="component"
|
||||
label="组件路径"
|
||||
:show-overflow-tooltip="true"
|
||||
></el-table-column>
|
||||
<el-table-column prop="status" label="状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
<dict-tag
|
||||
:options="dict.type.sys_normal_disable"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
@ -75,7 +118,11 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</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"
|
||||
@ -83,21 +130,24 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:menu:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['system:menu:add']"
|
||||
>新增</el-button>
|
||||
>新增</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:menu:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -135,15 +185,24 @@
|
||||
@show="$refs['iconSelect'].reset()"
|
||||
>
|
||||
<IconSelect ref="iconSelect" @selected="selected" />
|
||||
<el-input slot="reference" v-model="form.icon" placeholder="点击选择图标" readonly>
|
||||
<el-input
|
||||
slot="reference"
|
||||
v-model="form.icon"
|
||||
placeholder="点击选择图标"
|
||||
readonly
|
||||
>
|
||||
<svg-icon
|
||||
v-if="form.icon"
|
||||
slot="prefix"
|
||||
:icon-class="form.icon"
|
||||
class="el-input__icon"
|
||||
style="height: 32px;width: 16px;"
|
||||
style="height: 32px; width: 16px"
|
||||
/>
|
||||
<i
|
||||
v-else
|
||||
slot="prefix"
|
||||
class="el-icon-search el-input__icon"
|
||||
/>
|
||||
<i v-else slot="prefix" class="el-icon-search el-input__icon" />
|
||||
</el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
@ -155,14 +214,21 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="显示排序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||
<el-input-number
|
||||
v-model="form.orderNum"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<span slot="label">
|
||||
<el-tooltip content="选择是外链则路由地址需要以`http(s)://`开头" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="选择是外链则路由地址需要以`http(s)://`开头"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
是否外链
|
||||
</span>
|
||||
@ -175,8 +241,11 @@
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item prop="path">
|
||||
<span slot="label">
|
||||
<el-tooltip content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="访问的路由地址,如:`user`,如外网地址需内链访问则以`http(s)://`开头"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
路由地址
|
||||
</span>
|
||||
@ -186,8 +255,11 @@
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item prop="component">
|
||||
<span slot="label">
|
||||
<el-tooltip content="访问的组件路径,如:`system/user/index`,默认在`views`目录下" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="访问的组件路径,如:`system/user/index`,默认在`views`目录下"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
组件路径
|
||||
</span>
|
||||
@ -196,10 +268,17 @@
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'M'">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
|
||||
<el-input
|
||||
v-model="form.perms"
|
||||
placeholder="请输入权限标识"
|
||||
maxlength="100"
|
||||
/>
|
||||
<span slot="label">
|
||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
权限字符
|
||||
</span>
|
||||
@ -207,10 +286,17 @@
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.query" placeholder="请输入路由参数" maxlength="255" />
|
||||
<el-input
|
||||
v-model="form.query"
|
||||
placeholder="请输入路由参数"
|
||||
maxlength="255"
|
||||
/>
|
||||
<span slot="label">
|
||||
<el-tooltip content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`' placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content='访问路由的默认传递参数,如:`{"id": 1, "name": "ry"}`'
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
路由参数
|
||||
</span>
|
||||
@ -219,8 +305,11 @@
|
||||
<el-col :span="12" v-if="form.menuType == 'C'">
|
||||
<el-form-item>
|
||||
<span slot="label">
|
||||
<el-tooltip content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="选择是则会被`keep-alive`缓存,需要匹配组件的`name`和地址保持一致"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
是否缓存
|
||||
</span>
|
||||
@ -233,8 +322,11 @@
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<span slot="label">
|
||||
<el-tooltip content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="选择隐藏则路由将不会出现在侧边栏,但仍然可以访问"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
显示状态
|
||||
</span>
|
||||
@ -243,15 +335,19 @@
|
||||
v-for="dict in dict.type.sys_show_hide"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="form.menuType != 'F'">
|
||||
<el-form-item>
|
||||
<span slot="label">
|
||||
<el-tooltip content="选择停用则路由将不会出现在侧边栏,也不能被访问" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
<el-tooltip
|
||||
content="选择停用则路由将不会出现在侧边栏,也不能被访问"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
菜单状态
|
||||
</span>
|
||||
@ -260,7 +356,8 @@
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -275,14 +372,20 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
|
||||
import {
|
||||
listMenu,
|
||||
getMenu,
|
||||
delMenu,
|
||||
addMenu,
|
||||
updateMenu,
|
||||
} from "@/api/system/menu";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import IconSelect from "@/components/IconSelect";
|
||||
|
||||
export default {
|
||||
name: "Menu",
|
||||
dicts: ['sys_show_hide', 'sys_normal_disable'],
|
||||
dicts: ["sys_show_hide", "sys_normal_disable"],
|
||||
components: { Treeselect, IconSelect },
|
||||
data() {
|
||||
return {
|
||||
@ -305,22 +408,22 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
menuName: undefined,
|
||||
visible: undefined
|
||||
visible: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
menuName: [
|
||||
{ required: true, message: "菜单名称不能为空", trigger: "blur" }
|
||||
{ required: true, message: "菜单名称不能为空", trigger: "blur" },
|
||||
],
|
||||
orderNum: [
|
||||
{ required: true, message: "菜单顺序不能为空", trigger: "blur" }
|
||||
{ required: true, message: "菜单顺序不能为空", trigger: "blur" },
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: "路由地址不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
{ required: true, message: "路由地址不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -334,7 +437,7 @@ export default {
|
||||
/** 查询菜单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMenu(this.queryParams).then(response => {
|
||||
listMenu(this.queryParams).then((response) => {
|
||||
this.menuList = this.handleTree(response.data, "menuId");
|
||||
this.loading = false;
|
||||
});
|
||||
@ -347,14 +450,14 @@ export default {
|
||||
return {
|
||||
id: node.menuId,
|
||||
label: node.menuName,
|
||||
children: node.children
|
||||
children: node.children,
|
||||
};
|
||||
},
|
||||
/** 查询菜单下拉树结构 */
|
||||
getTreeselect() {
|
||||
listMenu().then(response => {
|
||||
listMenu().then((response) => {
|
||||
this.menuOptions = [];
|
||||
const menu = { menuId: 0, menuName: '主类目', children: [] };
|
||||
const menu = { menuId: 0, menuName: "主类目", children: [] };
|
||||
menu.children = this.handleTree(response.data, "menuId");
|
||||
this.menuOptions.push(menu);
|
||||
});
|
||||
@ -376,7 +479,7 @@ export default {
|
||||
isFrame: "1",
|
||||
isCache: "0",
|
||||
visible: "0",
|
||||
status: "0"
|
||||
status: "0",
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -413,24 +516,24 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
getMenu(row.menuId).then(response => {
|
||||
getMenu(row.menuId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改菜单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.menuId != undefined) {
|
||||
updateMenu(this.form).then(response => {
|
||||
updateMenu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMenu(this.form).then(response => {
|
||||
addMenu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -441,13 +544,17 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
|
||||
return delMenu(row.menuId);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
this.$modal
|
||||
.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMenu(row.menuId);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -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="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
@ -73,8 +80,16 @@
|
||||
></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>
|
||||
|
||||
@ -87,7 +102,8 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:user:add']"
|
||||
>新增</el-button>
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -98,7 +114,8 @@
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -109,7 +126,8 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:user:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -119,7 +137,8 @@
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['system:user:import']"
|
||||
>导入</el-button>
|
||||
>导入</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -129,19 +148,67 @@
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:user:export']"
|
||||
>导出</el-button>
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
:columns="columns"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="userList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||
<el-table-column
|
||||
label="用户编号"
|
||||
align="center"
|
||||
key="userId"
|
||||
prop="userId"
|
||||
v-if="columns[0].visible"
|
||||
/>
|
||||
<el-table-column
|
||||
label="用户名称"
|
||||
align="center"
|
||||
key="userName"
|
||||
prop="userName"
|
||||
v-if="columns[1].visible"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="用户昵称"
|
||||
align="center"
|
||||
key="nickName"
|
||||
prop="nickName"
|
||||
v-if="columns[2].visible"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="部门"
|
||||
align="center"
|
||||
key="deptName"
|
||||
prop="dept.deptName"
|
||||
v-if="columns[3].visible"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="手机号码"
|
||||
align="center"
|
||||
key="phonenumber"
|
||||
prop="phonenumber"
|
||||
v-if="columns[4].visible"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
key="status"
|
||||
v-if="columns[5].visible"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
@ -151,7 +218,13 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
v-if="columns[6].visible"
|
||||
width="160"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
@ -169,23 +242,37 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>修改</el-button>
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:user:remove']"
|
||||
>删除</el-button>
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
||||
>删除</el-button
|
||||
>
|
||||
<el-dropdown
|
||||
size="mini"
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
v-hasPermi="['system:user:resetPwd', 'system:user:edit']"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<i class="el-icon-d-arrow-right el-icon--right"></i>更多
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
||||
v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
|
||||
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
|
||||
v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleResetPwd"
|
||||
icon="el-icon-key"
|
||||
v-hasPermi="['system:user:resetPwd']"
|
||||
>重置密码</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
command="handleAuthRole"
|
||||
icon="el-icon-circle-check"
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>分配角色</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@ -193,7 +280,7 @@
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@ -208,36 +295,71 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
|
||||
<el-input
|
||||
v-model="form.nickName"
|
||||
placeholder="请输入用户昵称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||
<treeselect
|
||||
v-model="form.deptId"
|
||||
:options="deptOptions"
|
||||
:show-count="true"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||
<el-input
|
||||
v-model="form.phonenumber"
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
<el-input
|
||||
v-model="form.email"
|
||||
placeholder="请输入邮箱"
|
||||
maxlength="50"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
|
||||
<el-form-item
|
||||
v-if="form.userId == undefined"
|
||||
label="用户名称"
|
||||
prop="userName"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.userName"
|
||||
placeholder="请输入用户名称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
|
||||
<el-form-item
|
||||
v-if="form.userId == undefined"
|
||||
label="用户密码"
|
||||
prop="password"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.password"
|
||||
placeholder="请输入用户密码"
|
||||
type="password"
|
||||
maxlength="20"
|
||||
show-password
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -261,7 +383,8 @@
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -269,7 +392,11 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
|
||||
<el-select
|
||||
v-model="form.postIds"
|
||||
multiple
|
||||
placeholder="请选择岗位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in postOptions"
|
||||
:key="item.postId"
|
||||
@ -282,7 +409,11 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
|
||||
<el-select
|
||||
v-model="form.roleIds"
|
||||
multiple
|
||||
placeholder="请选择角色"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in roleOptions"
|
||||
:key="item.roleId"
|
||||
@ -297,7 +428,11 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -309,7 +444,12 @@
|
||||
</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"
|
||||
@ -326,10 +466,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>仅允许导入xls、xlsx格式文件。</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">
|
||||
@ -341,7 +488,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
||||
import {
|
||||
listUser,
|
||||
getUser,
|
||||
delUser,
|
||||
addUser,
|
||||
updateUser,
|
||||
resetUserPwd,
|
||||
changeUserStatus,
|
||||
} from "@/api/system/user";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { treeselect } from "@/api/system/dept";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
@ -349,7 +504,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
||||
dicts: ["sys_normal_disable", "sys_user_sex"],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
@ -387,7 +542,7 @@ export default {
|
||||
form: {},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "label"
|
||||
label: "label",
|
||||
},
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
@ -402,7 +557,7 @@ export default {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
@ -411,7 +566,7 @@ export default {
|
||||
userName: undefined,
|
||||
phonenumber: undefined,
|
||||
status: undefined,
|
||||
deptId: undefined
|
||||
deptId: undefined,
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
@ -421,48 +576,58 @@ export default {
|
||||
{ key: 3, label: `部门`, visible: true },
|
||||
{ key: 4, label: `手机号码`, visible: true },
|
||||
{ key: 5, label: `状态`, visible: true },
|
||||
{ key: 6, label: `创建时间`, visible: true }
|
||||
{ key: 6, label: `创建时间`, visible: true },
|
||||
],
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
{
|
||||
min: 2,
|
||||
max: 20,
|
||||
message: "用户名称长度必须介于 2 和 20 之间",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
|
||||
{
|
||||
min: 5,
|
||||
max: 20,
|
||||
message: "用户密码长度必须介于 5 和 20 之间",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
email: [
|
||||
{
|
||||
type: "email",
|
||||
message: "请输入正确的邮箱地址",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
phonenumber: [
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTreeselect();
|
||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||
this.getConfigKey("sys.user.initPassword").then((response) => {
|
||||
this.initPassword = response.msg;
|
||||
});
|
||||
},
|
||||
@ -470,7 +635,8 @@ export default {
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||
(response) => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -479,8 +645,7 @@ export default {
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
treeselect().then(response => {
|
||||
debugger;
|
||||
treeselect().then((response) => {
|
||||
this.deptOptions = response.data;
|
||||
});
|
||||
},
|
||||
@ -497,13 +662,17 @@ export default {
|
||||
// 用户状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "0" ? "启用" : "停用";
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
||||
return changeUserStatus(row.userId, row.status);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
this.$modal
|
||||
.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
|
||||
.then(function () {
|
||||
return changeUserStatus(row.userId, row.status);
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
})
|
||||
.catch(function () {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
@ -524,7 +693,7 @@ export default {
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
postIds: [],
|
||||
roleIds: []
|
||||
roleIds: [],
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -541,7 +710,7 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.userId);
|
||||
this.ids = selection.map((item) => item.userId);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
@ -562,7 +731,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
getUser().then(response => {
|
||||
getUser().then((response) => {
|
||||
this.postOptions = response.posts;
|
||||
this.roleOptions = response.roles;
|
||||
this.open = true;
|
||||
@ -575,7 +744,7 @@ export default {
|
||||
this.reset();
|
||||
this.getTreeselect();
|
||||
const userId = row.userId || this.ids;
|
||||
getUser(userId).then(response => {
|
||||
getUser(userId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.postOptions = response.posts;
|
||||
this.roleOptions = response.roles;
|
||||
@ -593,30 +762,32 @@ export default {
|
||||
cancelButtonText: "取消",
|
||||
closeOnClickModal: false,
|
||||
inputPattern: /^.{5,20}$/,
|
||||
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
|
||||
}).then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
|
||||
})
|
||||
.then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
});
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 分配角色操作 */
|
||||
handleAuthRole: function(row) {
|
||||
handleAuthRole: function (row) {
|
||||
const userId = row.userId;
|
||||
this.$router.push("/system/user-auth/role/" + userId);
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.userId != undefined) {
|
||||
updateUser(this.form).then(response => {
|
||||
updateUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addUser(this.form).then(response => {
|
||||
addUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -628,18 +799,26 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const userIds = row.userId || this.ids;
|
||||
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
||||
return delUser(userIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delUser(userIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/user/export', {
|
||||
...this.queryParams
|
||||
}, `user_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"system/user/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`user_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
@ -648,8 +827,11 @@ export default {
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('system/user/importTemplate', {
|
||||
}, `user_template_${new Date().getTime()}.xlsx`)
|
||||
this.download(
|
||||
"system/user/importTemplate",
|
||||
{},
|
||||
`user_template_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
@ -660,13 +842,19 @@ 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();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
167
vue.config.js
167
vue.config.js
@ -1,15 +1,15 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
"use strict";
|
||||
const path = require("path");
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
|
||||
const CompressionPlugin = require('compression-webpack-plugin')
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
|
||||
const name = process.env.VUE_APP_TITLE || '苦糖果MES-软件开发记录' // 网页标题
|
||||
const name = "智能工厂MES系统"; // 网页标题
|
||||
|
||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||
const port = process.env.port || process.env.npm_config_port || 80; // 端口
|
||||
|
||||
// vue.config.js 配置说明
|
||||
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
||||
@ -20,124 +20,119 @@ module.exports = {
|
||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||
outputDir: 'dist',
|
||||
outputDir: "dist",
|
||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||
assetsDir: 'static',
|
||||
assetsDir: "static",
|
||||
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
lintOnSave: process.env.NODE_ENV === "development",
|
||||
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||
productionSourceMap: false,
|
||||
// webpack-dev-server 相关配置
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
host: "0.0.0.0",
|
||||
port: port,
|
||||
open: true,
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://localhost:8080`,
|
||||
"/prod-api": {
|
||||
target: `http://192.168.3.53:8062`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
}
|
||||
// pathRewrite: {
|
||||
// ['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
// }
|
||||
},
|
||||
'/ureport': {
|
||||
target: 'http://localhost:8080',
|
||||
ws:false,
|
||||
"/ureport": {
|
||||
target: `http://192.168.3.53:8062`,
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/ureport': '/ureport'
|
||||
}
|
||||
"^/ureport": "/ureport",
|
||||
},
|
||||
},
|
||||
},
|
||||
disableHostCheck: true
|
||||
disableHostCheck: true,
|
||||
},
|
||||
css: {
|
||||
loaderOptions: {
|
||||
sass: {
|
||||
sassOptions: { outputStyle: "expanded" }
|
||||
}
|
||||
}
|
||||
sassOptions: { outputStyle: "expanded" },
|
||||
},
|
||||
},
|
||||
},
|
||||
configureWebpack: {
|
||||
name: name,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('src')
|
||||
}
|
||||
"@": resolve("src"),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
||||
new CompressionPlugin({
|
||||
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
||||
filename: '[path].gz[query]', // 压缩后的文件名
|
||||
algorithm: 'gzip', // 使用gzip压缩
|
||||
minRatio: 0.8 // 压缩率小于1才会压缩
|
||||
})
|
||||
test: /\.(js|css|html)?$/i, // 压缩文件格式
|
||||
filename: "[path].gz[query]", // 压缩后的文件名
|
||||
algorithm: "gzip", // 使用gzip压缩
|
||||
minRatio: 0.8, // 压缩率小于1才会压缩
|
||||
}),
|
||||
],
|
||||
},
|
||||
chainWebpack(config) {
|
||||
config.plugins.delete('preload') // TODO: need test
|
||||
config.plugins.delete('prefetch') // TODO: need test
|
||||
config.plugins.delete("preload"); // TODO: need test
|
||||
config.plugins.delete("prefetch"); // TODO: need test
|
||||
|
||||
// set svg-sprite-loader
|
||||
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
|
||||
config.module
|
||||
.rule('svg')
|
||||
.exclude.add(resolve('src/assets/icons'))
|
||||
.end()
|
||||
config.module
|
||||
.rule('icons')
|
||||
.rule("icons")
|
||||
.test(/\.svg$/)
|
||||
.include.add(resolve('src/assets/icons'))
|
||||
.include.add(resolve("src/assets/icons"))
|
||||
.end()
|
||||
.use('svg-sprite-loader')
|
||||
.loader('svg-sprite-loader')
|
||||
.use("svg-sprite-loader")
|
||||
.loader("svg-sprite-loader")
|
||||
.options({
|
||||
symbolId: 'icon-[name]'
|
||||
symbolId: "icon-[name]",
|
||||
})
|
||||
.end()
|
||||
.end();
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV !== 'development',
|
||||
config => {
|
||||
config
|
||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||
.after('html')
|
||||
.use('script-ext-html-webpack-plugin', [{
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/
|
||||
}])
|
||||
.end()
|
||||
config
|
||||
.optimization.splitChunks({
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
libs: {
|
||||
name: 'chunk-libs',
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: 10,
|
||||
chunks: 'initial' // only package third parties that are initially dependent
|
||||
},
|
||||
elementUI: {
|
||||
name: 'chunk-elementUI', // split elementUI into a single package
|
||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||
},
|
||||
commons: {
|
||||
name: 'chunk-commons',
|
||||
test: resolve('src/components'), // can customize your rules
|
||||
minChunks: 3, // minimum common number
|
||||
priority: 5,
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
}
|
||||
})
|
||||
config.optimization.runtimeChunk('single'),
|
||||
config.when(process.env.NODE_ENV !== "development", (config) => {
|
||||
config
|
||||
.plugin("ScriptExtHtmlWebpackPlugin")
|
||||
.after("html")
|
||||
.use("script-ext-html-webpack-plugin", [
|
||||
{
|
||||
from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
|
||||
to: './' //到根目录下
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/,
|
||||
},
|
||||
])
|
||||
.end();
|
||||
config.optimization.splitChunks({
|
||||
chunks: "all",
|
||||
cacheGroups: {
|
||||
libs: {
|
||||
name: "chunk-libs",
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: 10,
|
||||
chunks: "initial", // only package third parties that are initially dependent
|
||||
},
|
||||
elementUI: {
|
||||
name: "chunk-elementUI", // split elementUI into a single package
|
||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
|
||||
},
|
||||
commons: {
|
||||
name: "chunk-commons",
|
||||
test: resolve("src/components"), // can customize your rules
|
||||
minChunks: 3, // minimum common number
|
||||
priority: 5,
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
config.optimization.runtimeChunk("single"),
|
||||
{
|
||||
from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件
|
||||
to: "./", //到根目录下
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user