forked from mt-fe-group/mt-yd-ui
update request.js & routes
This commit is contained in:
parent
0566808861
commit
d3752c4f40
@ -31,6 +31,10 @@ Vue.use(renRegionTree)
|
||||
Vue.prototype.$http = http
|
||||
Vue.prototype.$hasPermission = hasPermission
|
||||
Vue.prototype.$getDictLabel = getDictLabel
|
||||
// is auth
|
||||
Vue.prototype.isAuth = permission => {
|
||||
return "正在检查的权限是:" + permission
|
||||
}
|
||||
|
||||
// 保存整站vuex本地储存初始状态
|
||||
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
|
||||
|
@ -2,6 +2,7 @@ import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import http from '@/utils/request'
|
||||
import { isURL } from '@/utils/validate'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
@ -12,7 +13,7 @@ export const pageRoutes = [
|
||||
component: () => import('@/views/pages/404'),
|
||||
name: '404',
|
||||
meta: { title: '404未找到' },
|
||||
beforeEnter (to, from, next) {
|
||||
beforeEnter(to, from, next) {
|
||||
// 拦截处理特殊业务场景
|
||||
// 如果, 重定向路由包含__双下划线, 为临时添加路由
|
||||
if (/__.*/.test(to.redirectedFrom)) {
|
||||
@ -21,7 +22,20 @@ export const pageRoutes = [
|
||||
next()
|
||||
}
|
||||
},
|
||||
{ path: '/login', component: () => import('@/views/pages/login'), name: 'login', meta: { title: '登录' } }
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/pages/login'),
|
||||
name: 'login',
|
||||
meta: { title: '登录' },
|
||||
beforeEnter(to, from, next) {
|
||||
if (Cookies.get('token')) {
|
||||
Vue.prototype.$message({ message:'已经登录过了', type: 'error' })
|
||||
next(false)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
// 模块路由(基于主入口布局页面)
|
||||
@ -36,7 +50,7 @@ export const moduleRoutes = {
|
||||
]
|
||||
}
|
||||
|
||||
export function addDynamicRoute (routeParams, router) {
|
||||
export function addDynamicRoute(routeParams, router) {
|
||||
// 组装路由名称, 并判断是否已添加, 如是: 则直接跳转
|
||||
var routeName = routeParams.routeName
|
||||
var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0]
|
||||
@ -72,7 +86,6 @@ const router = new Router({
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
console.log('[*] === router beforeEach: ', to, from)
|
||||
// 添加动态(菜单)路由
|
||||
// 已添加或者当前路由为页面路由, 可直接访问
|
||||
if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
|
||||
@ -84,7 +97,9 @@ router.beforeEach((to, from, next) => {
|
||||
return
|
||||
}
|
||||
window.SITE_CONFIG['dictList'] = res.data
|
||||
}).catch(() => {})
|
||||
}).catch((err) => {
|
||||
// console.log("catch /sys/dict/type/all", err)
|
||||
})
|
||||
// 获取菜单列表, 添加并全局变量保存
|
||||
http.get('/sys/menu/nav').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
@ -94,7 +109,7 @@ router.beforeEach((to, from, next) => {
|
||||
window.SITE_CONFIG['menuList'] = res.data
|
||||
fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
|
||||
next({ ...to, replace: true })
|
||||
}).catch(() => {
|
||||
}).catch((err) => {
|
||||
next({ name: 'login' })
|
||||
})
|
||||
})
|
||||
@ -104,7 +119,7 @@ router.beforeEach((to, from, next) => {
|
||||
* @param {*} route 当前路由
|
||||
* @param {*} pageRoutes 页面路由
|
||||
*/
|
||||
function fnCurrentRouteIsPageRoute (route, pageRoutes = []) {
|
||||
function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
|
||||
var temp = []
|
||||
for (var i = 0; i < pageRoutes.length; i++) {
|
||||
if (route.path === pageRoutes[i].path) {
|
||||
@ -122,7 +137,7 @@ function fnCurrentRouteIsPageRoute (route, pageRoutes = []) {
|
||||
* @param {*} menuList 菜单列表
|
||||
* @param {*} routes 递归创建的动态(菜单)路由
|
||||
*/
|
||||
function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
|
||||
function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
|
||||
var temp = []
|
||||
for (var i = 0; i < menuList.length; i++) {
|
||||
if (menuList[i].children && menuList[i].children.length >= 1) {
|
||||
|
@ -4,6 +4,7 @@ import router from '@/router'
|
||||
import qs from 'qs'
|
||||
import { clearLoginInfo } from '@/utils'
|
||||
import isPlainObject from 'lodash/isPlainObject'
|
||||
import merge from 'lodash/merge'
|
||||
|
||||
const http = axios.create({
|
||||
baseURL: window.SITE_CONFIG['apiURL'],
|
||||
@ -61,4 +62,42 @@ http.interceptors.response.use(response => {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
/**
|
||||
* 请求地址处理
|
||||
* @param {*} actionName action方法名称
|
||||
*/
|
||||
http.adornUrl = (actionName) => {
|
||||
// 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
|
||||
return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
|
||||
}
|
||||
|
||||
/**
|
||||
* get请求参数处理
|
||||
* @param {*} params 参数对象
|
||||
* @param {*} openDefultParams 是否开启默认参数?
|
||||
*/
|
||||
http.adornParams = (params = {}, openDefaultParams = true) => {
|
||||
var defaults = {
|
||||
't': new Date().getTime()
|
||||
}
|
||||
return openDefaultParams ? merge(defaults, params) : params
|
||||
}
|
||||
|
||||
/**
|
||||
* post请求数据处理
|
||||
* @param {*} data 数据对象
|
||||
* @param {*} openDefultdata 是否开启默认数据?
|
||||
* @param {*} contentType 数据格式
|
||||
* json: 'application/json; charset=utf-8'
|
||||
* form: 'application/x-www-form-urlencoded; charset=utf-8'
|
||||
*/
|
||||
http.adornData = (data = {}, openDefaultdata = true, contentType = 'json') => {
|
||||
var defaults = {
|
||||
't': new Date().getTime()
|
||||
}
|
||||
data = openDefaultdata ? merge(defaults, data) : data
|
||||
return contentType === 'json' ? JSON.stringify(data) : qs.stringify(data)
|
||||
}
|
||||
|
||||
|
||||
export default http
|
||||
|
253
src/views/modules/code/equipmenFile.vue
Normal file
253
src/views/modules/code/equipmenFile.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenfile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenfile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件类型编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件名字">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileUrl"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="下载地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenfile-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenfile/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenfile/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
235
src/views/modules/code/equipmenGroup.vue
Normal file
235
src/views/modules/code/equipmenGroup.vue
Normal file
@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmengroup:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmengroup:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="分组编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="分组名字">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备类型id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmengroup-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmengroup/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmengroup/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
192
src/views/modules/code/equipmenalarmlog-add-or-update.vue
Normal file
192
src/views/modules/code/equipmenalarmlog-add-or-update.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="报警信息ID,关联T_equipment_group_alarm表" prop="alarmId">
|
||||
<el-input v-model="dataForm.alarmId" placeholder="报警信息ID,关联T_equipment_group_alarm表"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警来源" prop="alarmSource">
|
||||
<el-input v-model="dataForm.alarmSource" placeholder="报警来源"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警详细内容" prop="alarmContent">
|
||||
<el-input v-model="dataForm.alarmContent" placeholder="报警详细内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警设备id 关联equipment表" prop="alarmEquipmentId">
|
||||
<el-input v-model="dataForm.alarmEquipmentId" placeholder="报警设备id 关联equipment表"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
alarmId: '',
|
||||
alarmSource: '',
|
||||
alarmContent: '',
|
||||
alarmEquipmentId: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
alarmId: [
|
||||
{ required: true, message: '报警信息ID,关联T_equipment_group_alarm表不能为空', trigger: 'blur' }
|
||||
],
|
||||
alarmSource: [
|
||||
{ required: true, message: '报警来源不能为空', trigger: 'blur' }
|
||||
],
|
||||
alarmContent: [
|
||||
{ required: true, message: '报警详细内容不能为空', trigger: 'blur' }
|
||||
],
|
||||
alarmEquipmentId: [
|
||||
{ required: true, message: '报警设备id 关联equipment表不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenalarmlog/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.alarmId = data.equipmenalarmLog.alarmId
|
||||
this.dataForm.alarmSource = data.equipmenalarmLog.alarmSource
|
||||
this.dataForm.alarmContent = data.equipmenalarmLog.alarmContent
|
||||
this.dataForm.alarmEquipmentId = data.equipmenalarmLog.alarmEquipmentId
|
||||
this.dataForm.remark = data.equipmenalarmLog.remark
|
||||
this.dataForm.valid = data.equipmenalarmLog.valid
|
||||
this.dataForm.creatorId = data.equipmenalarmLog.creatorId
|
||||
this.dataForm.creatorName = data.equipmenalarmLog.creatorName
|
||||
this.dataForm.createTime = data.equipmenalarmLog.createTime
|
||||
this.dataForm.updaterId = data.equipmenalarmLog.updaterId
|
||||
this.dataForm.updaterName = data.equipmenalarmLog.updaterName
|
||||
this.dataForm.updateTime = data.equipmenalarmLog.updateTime
|
||||
this.dataForm.version = data.equipmenalarmLog.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenalarmlog/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'alarmId': this.dataForm.alarmId,
|
||||
'alarmSource': this.dataForm.alarmSource,
|
||||
'alarmContent': this.dataForm.alarmContent,
|
||||
'alarmEquipmentId': this.dataForm.alarmEquipmentId,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
183
src/views/modules/code/equipmenattr-add-or-update.vue
Normal file
183
src/views/modules/code/equipmenattr-add-or-update.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性名称" prop="attrName">
|
||||
<el-input v-model="dataForm.attrName" placeholder="属性名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值" prop="attrValue">
|
||||
<el-input v-model="dataForm.attrValue" placeholder="属性值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
equipmentId: '',
|
||||
attrName: '',
|
||||
attrValue: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
attrName: [
|
||||
{ required: true, message: '属性名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
attrValue: [
|
||||
{ required: true, message: '属性值不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenattr/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.equipmentId = data.equipmenattr.equipmentId
|
||||
this.dataForm.attrName = data.equipmenattr.attrName
|
||||
this.dataForm.attrValue = data.equipmenattr.attrValue
|
||||
this.dataForm.remark = data.equipmenattr.remark
|
||||
this.dataForm.valid = data.equipmenattr.valid
|
||||
this.dataForm.creatorId = data.equipmenattr.creatorId
|
||||
this.dataForm.creatorName = data.equipmenattr.creatorName
|
||||
this.dataForm.createTime = data.equipmenattr.createTime
|
||||
this.dataForm.updaterId = data.equipmenattr.updaterId
|
||||
this.dataForm.updaterName = data.equipmenattr.updaterName
|
||||
this.dataForm.updateTime = data.equipmenattr.updateTime
|
||||
this.dataForm.version = data.equipmenattr.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenattr/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'attrName': this.dataForm.attrName,
|
||||
'attrValue': this.dataForm.attrValue,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
229
src/views/modules/code/equipmenattr.vue
Normal file
229
src/views/modules/code/equipmenattr.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenattr:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenattr:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="attrName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="属性名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="attrValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="属性值">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenattr-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenattr/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenattr/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
219
src/views/modules/code/equipmenfile-add-or-update.vue
Normal file
219
src/views/modules/code/equipmenfile-add-or-update.vue
Normal file
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件ID" prop="fileId">
|
||||
<el-input v-model="dataForm.fileId" placeholder="文件ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型编号" prop="typeCode">
|
||||
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名字" prop="fileName">
|
||||
<el-input v-model="dataForm.fileName" placeholder="文件名字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="下载地址" prop="fileUrl">
|
||||
<el-input v-model="dataForm.fileUrl" placeholder="下载地址"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
equipmentId: '',
|
||||
fileId: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
typeCode: '',
|
||||
fileName: '',
|
||||
fileUrl: ''
|
||||
},
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileId: [
|
||||
{ required: true, message: '文件ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
typeCode: [
|
||||
{ required: true, message: '文件类型编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileName: [
|
||||
{ required: true, message: '文件名字不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileUrl: [
|
||||
{ required: true, message: '下载地址不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenfile/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.equipmentId = data.equipmenfile.equipmentId
|
||||
this.dataForm.fileId = data.equipmenfile.fileId
|
||||
this.dataForm.description = data.equipmenfile.description
|
||||
this.dataForm.enabled = data.equipmenfile.enabled
|
||||
this.dataForm.remark = data.equipmenfile.remark
|
||||
this.dataForm.valid = data.equipmenfile.valid
|
||||
this.dataForm.creatorId = data.equipmenfile.creatorId
|
||||
this.dataForm.creatorName = data.equipmenfile.creatorName
|
||||
this.dataForm.createTime = data.equipmenfile.createTime
|
||||
this.dataForm.updaterId = data.equipmenfile.updaterId
|
||||
this.dataForm.updaterName = data.equipmenfile.updaterName
|
||||
this.dataForm.updateTime = data.equipmenfile.updateTime
|
||||
this.dataForm.version = data.equipmenfile.version
|
||||
this.dataForm.typeCode = data.equipmenfile.typeCode
|
||||
this.dataForm.fileName = data.equipmenfile.fileName
|
||||
this.dataForm.fileUrl = data.equipmenfile.fileUrl
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenfile/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'fileId': this.dataForm.fileId,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'typeCode': this.dataForm.typeCode,
|
||||
'fileName': this.dataForm.fileName,
|
||||
'fileUrl': this.dataForm.fileUrl
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
192
src/views/modules/code/equipmengroup-add-or-update.vue
Normal file
192
src/views/modules/code/equipmengroup-add-or-update.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="分组编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="分组编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分组名字" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="分组名字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型id" prop="typeId">
|
||||
<el-input v-model="dataForm.typeId" placeholder="设备类型id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
typeId: '',
|
||||
description: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '分组编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '分组名字不能为空', trigger: 'blur' }
|
||||
],
|
||||
typeId: [
|
||||
{ required: true, message: '设备类型id不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmengroup/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.equipmengroup.code
|
||||
this.dataForm.name = data.equipmengroup.name
|
||||
this.dataForm.typeId = data.equipmengroup.typeId
|
||||
this.dataForm.description = data.equipmengroup.description
|
||||
this.dataForm.remark = data.equipmengroup.remark
|
||||
this.dataForm.valid = data.equipmengroup.valid
|
||||
this.dataForm.creatorId = data.equipmengroup.creatorId
|
||||
this.dataForm.creatorName = data.equipmengroup.creatorName
|
||||
this.dataForm.createTime = data.equipmengroup.createTime
|
||||
this.dataForm.updaterId = data.equipmengroup.updaterId
|
||||
this.dataForm.updaterName = data.equipmengroup.updaterName
|
||||
this.dataForm.updateTime = data.equipmengroup.updateTime
|
||||
this.dataForm.version = data.equipmengroup.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmengroup/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'typeId': this.dataForm.typeId,
|
||||
'description': this.dataForm.description,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
237
src/views/modules/code/equipmengroupalarm-add-or-update.vue
Normal file
237
src/views/modules/code/equipmengroupalarm-add-or-update.vue
Normal file
@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备分组ID,关联t_equipment_group" prop="equipmentGroupId">
|
||||
<el-input v-model="dataForm.equipmentGroupId" placeholder="设备分组ID,关联t_equipment_group"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警类型 字典表关联label_value" prop="typeDictValue">
|
||||
<el-input v-model="dataForm.typeDictValue" placeholder="报警类型 字典表关联label_value"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警级别 字典表关联label_value" prop="gradeDictValue">
|
||||
<el-input v-model="dataForm.gradeDictValue" placeholder="报警级别 字典表关联label_value"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报警内容" prop="alarmContent">
|
||||
<el-input v-model="dataForm.alarmContent" placeholder="报警内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="推送方式 0邮箱 1微信" prop="alarmNotify">
|
||||
<el-input v-model="dataForm.alarmNotify" placeholder="推送方式 0邮箱 1微信"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
equipmentGroupId: '',
|
||||
code: '',
|
||||
typeDictValue: '',
|
||||
gradeDictValue: '',
|
||||
alarmContent: '',
|
||||
description: '',
|
||||
externalCode: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
alarmNotify: ''
|
||||
},
|
||||
dataRule: {
|
||||
equipmentGroupId: [
|
||||
{ required: true, message: '设备分组ID,关联t_equipment_group不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
typeDictValue: [
|
||||
{ required: true, message: '报警类型 字典表关联label_value不能为空', trigger: 'blur' }
|
||||
],
|
||||
gradeDictValue: [
|
||||
{ required: true, message: '报警级别 字典表关联label_value不能为空', trigger: 'blur' }
|
||||
],
|
||||
alarmContent: [
|
||||
{ required: true, message: '报警内容不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
alarmNotify: [
|
||||
{ required: true, message: '推送方式 0邮箱 1微信不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmengroupalarm/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.equipmentGroupId = data.equipmengroupAlarm.equipmentGroupId
|
||||
this.dataForm.code = data.equipmengroupAlarm.code
|
||||
this.dataForm.typeDictValue = data.equipmengroupAlarm.typeDictValue
|
||||
this.dataForm.gradeDictValue = data.equipmengroupAlarm.gradeDictValue
|
||||
this.dataForm.alarmContent = data.equipmengroupAlarm.alarmContent
|
||||
this.dataForm.description = data.equipmengroupAlarm.description
|
||||
this.dataForm.externalCode = data.equipmengroupAlarm.externalCode
|
||||
this.dataForm.enabled = data.equipmengroupAlarm.enabled
|
||||
this.dataForm.remark = data.equipmengroupAlarm.remark
|
||||
this.dataForm.valid = data.equipmengroupAlarm.valid
|
||||
this.dataForm.creatorId = data.equipmengroupAlarm.creatorId
|
||||
this.dataForm.creatorName = data.equipmengroupAlarm.creatorName
|
||||
this.dataForm.createTime = data.equipmengroupAlarm.createTime
|
||||
this.dataForm.updaterId = data.equipmengroupAlarm.updaterId
|
||||
this.dataForm.updaterName = data.equipmengroupAlarm.updaterName
|
||||
this.dataForm.updateTime = data.equipmengroupAlarm.updateTime
|
||||
this.dataForm.version = data.equipmengroupAlarm.version
|
||||
this.dataForm.alarmNotify = data.equipmengroupAlarm.alarmNotify
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmengroupalarm/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'equipmentGroupId': this.dataForm.equipmentGroupId,
|
||||
'code': this.dataForm.code,
|
||||
'typeDictValue': this.dataForm.typeDictValue,
|
||||
'gradeDictValue': this.dataForm.gradeDictValue,
|
||||
'alarmContent': this.dataForm.alarmContent,
|
||||
'description': this.dataForm.description,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'alarmNotify': this.dataForm.alarmNotify
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
264
src/views/modules/code/equipmenplc-add-or-update.vue
Normal file
264
src/views/modules/code/equipmenplc-add-or-update.vue
Normal file
@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="plc类型" prop="plcType">
|
||||
<el-input v-model="dataForm.plcType" placeholder="plc类型"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="plc名称(ip+名称对应实时数据库表名)" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="plc名称(ip+名称对应实时数据库表名)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="英文名称" prop="enName">
|
||||
<el-input v-model="dataForm.enName" placeholder="英文名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="plc条码" prop="barcode">
|
||||
<el-input v-model="dataForm.barcode" placeholder="plc条码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接方式,0 tcp,1 udp等" prop="controlType">
|
||||
<el-input v-model="dataForm.controlType" placeholder="链接方式,0 tcp,1 udp等"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否监控 0 代表不监控, 1 代表监控" prop="monitor">
|
||||
<el-input v-model="dataForm.monitor" placeholder="是否监控 0 代表不监控, 1 代表监控"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否采集 0 代表不采集, 1 代表采集" prop="collection">
|
||||
<el-input v-model="dataForm.collection" placeholder="是否采集 0 代表不采集, 1 代表采集"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP" prop="ip">
|
||||
<el-input v-model="dataForm.ip" placeholder="IP"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="端口号" prop="port">
|
||||
<el-input v-model="dataForm.port" placeholder="端口号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
plcType: '',
|
||||
code: '',
|
||||
name: '',
|
||||
enName: '',
|
||||
description: '',
|
||||
barcode: '',
|
||||
controlType: '',
|
||||
monitor: '',
|
||||
collection: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
plcType: [
|
||||
{ required: true, message: 'plc类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: 'plc名称(ip+名称对应实时数据库表名)不能为空', trigger: 'blur' }
|
||||
],
|
||||
enName: [
|
||||
{ required: true, message: '英文名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
barcode: [
|
||||
{ required: true, message: 'plc条码不能为空', trigger: 'blur' }
|
||||
],
|
||||
controlType: [
|
||||
{ required: true, message: '链接方式,0 tcp,1 udp等不能为空', trigger: 'blur' }
|
||||
],
|
||||
monitor: [
|
||||
{ required: true, message: '是否监控 0 代表不监控, 1 代表监控不能为空', trigger: 'blur' }
|
||||
],
|
||||
collection: [
|
||||
{ required: true, message: '是否采集 0 代表不采集, 1 代表采集不能为空', trigger: 'blur' }
|
||||
],
|
||||
ip: [
|
||||
{ required: true, message: 'IP不能为空', trigger: 'blur' }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: '端口号不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplc/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.plcType = data.equipmenplc.plcType
|
||||
this.dataForm.code = data.equipmenplc.code
|
||||
this.dataForm.name = data.equipmenplc.name
|
||||
this.dataForm.enName = data.equipmenplc.enName
|
||||
this.dataForm.description = data.equipmenplc.description
|
||||
this.dataForm.barcode = data.equipmenplc.barcode
|
||||
this.dataForm.controlType = data.equipmenplc.controlType
|
||||
this.dataForm.monitor = data.equipmenplc.monitor
|
||||
this.dataForm.collection = data.equipmenplc.collection
|
||||
this.dataForm.ip = data.equipmenplc.ip
|
||||
this.dataForm.port = data.equipmenplc.port
|
||||
this.dataForm.enabled = data.equipmenplc.enabled
|
||||
this.dataForm.remark = data.equipmenplc.remark
|
||||
this.dataForm.valid = data.equipmenplc.valid
|
||||
this.dataForm.creatorId = data.equipmenplc.creatorId
|
||||
this.dataForm.creatorName = data.equipmenplc.creatorName
|
||||
this.dataForm.createTime = data.equipmenplc.createTime
|
||||
this.dataForm.updaterId = data.equipmenplc.updaterId
|
||||
this.dataForm.updaterName = data.equipmenplc.updaterName
|
||||
this.dataForm.updateTime = data.equipmenplc.updateTime
|
||||
this.dataForm.version = data.equipmenplc.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplc/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'plcType': this.dataForm.plcType,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'enName': this.dataForm.enName,
|
||||
'description': this.dataForm.description,
|
||||
'barcode': this.dataForm.barcode,
|
||||
'controlType': this.dataForm.controlType,
|
||||
'monitor': this.dataForm.monitor,
|
||||
'collection': this.dataForm.collection,
|
||||
'ip': this.dataForm.ip,
|
||||
'port': this.dataForm.port,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
183
src/views/modules/code/equipmenplcconnect-add-or-update.vue
Normal file
183
src/views/modules/code/equipmenplcconnect-add-or-update.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="plc表iD" prop="plcId">
|
||||
<el-input v-model="dataForm.plcId" placeholder="plc表iD"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备表id" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备表id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
plcId: '',
|
||||
equipmentId: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
plcId: [
|
||||
{ required: true, message: 'plc表iD不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备表id不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplcconnect/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.plcId = data.equipmenplcConnect.plcId
|
||||
this.dataForm.equipmentId = data.equipmenplcConnect.equipmentId
|
||||
this.dataForm.enabled = data.equipmenplcConnect.enabled
|
||||
this.dataForm.remark = data.equipmenplcConnect.remark
|
||||
this.dataForm.valid = data.equipmenplcConnect.valid
|
||||
this.dataForm.creatorId = data.equipmenplcConnect.creatorId
|
||||
this.dataForm.creatorName = data.equipmenplcConnect.creatorName
|
||||
this.dataForm.createTime = data.equipmenplcConnect.createTime
|
||||
this.dataForm.updaterId = data.equipmenplcConnect.updaterId
|
||||
this.dataForm.updaterName = data.equipmenplcConnect.updaterName
|
||||
this.dataForm.updateTime = data.equipmenplcConnect.updateTime
|
||||
this.dataForm.version = data.equipmenplcConnect.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplcconnect/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'plcId': this.dataForm.plcId,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
309
src/views/modules/code/equipmenplcparam-add-or-update.vue
Normal file
309
src/views/modules/code/equipmenplcparam-add-or-update.vue
Normal file
@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="plc连接表ID" prop="plcConId">
|
||||
<el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型:status、data、constant" prop="type">
|
||||
<el-input v-model="dataForm.type" placeholder="类型:status、data、constant"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数编码" prop="paramCode">
|
||||
<el-input v-model="dataForm.paramCode" placeholder="参数编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数名称" prop="paramName">
|
||||
<el-input v-model="dataForm.paramName" placeholder="参数名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数地址,对应实时数据库表的列名" prop="paramAddress">
|
||||
<el-input v-model="dataForm.paramAddress" placeholder="参数地址,对应实时数据库表的列名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数值类型:int、long、boolean、string、list 暂不使用" prop="valueType">
|
||||
<el-input v-model="dataForm.valueType" placeholder="参数值类型:int、long、boolean、string、list 暂不使用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位 关联数据字典表label_value" prop="unitDictValue">
|
||||
<el-input v-model="dataForm.unitDictValue" placeholder="单位 关联数据字典表label_value"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="最小值" prop="minValue">
|
||||
<el-input v-model="dataForm.minValue" placeholder="最小值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大值" prop="maxValue">
|
||||
<el-input v-model="dataForm.maxValue" placeholder="最大值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数设定标准值" prop="defaultValue">
|
||||
<el-input v-model="dataForm.defaultValue" placeholder="参数设定标准值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="0 代表不采集, 1 代表采集" prop="collection">
|
||||
<el-input v-model="dataForm.collection" placeholder="0 代表不采集, 1 代表采集"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="采集周期(s) 暂不使用" prop="collectionCycle">
|
||||
<el-input v-model="dataForm.collectionCycle" placeholder="采集周期(s) 暂不使用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上报周期(s) 暂不使用" prop="reportingCycle">
|
||||
<el-input v-model="dataForm.reportingCycle" placeholder="上报周期(s) 暂不使用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上报方式 暂不使用" prop="reportingMethod">
|
||||
<el-input v-model="dataForm.reportingMethod" placeholder="上报方式 暂不使用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上报编码 暂不使用" prop="reportingCode">
|
||||
<el-input v-model="dataForm.reportingCode" placeholder="上报编码 暂不使用"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
plcConId: '',
|
||||
type: '',
|
||||
paramCode: '',
|
||||
paramName: '',
|
||||
paramAddress: '',
|
||||
valueType: '',
|
||||
unitDictValue: '',
|
||||
minValue: '',
|
||||
maxValue: '',
|
||||
defaultValue: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
collection: '',
|
||||
collectionCycle: '',
|
||||
reportingCycle: '',
|
||||
reportingMethod: '',
|
||||
reportingCode: ''
|
||||
},
|
||||
dataRule: {
|
||||
plcConId: [
|
||||
{ required: true, message: 'plc连接表ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '类型:status、data、constant不能为空', trigger: 'blur' }
|
||||
],
|
||||
paramCode: [
|
||||
{ required: true, message: '参数编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
paramName: [
|
||||
{ required: true, message: '参数名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
paramAddress: [
|
||||
{ required: true, message: '参数地址,对应实时数据库表的列名不能为空', trigger: 'blur' }
|
||||
],
|
||||
valueType: [
|
||||
{ required: true, message: '参数值类型:int、long、boolean、string、list 暂不使用不能为空', trigger: 'blur' }
|
||||
],
|
||||
unitDictValue: [
|
||||
{ required: true, message: '单位 关联数据字典表label_value不能为空', trigger: 'blur' }
|
||||
],
|
||||
minValue: [
|
||||
{ required: true, message: '最小值不能为空', trigger: 'blur' }
|
||||
],
|
||||
maxValue: [
|
||||
{ required: true, message: '最大值不能为空', trigger: 'blur' }
|
||||
],
|
||||
defaultValue: [
|
||||
{ required: true, message: '参数设定标准值不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
collection: [
|
||||
{ required: true, message: '0 代表不采集, 1 代表采集不能为空', trigger: 'blur' }
|
||||
],
|
||||
collectionCycle: [
|
||||
{ required: true, message: '采集周期(s) 暂不使用不能为空', trigger: 'blur' }
|
||||
],
|
||||
reportingCycle: [
|
||||
{ required: true, message: '上报周期(s) 暂不使用不能为空', trigger: 'blur' }
|
||||
],
|
||||
reportingMethod: [
|
||||
{ required: true, message: '上报方式 暂不使用不能为空', trigger: 'blur' }
|
||||
],
|
||||
reportingCode: [
|
||||
{ required: true, message: '上报编码 暂不使用不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplcparam/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.plcConId = data.equipmenplcParam.plcConId
|
||||
this.dataForm.type = data.equipmenplcParam.type
|
||||
this.dataForm.paramCode = data.equipmenplcParam.paramCode
|
||||
this.dataForm.paramName = data.equipmenplcParam.paramName
|
||||
this.dataForm.paramAddress = data.equipmenplcParam.paramAddress
|
||||
this.dataForm.valueType = data.equipmenplcParam.valueType
|
||||
this.dataForm.unitDictValue = data.equipmenplcParam.unitDictValue
|
||||
this.dataForm.minValue = data.equipmenplcParam.minValue
|
||||
this.dataForm.maxValue = data.equipmenplcParam.maxValue
|
||||
this.dataForm.defaultValue = data.equipmenplcParam.defaultValue
|
||||
this.dataForm.description = data.equipmenplcParam.description
|
||||
this.dataForm.enabled = data.equipmenplcParam.enabled
|
||||
this.dataForm.remark = data.equipmenplcParam.remark
|
||||
this.dataForm.valid = data.equipmenplcParam.valid
|
||||
this.dataForm.creatorId = data.equipmenplcParam.creatorId
|
||||
this.dataForm.creatorName = data.equipmenplcParam.creatorName
|
||||
this.dataForm.createTime = data.equipmenplcParam.createTime
|
||||
this.dataForm.updaterId = data.equipmenplcParam.updaterId
|
||||
this.dataForm.updaterName = data.equipmenplcParam.updaterName
|
||||
this.dataForm.updateTime = data.equipmenplcParam.updateTime
|
||||
this.dataForm.version = data.equipmenplcParam.version
|
||||
this.dataForm.collection = data.equipmenplcParam.collection
|
||||
this.dataForm.collectionCycle = data.equipmenplcParam.collectionCycle
|
||||
this.dataForm.reportingCycle = data.equipmenplcParam.reportingCycle
|
||||
this.dataForm.reportingMethod = data.equipmenplcParam.reportingMethod
|
||||
this.dataForm.reportingCode = data.equipmenplcParam.reportingCode
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplcparam/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'plcConId': this.dataForm.plcConId,
|
||||
'type': this.dataForm.type,
|
||||
'paramCode': this.dataForm.paramCode,
|
||||
'paramName': this.dataForm.paramName,
|
||||
'paramAddress': this.dataForm.paramAddress,
|
||||
'valueType': this.dataForm.valueType,
|
||||
'unitDictValue': this.dataForm.unitDictValue,
|
||||
'minValue': this.dataForm.minValue,
|
||||
'maxValue': this.dataForm.maxValue,
|
||||
'defaultValue': this.dataForm.defaultValue,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'collection': this.dataForm.collection,
|
||||
'collectionCycle': this.dataForm.collectionCycle,
|
||||
'reportingCycle': this.dataForm.reportingCycle,
|
||||
'reportingMethod': this.dataForm.reportingMethod,
|
||||
'reportingCode': this.dataForm.reportingCode
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
228
src/views/modules/code/equipmenquantity-add-or-update.vue
Normal file
228
src/views/modules/code/equipmenquantity-add-or-update.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备外部编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<el-input v-model="dataForm.equipmentName" placeholder="设备名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="进入设备的数量" prop="inQuantity">
|
||||
<el-input v-model="dataForm.inQuantity" placeholder="进入设备的数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="离开设备的数量,若plc只记录一个生产数量,也写入该字段" prop="outQuantity">
|
||||
<el-input v-model="dataForm.outQuantity" placeholder="离开设备的数量,若plc只记录一个生产数量,也写入该字段"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="okQuantity">
|
||||
<el-input v-model="dataForm.okQuantity" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
|
||||
<el-input v-model="dataForm.nokQuantity" placeholder="设备上报的报废数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产数量的记录时间" prop="recordTime">
|
||||
<el-input v-model="dataForm.recordTime" placeholder="生产数量的记录时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
externalCode: '',
|
||||
equipmentName: '',
|
||||
inQuantity: '',
|
||||
outQuantity: '',
|
||||
okQuantity: '',
|
||||
nokQuantity: '',
|
||||
description: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
recordTime: ''
|
||||
},
|
||||
dataRule: {
|
||||
externalCode: [
|
||||
{ required: true, message: '设备外部编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentName: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inQuantity: [
|
||||
{ required: true, message: '进入设备的数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
outQuantity: [
|
||||
{ required: true, message: '离开设备的数量,若plc只记录一个生产数量,也写入该字段不能为空', trigger: 'blur' }
|
||||
],
|
||||
okQuantity: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
nokQuantity: [
|
||||
{ required: true, message: '设备上报的报废数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
recordTime: [
|
||||
{ required: true, message: '生产数量的记录时间不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenquantity/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.externalCode = data.equipmenquantity.externalCode
|
||||
this.dataForm.equipmentName = data.equipmenquantity.equipmentName
|
||||
this.dataForm.inQuantity = data.equipmenquantity.inQuantity
|
||||
this.dataForm.outQuantity = data.equipmenquantity.outQuantity
|
||||
this.dataForm.okQuantity = data.equipmenquantity.okQuantity
|
||||
this.dataForm.nokQuantity = data.equipmenquantity.nokQuantity
|
||||
this.dataForm.description = data.equipmenquantity.description
|
||||
this.dataForm.remark = data.equipmenquantity.remark
|
||||
this.dataForm.valid = data.equipmenquantity.valid
|
||||
this.dataForm.creatorId = data.equipmenquantity.creatorId
|
||||
this.dataForm.creatorName = data.equipmenquantity.creatorName
|
||||
this.dataForm.createTime = data.equipmenquantity.createTime
|
||||
this.dataForm.updaterId = data.equipmenquantity.updaterId
|
||||
this.dataForm.updaterName = data.equipmenquantity.updaterName
|
||||
this.dataForm.updateTime = data.equipmenquantity.updateTime
|
||||
this.dataForm.version = data.equipmenquantity.version
|
||||
this.dataForm.recordTime = data.equipmenquantity.recordTime
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenquantity/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'equipmentName': this.dataForm.equipmentName,
|
||||
'inQuantity': this.dataForm.inQuantity,
|
||||
'outQuantity': this.dataForm.outQuantity,
|
||||
'okQuantity': this.dataForm.okQuantity,
|
||||
'nokQuantity': this.dataForm.nokQuantity,
|
||||
'description': this.dataForm.description,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'recordTime': this.dataForm.recordTime
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
219
src/views/modules/code/equipmenstatuslog-add-or-update.vue
Normal file
219
src/views/modules/code/equipmenstatuslog-add-or-update.vue
Normal file
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备外部代码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="设备外部代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="plc id" prop="plcId">
|
||||
<el-input v-model="dataForm.plcId" placeholder="plc id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="plc" prop="plc">
|
||||
<el-input v-model="dataForm.plc" placeholder="plc"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备id" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<el-input v-model="dataForm.equipmentName" placeholder="设备名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态,0正常 1计划停机 2故障" prop="status">
|
||||
<el-input v-model="dataForm.status" placeholder="状态,0正常 1计划停机 2故障"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="记录时间" prop="logTime">
|
||||
<el-input v-model="dataForm.logTime" placeholder="记录时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
externalCode: '',
|
||||
plcId: '',
|
||||
plc: '',
|
||||
equipmentId: '',
|
||||
equipmentName: '',
|
||||
status: '',
|
||||
logTime: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
externalCode: [
|
||||
{ required: true, message: '设备外部代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
plcId: [
|
||||
{ required: true, message: 'plc id不能为空', trigger: 'blur' }
|
||||
],
|
||||
plc: [
|
||||
{ required: true, message: 'plc不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备id不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentName: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '状态,0正常 1计划停机 2故障不能为空', trigger: 'blur' }
|
||||
],
|
||||
logTime: [
|
||||
{ required: true, message: '记录时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenstatuslog/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.externalCode = data.equipmenstatusLog.externalCode
|
||||
this.dataForm.plcId = data.equipmenstatusLog.plcId
|
||||
this.dataForm.plc = data.equipmenstatusLog.plc
|
||||
this.dataForm.equipmentId = data.equipmenstatusLog.equipmentId
|
||||
this.dataForm.equipmentName = data.equipmenstatusLog.equipmentName
|
||||
this.dataForm.status = data.equipmenstatusLog.status
|
||||
this.dataForm.logTime = data.equipmenstatusLog.logTime
|
||||
this.dataForm.remark = data.equipmenstatusLog.remark
|
||||
this.dataForm.valid = data.equipmenstatusLog.valid
|
||||
this.dataForm.creatorId = data.equipmenstatusLog.creatorId
|
||||
this.dataForm.creatorName = data.equipmenstatusLog.creatorName
|
||||
this.dataForm.createTime = data.equipmenstatusLog.createTime
|
||||
this.dataForm.updaterId = data.equipmenstatusLog.updaterId
|
||||
this.dataForm.updaterName = data.equipmenstatusLog.updaterName
|
||||
this.dataForm.updateTime = data.equipmenstatusLog.updateTime
|
||||
this.dataForm.version = data.equipmenstatusLog.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenstatuslog/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'plcId': this.dataForm.plcId,
|
||||
'plc': this.dataForm.plc,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'equipmentName': this.dataForm.equipmentName,
|
||||
'status': this.dataForm.status,
|
||||
'logTime': this.dataForm.logTime,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
309
src/views/modules/code/equipment-add-or-update.vue
Normal file
309
src/views/modules/code/equipment-add-or-update.vue
Normal file
@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="设备名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="英文名称" prop="enName">
|
||||
<el-input v-model="dataForm.enName" placeholder="英文名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="缩写" prop="abbr">
|
||||
<el-input v-model="dataForm.abbr" placeholder="缩写"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="进厂日期" prop="enterTime">
|
||||
<el-input v-model="dataForm.enterTime" placeholder="进厂日期"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产日期" prop="productionTime">
|
||||
<el-input v-model="dataForm.productionTime" placeholder="生产日期"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型,关联设备类型表" prop="equipmentTypeId">
|
||||
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型,关联设备类型表"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分组id (关联 T_EQUIPMENT_GROUP)" prop="groupId">
|
||||
<el-input v-model="dataForm.groupId" placeholder="分组id (关联 T_EQUIPMENT_GROUP)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="0:无类别,1:上片数据设备,2:下片数据设备" prop="dataType">
|
||||
<el-input v-model="dataForm.dataType" placeholder="0:无类别,1:上片数据设备,2:下片数据设备"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="每小时生产数量" prop="tvalue">
|
||||
<el-input v-model="dataForm.tvalue" placeholder="每小时生产数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单件加工时间 s/件" prop="processingTime">
|
||||
<el-input v-model="dataForm.processingTime" placeholder="单件加工时间 s/件"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="制造商" prop="manufacturer">
|
||||
<el-input v-model="dataForm.manufacturer" placeholder="制造商"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input v-model="dataForm.spec" placeholder="规格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="功能描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="功能描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部系统代码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部系统代码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计" prop="externalCodeStatis">
|
||||
<el-input v-model="dataForm.externalCodeStatis" placeholder="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
enName: '',
|
||||
abbr: '',
|
||||
enterTime: '',
|
||||
productionTime: '',
|
||||
equipmentTypeId: '',
|
||||
groupId: '',
|
||||
dataType: '',
|
||||
tvalue: '',
|
||||
processingTime: '',
|
||||
manufacturer: '',
|
||||
spec: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
externalCode: '',
|
||||
externalCodeStatis: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
enName: [
|
||||
{ required: true, message: '英文名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
abbr: [
|
||||
{ required: true, message: '缩写不能为空', trigger: 'blur' }
|
||||
],
|
||||
enterTime: [
|
||||
{ required: true, message: '进厂日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
productionTime: [
|
||||
{ required: true, message: '生产日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentTypeId: [
|
||||
{ required: true, message: '设备类型,关联设备类型表不能为空', trigger: 'blur' }
|
||||
],
|
||||
groupId: [
|
||||
{ required: true, message: '分组id (关联 T_EQUIPMENT_GROUP)不能为空', trigger: 'blur' }
|
||||
],
|
||||
dataType: [
|
||||
{ required: true, message: '0:无类别,1:上片数据设备,2:下片数据设备不能为空', trigger: 'blur' }
|
||||
],
|
||||
tvalue: [
|
||||
{ required: true, message: '每小时生产数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
processingTime: [
|
||||
{ required: true, message: '单件加工时间 s/件不能为空', trigger: 'blur' }
|
||||
],
|
||||
manufacturer: [
|
||||
{ required: true, message: '制造商不能为空', trigger: 'blur' }
|
||||
],
|
||||
spec: [
|
||||
{ required: true, message: '规格不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '功能描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部系统代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCodeStatis: [
|
||||
{ required: true, message: '统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipment/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.equipment.code
|
||||
this.dataForm.name = data.equipment.name
|
||||
this.dataForm.enName = data.equipment.enName
|
||||
this.dataForm.abbr = data.equipment.abbr
|
||||
this.dataForm.enterTime = data.equipment.enterTime
|
||||
this.dataForm.productionTime = data.equipment.productionTime
|
||||
this.dataForm.equipmentTypeId = data.equipment.equipmentTypeId
|
||||
this.dataForm.groupId = data.equipment.groupId
|
||||
this.dataForm.dataType = data.equipment.dataType
|
||||
this.dataForm.tvalue = data.equipment.tvalue
|
||||
this.dataForm.processingTime = data.equipment.processingTime
|
||||
this.dataForm.manufacturer = data.equipment.manufacturer
|
||||
this.dataForm.spec = data.equipment.spec
|
||||
this.dataForm.description = data.equipment.description
|
||||
this.dataForm.enabled = data.equipment.enabled
|
||||
this.dataForm.remark = data.equipment.remark
|
||||
this.dataForm.valid = data.equipment.valid
|
||||
this.dataForm.creatorId = data.equipment.creatorId
|
||||
this.dataForm.creatorName = data.equipment.creatorName
|
||||
this.dataForm.createTime = data.equipment.createTime
|
||||
this.dataForm.updaterId = data.equipment.updaterId
|
||||
this.dataForm.updaterName = data.equipment.updaterName
|
||||
this.dataForm.updateTime = data.equipment.updateTime
|
||||
this.dataForm.version = data.equipment.version
|
||||
this.dataForm.externalCode = data.equipment.externalCode
|
||||
this.dataForm.externalCodeStatis = data.equipment.externalCodeStatis
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipment/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'enName': this.dataForm.enName,
|
||||
'abbr': this.dataForm.abbr,
|
||||
'enterTime': this.dataForm.enterTime,
|
||||
'productionTime': this.dataForm.productionTime,
|
||||
'equipmentTypeId': this.dataForm.equipmentTypeId,
|
||||
'groupId': this.dataForm.groupId,
|
||||
'dataType': this.dataForm.dataType,
|
||||
'tvalue': this.dataForm.tvalue,
|
||||
'processingTime': this.dataForm.processingTime,
|
||||
'manufacturer': this.dataForm.manufacturer,
|
||||
'spec': this.dataForm.spec,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'externalCodeStatis': this.dataForm.externalCodeStatis
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
317
src/views/modules/code/equipment.vue
Normal file
317
src/views/modules/code/equipment.vue
Normal file
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipment:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="英文名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="abbr"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="缩写">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enterTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="进厂日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productionTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="生产日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentTypeId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备类型,关联设备类型表">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="groupId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="分组id (关联 T_EQUIPMENT_GROUP)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="dataType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="0:无类别,1:上片数据设备,2:下片数据设备">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="tvalue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="每小时生产数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="processingTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="单件加工时间 s/件">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="manufacturer"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="制造商">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="spec"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="规格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="功能描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部系统代码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCodeStatis"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipment-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
console.log('activated')
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
isAuth(key) {
|
||||
return this.$hasPermission(key)
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipment/page'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipment/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
235
src/views/modules/code/equipmentAlarmLog.vue
Normal file
235
src/views/modules/code/equipmentAlarmLog.vue
Normal file
@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenalarmlog:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenalarmlog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警信息ID,关联T_equipment_group_alarm表">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmSource"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警来源">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmContent"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警详细内容">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmEquipmentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警设备id 关联equipment表">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenalarmlog-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenalarmlog/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenalarmlog/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
265
src/views/modules/code/equipmentGroupAlarm.vue
Normal file
265
src/views/modules/code/equipmentGroupAlarm.vue
Normal file
@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmengroupalarm:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmengroupalarm:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentGroupId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备分组ID,关联t_equipment_group">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeDictValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警类型 字典表关联label_value">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="gradeDictValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警级别 字典表关联label_value">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmContent"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报警内容">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部编码,用于对照外部系统的编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmNotify"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="推送方式 0邮箱 1微信">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmengroupalarm-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmengroupalarm/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmengroupalarm/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
283
src/views/modules/code/equipmentPlc.vue
Normal file
283
src/views/modules/code/equipmentPlc.vue
Normal file
@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenplc:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenplc:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="plcType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc名称(ip+名称对应实时数据库表名)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="英文名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="barcode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc条码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="controlType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="链接方式,0 tcp,1 udp等">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="monitor"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="是否监控 0 代表不监控, 1 代表监控">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="collection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="是否采集 0 代表不采集, 1 代表采集">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="ip"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="IP">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="port"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="端口号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenplc-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenplc/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenplc/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
229
src/views/modules/code/equipmentPlcConnect.vue
Normal file
229
src/views/modules/code/equipmentPlcConnect.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenplcconnect:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenplcconnect:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="plcId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc表iD">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备表id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenplcconnect-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenplcconnect/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenplcconnect/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
313
src/views/modules/code/equipmentPlcParam.vue
Normal file
313
src/views/modules/code/equipmentPlcParam.vue
Normal file
@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenplcparam:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenplcparam:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="plcConId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc连接表ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="类型:status、data、constant">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="paramCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="参数编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="paramName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="参数名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="paramAddress"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="参数地址,对应实时数据库表的列名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valueType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="参数值类型:int、long、boolean、string、list 暂不使用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="unitDictValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="单位 关联数据字典表label_value">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="minValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="最小值">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="maxValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="最大值">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="defaultValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="参数设定标准值">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="collection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="0 代表不采集, 1 代表采集">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="collectionCycle"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="采集周期(s) 暂不使用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reportingCycle"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="上报周期(s) 暂不使用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reportingMethod"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="上报方式 暂不使用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reportingCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="上报编码 暂不使用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenplcparam-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenplcparam/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenplcparam/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
259
src/views/modules/code/equipmentQuantity.vue
Normal file
259
src/views/modules/code/equipmentQuantity.vue
Normal file
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenquantity:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenquantity:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备外部编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inQuantity"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="进入设备的数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="outQuantity"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="离开设备的数量,若plc只记录一个生产数量,也写入该字段">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="okQuantity"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="nokQuantity"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备上报的报废数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="recordTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="生产数量的记录时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenquantity-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenquantity/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenquantity/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
253
src/views/modules/code/equipmentStatusLog.vue
Normal file
253
src/views/modules/code/equipmentStatusLog.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenstatuslog:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmenstatuslog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备外部代码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="plcId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="plc"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="plc">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="状态,0正常 1计划停机 2故障">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="logTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="记录时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmenstatuslog-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenstatuslog/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmenstatuslog/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
247
src/views/modules/code/equipmentType.vue
Normal file
247
src/views/modules/code/equipmentType.vue
Normal file
@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmentype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmentype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="parentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="父类ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="parentName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="父类名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmentype-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentype/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentype/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
253
src/views/modules/code/equipmentTypeFile.vue
Normal file
253
src/views/modules/code/equipmentTypeFile.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmentypefile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:equipmentypefile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentTypeId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备类型ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件类型编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileUrl"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="下载地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmentypefile-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentypefile/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentypefile/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
210
src/views/modules/code/equipmentype-add-or-update.vue
Normal file
210
src/views/modules/code/equipmentype-add-or-update.vue
Normal file
@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="父类ID" prop="parentId">
|
||||
<el-input v-model="dataForm.parentId" placeholder="父类ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="父类名称" prop="parentName">
|
||||
<el-input v-model="dataForm.parentName" placeholder="父类名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
parentId: '',
|
||||
parentName: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
parentId: [
|
||||
{ required: true, message: '父类ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
parentName: [
|
||||
{ required: true, message: '父类名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmentype/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.equipmentype.code
|
||||
this.dataForm.name = data.equipmentype.name
|
||||
this.dataForm.parentId = data.equipmentype.parentId
|
||||
this.dataForm.parentName = data.equipmentype.parentName
|
||||
this.dataForm.description = data.equipmentype.description
|
||||
this.dataForm.enabled = data.equipmentype.enabled
|
||||
this.dataForm.remark = data.equipmentype.remark
|
||||
this.dataForm.valid = data.equipmentype.valid
|
||||
this.dataForm.creatorId = data.equipmentype.creatorId
|
||||
this.dataForm.creatorName = data.equipmentype.creatorName
|
||||
this.dataForm.createTime = data.equipmentype.createTime
|
||||
this.dataForm.updaterId = data.equipmentype.updaterId
|
||||
this.dataForm.updaterName = data.equipmentype.updaterName
|
||||
this.dataForm.updateTime = data.equipmentype.updateTime
|
||||
this.dataForm.version = data.equipmentype.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmentype/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'parentId': this.dataForm.parentId,
|
||||
'parentName': this.dataForm.parentName,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
219
src/views/modules/code/equipmentypefile-add-or-update.vue
Normal file
219
src/views/modules/code/equipmentypefile-add-or-update.vue
Normal file
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备类型ID" prop="equipmentTypeId">
|
||||
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件ID" prop="fileId">
|
||||
<el-input v-model="dataForm.fileId" placeholder="文件ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型编码" prop="typeCode">
|
||||
<el-input v-model="dataForm.typeCode" placeholder="文件类型编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="下载地址" prop="fileUrl">
|
||||
<el-input v-model="dataForm.fileUrl" placeholder="下载地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
equipmentTypeId: '',
|
||||
fileId: '',
|
||||
typeCode: '',
|
||||
fileName: '',
|
||||
fileUrl: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
equipmentTypeId: [
|
||||
{ required: true, message: '设备类型ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileId: [
|
||||
{ required: true, message: '文件ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
typeCode: [
|
||||
{ required: true, message: '文件类型编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileName: [
|
||||
{ required: true, message: '文件名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileUrl: [
|
||||
{ required: true, message: '下载地址不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmentypefile/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.equipmentTypeId = data.equipmentypeFile.equipmentTypeId
|
||||
this.dataForm.fileId = data.equipmentypeFile.fileId
|
||||
this.dataForm.typeCode = data.equipmentypeFile.typeCode
|
||||
this.dataForm.fileName = data.equipmentypeFile.fileName
|
||||
this.dataForm.fileUrl = data.equipmentypeFile.fileUrl
|
||||
this.dataForm.description = data.equipmentypeFile.description
|
||||
this.dataForm.enabled = data.equipmentypeFile.enabled
|
||||
this.dataForm.remark = data.equipmentypeFile.remark
|
||||
this.dataForm.valid = data.equipmentypeFile.valid
|
||||
this.dataForm.creatorId = data.equipmentypeFile.creatorId
|
||||
this.dataForm.creatorName = data.equipmentypeFile.creatorName
|
||||
this.dataForm.createTime = data.equipmentypeFile.createTime
|
||||
this.dataForm.updaterId = data.equipmentypeFile.updaterId
|
||||
this.dataForm.updaterName = data.equipmentypeFile.updaterName
|
||||
this.dataForm.updateTime = data.equipmentypeFile.updateTime
|
||||
this.dataForm.version = data.equipmentypeFile.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmentypefile/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'equipmentTypeId': this.dataForm.equipmentTypeId,
|
||||
'fileId': this.dataForm.fileId,
|
||||
'typeCode': this.dataForm.typeCode,
|
||||
'fileName': this.dataForm.fileName,
|
||||
'fileUrl': this.dataForm.fileUrl,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
210
src/views/modules/code/factory-add-or-update.vue
Normal file
210
src/views/modules/code/factory-add-or-update.vue
Normal file
@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="工厂编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="工厂编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工厂名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="工厂名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="dataForm.address" placeholder="地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部系统编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
address: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
externalCode: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '工厂编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '工厂名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
address: [
|
||||
{ required: true, message: '地址不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部系统编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/factory/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.factory.code
|
||||
this.dataForm.name = data.factory.name
|
||||
this.dataForm.address = data.factory.address
|
||||
this.dataForm.description = data.factory.description
|
||||
this.dataForm.enabled = data.factory.enabled
|
||||
this.dataForm.remark = data.factory.remark
|
||||
this.dataForm.valid = data.factory.valid
|
||||
this.dataForm.creatorId = data.factory.creatorId
|
||||
this.dataForm.creatorName = data.factory.creatorName
|
||||
this.dataForm.createTime = data.factory.createTime
|
||||
this.dataForm.updaterId = data.factory.updaterId
|
||||
this.dataForm.updaterName = data.factory.updaterName
|
||||
this.dataForm.updateTime = data.factory.updateTime
|
||||
this.dataForm.version = data.factory.version
|
||||
this.dataForm.externalCode = data.factory.externalCode
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/factory/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'address': this.dataForm.address,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'externalCode': this.dataForm.externalCode
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
247
src/views/modules/code/factory.vue
Normal file
247
src/views/modules/code/factory.vue
Normal file
@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:factory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:factory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="工厂编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="工厂名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部系统编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './factory-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/factory/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/factory/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
253
src/views/modules/code/producArrt.vue
Normal file
253
src/views/modules/code/producArrt.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:producarrt:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:producarrt:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="产品id,关联产品表">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="value"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="属性值">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部编码,用于对照外部系统的编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './producarrt-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/producarrt/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/producarrt/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
219
src/views/modules/code/producarrt-add-or-update.vue
Normal file
219
src/views/modules/code/producarrt-add-or-update.vue
Normal file
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品id,关联产品表" prop="productId">
|
||||
<el-input v-model="dataForm.productId" placeholder="产品id,关联产品表"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值" prop="value">
|
||||
<el-input v-model="dataForm.value" placeholder="属性值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
productId: '',
|
||||
value: '',
|
||||
description: '',
|
||||
externalCode: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
productId: [
|
||||
{ required: true, message: '产品id,关联产品表不能为空', trigger: 'blur' }
|
||||
],
|
||||
value: [
|
||||
{ required: true, message: '属性值不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/producarrt/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.producarrt.code
|
||||
this.dataForm.name = data.producarrt.name
|
||||
this.dataForm.productId = data.producarrt.productId
|
||||
this.dataForm.value = data.producarrt.value
|
||||
this.dataForm.description = data.producarrt.description
|
||||
this.dataForm.externalCode = data.producarrt.externalCode
|
||||
this.dataForm.enabled = data.producarrt.enabled
|
||||
this.dataForm.remark = data.producarrt.remark
|
||||
this.dataForm.valid = data.producarrt.valid
|
||||
this.dataForm.creatorId = data.producarrt.creatorId
|
||||
this.dataForm.creatorName = data.producarrt.creatorName
|
||||
this.dataForm.createTime = data.producarrt.createTime
|
||||
this.dataForm.updaterId = data.producarrt.updaterId
|
||||
this.dataForm.updaterName = data.producarrt.updaterName
|
||||
this.dataForm.updateTime = data.producarrt.updateTime
|
||||
this.dataForm.version = data.producarrt.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/producarrt/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'productId': this.dataForm.productId,
|
||||
'value': this.dataForm.value,
|
||||
'description': this.dataForm.description,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
246
src/views/modules/code/product-add-or-update.vue
Normal file
246
src/views/modules/code/product-add-or-update.vue
Normal file
@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="specifications">
|
||||
<el-input v-model="dataForm.specifications" placeholder="规格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位value,对应到数据字典label_value" prop="unitDictValue">
|
||||
<el-input v-model="dataForm.unitDictValue" placeholder="单位value,对应到数据字典label_value"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="一单位的面积(平方米)" prop="area">
|
||||
<el-input v-model="dataForm.area" placeholder="一单位的面积(平方米)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="加工一单位产品需要的时间" prop="processTime">
|
||||
<el-input v-model="dataForm.processTime" placeholder="加工一单位产品需要的时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品类型value,对应到数据字典label_value" prop="typeDictValue">
|
||||
<el-input v-model="dataForm.typeDictValue" placeholder="产品类型value,对应到数据字典label_value"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
description: '',
|
||||
externalCode: '',
|
||||
specifications: '',
|
||||
unitDictValue: '',
|
||||
area: '',
|
||||
processTime: '',
|
||||
typeDictValue: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
specifications: [
|
||||
{ required: true, message: '规格不能为空', trigger: 'blur' }
|
||||
],
|
||||
unitDictValue: [
|
||||
{ required: true, message: '单位value,对应到数据字典label_value不能为空', trigger: 'blur' }
|
||||
],
|
||||
area: [
|
||||
{ required: true, message: '一单位的面积(平方米)不能为空', trigger: 'blur' }
|
||||
],
|
||||
processTime: [
|
||||
{ required: true, message: '加工一单位产品需要的时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
typeDictValue: [
|
||||
{ required: true, message: '产品类型value,对应到数据字典label_value不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/product/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.product.code
|
||||
this.dataForm.name = data.product.name
|
||||
this.dataForm.description = data.product.description
|
||||
this.dataForm.externalCode = data.product.externalCode
|
||||
this.dataForm.specifications = data.product.specifications
|
||||
this.dataForm.unitDictValue = data.product.unitDictValue
|
||||
this.dataForm.area = data.product.area
|
||||
this.dataForm.processTime = data.product.processTime
|
||||
this.dataForm.typeDictValue = data.product.typeDictValue
|
||||
this.dataForm.enabled = data.product.enabled
|
||||
this.dataForm.remark = data.product.remark
|
||||
this.dataForm.valid = data.product.valid
|
||||
this.dataForm.creatorId = data.product.creatorId
|
||||
this.dataForm.creatorName = data.product.creatorName
|
||||
this.dataForm.createTime = data.product.createTime
|
||||
this.dataForm.updaterId = data.product.updaterId
|
||||
this.dataForm.updaterName = data.product.updaterName
|
||||
this.dataForm.updateTime = data.product.updateTime
|
||||
this.dataForm.version = data.product.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/product/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'description': this.dataForm.description,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'specifications': this.dataForm.specifications,
|
||||
'unitDictValue': this.dataForm.unitDictValue,
|
||||
'area': this.dataForm.area,
|
||||
'processTime': this.dataForm.processTime,
|
||||
'typeDictValue': this.dataForm.typeDictValue,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
271
src/views/modules/code/product.vue
Normal file
271
src/views/modules/code/product.vue
Normal file
@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:product:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:product:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部编码,用于对照外部系统的编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="specifications"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="规格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="unitDictValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="单位value,对应到数据字典label_value">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="area"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="一单位的面积(平方米)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="processTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="加工一单位产品需要的时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeDictValue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="产品类型value,对应到数据字典label_value">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './product-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/product/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/product/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
259
src/views/modules/code/productionLine.vue
Normal file
259
src/views/modules/code/productionLine.vue
Normal file
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:productionline:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:productionline:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="factoryId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="工厂表ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="产线状态">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="tvalue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="每小时下片数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部系统编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './productionline-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/productionline/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/productionline/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
199
src/views/modules/code/productionLineRecSch.vue
Normal file
199
src/views/modules/code/productionLineRecSch.vue
Normal file
@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:productionlinerecsch:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:productionlinerecsch:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productionLineId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="产线id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inputNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="上一次记录时间至该条记录时间端内上片数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="outputNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="上一次记录时间至该条记录时间端内下片数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="recordTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="记录时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sumInputNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="该记录时间点的累计上片数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sumOutputNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="该记录时间点的累计下片数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './productionlinerecsch-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/productionlinerecsch/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/productionlinerecsch/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
228
src/views/modules/code/productionline-add-or-update.vue
Normal file
228
src/views/modules/code/productionline-add-or-update.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="工厂表ID" prop="factoryId">
|
||||
<el-input v-model="dataForm.factoryId" placeholder="工厂表ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产线状态" prop="status">
|
||||
<el-input v-model="dataForm.status" placeholder="产线状态"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="每小时下片数量" prop="tvalue">
|
||||
<el-input v-model="dataForm.tvalue" placeholder="每小时下片数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部系统编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
factoryId: '',
|
||||
code: '',
|
||||
name: '',
|
||||
description: '',
|
||||
status: '',
|
||||
tvalue: '',
|
||||
externalCode: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
factoryId: [
|
||||
{ required: true, message: '工厂表ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '产线状态不能为空', trigger: 'blur' }
|
||||
],
|
||||
tvalue: [
|
||||
{ required: true, message: '每小时下片数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部系统编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/productionline/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.factoryId = data.productionLine.factoryId
|
||||
this.dataForm.code = data.productionLine.code
|
||||
this.dataForm.name = data.productionLine.name
|
||||
this.dataForm.description = data.productionLine.description
|
||||
this.dataForm.status = data.productionLine.status
|
||||
this.dataForm.tvalue = data.productionLine.tvalue
|
||||
this.dataForm.externalCode = data.productionLine.externalCode
|
||||
this.dataForm.enabled = data.productionLine.enabled
|
||||
this.dataForm.remark = data.productionLine.remark
|
||||
this.dataForm.valid = data.productionLine.valid
|
||||
this.dataForm.creatorId = data.productionLine.creatorId
|
||||
this.dataForm.creatorName = data.productionLine.creatorName
|
||||
this.dataForm.createTime = data.productionLine.createTime
|
||||
this.dataForm.updaterId = data.productionLine.updaterId
|
||||
this.dataForm.updaterName = data.productionLine.updaterName
|
||||
this.dataForm.updateTime = data.productionLine.updateTime
|
||||
this.dataForm.version = data.productionLine.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/productionline/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'factoryId': this.dataForm.factoryId,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'description': this.dataForm.description,
|
||||
'status': this.dataForm.status,
|
||||
'tvalue': this.dataForm.tvalue,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
138
src/views/modules/code/productionlinerecsch-add-or-update.vue
Normal file
138
src/views/modules/code/productionlinerecsch-add-or-update.vue
Normal file
@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="产线id" prop="productionLineId">
|
||||
<el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum">
|
||||
<el-input v-model="dataForm.inputNum" placeholder="上一次记录时间至该条记录时间端内上片数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum">
|
||||
<el-input v-model="dataForm.outputNum" placeholder="上一次记录时间至该条记录时间端内下片数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="记录时间" prop="recordTime">
|
||||
<el-input v-model="dataForm.recordTime" placeholder="记录时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
|
||||
<el-input v-model="dataForm.sumInputNum" placeholder="该记录时间点的累计上片数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
|
||||
<el-input v-model="dataForm.sumOutputNum" placeholder="该记录时间点的累计下片数量"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
productionLineId: '',
|
||||
inputNum: '',
|
||||
outputNum: '',
|
||||
recordTime: '',
|
||||
valid: '',
|
||||
sumInputNum: '',
|
||||
sumOutputNum: ''
|
||||
},
|
||||
dataRule: {
|
||||
productionLineId: [
|
||||
{ required: true, message: '产线id不能为空', trigger: 'blur' }
|
||||
],
|
||||
inputNum: [
|
||||
{ required: true, message: '上一次记录时间至该条记录时间端内上片数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
outputNum: [
|
||||
{ required: true, message: '上一次记录时间至该条记录时间端内下片数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
recordTime: [
|
||||
{ required: true, message: '记录时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
sumInputNum: [
|
||||
{ required: true, message: '该记录时间点的累计上片数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
sumOutputNum: [
|
||||
{ required: true, message: '该记录时间点的累计下片数量不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/productionlinerecsch/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.productionLineId = data.productionLineRecSch.productionLineId
|
||||
this.dataForm.inputNum = data.productionLineRecSch.inputNum
|
||||
this.dataForm.outputNum = data.productionLineRecSch.outputNum
|
||||
this.dataForm.recordTime = data.productionLineRecSch.recordTime
|
||||
this.dataForm.valid = data.productionLineRecSch.valid
|
||||
this.dataForm.sumInputNum = data.productionLineRecSch.sumInputNum
|
||||
this.dataForm.sumOutputNum = data.productionLineRecSch.sumOutputNum
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/productionlinerecsch/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'productionLineId': this.dataForm.productionLineId,
|
||||
'inputNum': this.dataForm.inputNum,
|
||||
'outputNum': this.dataForm.outputNum,
|
||||
'recordTime': this.dataForm.recordTime,
|
||||
'valid': this.dataForm.valid,
|
||||
'sumInputNum': this.dataForm.sumInputNum,
|
||||
'sumOutputNum': this.dataForm.sumOutputNum
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
229
src/views/modules/code/qualityInspectionDet.vue
Normal file
229
src/views/modules/code/qualityInspectionDet.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:qualityinspectiondet:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:qualityinspectiondet:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测类型id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测内容">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './qualityinspectiondet-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityinspectiondet/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityinspectiondet/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
259
src/views/modules/code/qualityInspectionRecord.vue
Normal file
259
src/views/modules/code/qualityInspectionRecord.vue
Normal file
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:qualityinspectionrecord:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:qualityinspectionrecord:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspectionDetId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测内容id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspectionDetContent"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测内容(设备推送消息时,可能无对应id,只填这个字段)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productionId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="产线id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sectionId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="工段id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="checkPerson"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测人员,可以多个">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="checkTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="source"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="来源 1,手动(默认) 2,自动">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="explainText"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './qualityinspectionrecord-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
223
src/views/modules/code/qualityInspectionType.vue
Normal file
223
src/views/modules/code/qualityInspectionType.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:qualityinspectiontype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:qualityinspectiontype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测类型名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="检测类型编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './qualityinspectiontype-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityinspectiontype/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityinspectiontype/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
183
src/views/modules/code/qualityinspectiondet-add-or-update.vue
Normal file
183
src/views/modules/code/qualityinspectiondet-add-or-update.vue
Normal file
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="检测类型id" prop="typeId">
|
||||
<el-input v-model="dataForm.typeId" placeholder="检测类型id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测内容" prop="content">
|
||||
<el-input v-model="dataForm.content" placeholder="检测内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="检测编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
typeId: '',
|
||||
content: '',
|
||||
code: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
typeId: [
|
||||
{ required: true, message: '检测类型id不能为空', trigger: 'blur' }
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: '检测内容不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '检测编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/qualityinspectiondet/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.typeId = data.qualityInspectionDet.typeId
|
||||
this.dataForm.content = data.qualityInspectionDet.content
|
||||
this.dataForm.code = data.qualityInspectionDet.code
|
||||
this.dataForm.remark = data.qualityInspectionDet.remark
|
||||
this.dataForm.valid = data.qualityInspectionDet.valid
|
||||
this.dataForm.creatorId = data.qualityInspectionDet.creatorId
|
||||
this.dataForm.creatorName = data.qualityInspectionDet.creatorName
|
||||
this.dataForm.createTime = data.qualityInspectionDet.createTime
|
||||
this.dataForm.updaterId = data.qualityInspectionDet.updaterId
|
||||
this.dataForm.updaterName = data.qualityInspectionDet.updaterName
|
||||
this.dataForm.updateTime = data.qualityInspectionDet.updateTime
|
||||
this.dataForm.version = data.qualityInspectionDet.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/qualityinspectiondet/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'typeId': this.dataForm.typeId,
|
||||
'content': this.dataForm.content,
|
||||
'code': this.dataForm.code,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
228
src/views/modules/code/qualityinspectionrecord-add-or-update.vue
Normal file
228
src/views/modules/code/qualityinspectionrecord-add-or-update.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="检测内容id" prop="inspectionDetId">
|
||||
<el-input v-model="dataForm.inspectionDetId" placeholder="检测内容id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测内容(设备推送消息时,可能无对应id,只填这个字段)" prop="inspectionDetContent">
|
||||
<el-input v-model="dataForm.inspectionDetContent" placeholder="检测内容(设备推送消息时,可能无对应id,只填这个字段)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产线id" prop="productionId">
|
||||
<el-input v-model="dataForm.productionId" placeholder="产线id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工段id" prop="sectionId">
|
||||
<el-input v-model="dataForm.sectionId" placeholder="工段id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测人员,可以多个" prop="checkPerson">
|
||||
<el-input v-model="dataForm.checkPerson" placeholder="检测人员,可以多个"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测时间" prop="checkTime">
|
||||
<el-input v-model="dataForm.checkTime" placeholder="检测时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源 1,手动(默认) 2,自动" prop="source">
|
||||
<el-input v-model="dataForm.source" placeholder="来源 1,手动(默认) 2,自动"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="explainText">
|
||||
<el-input v-model="dataForm.explainText" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
inspectionDetId: '',
|
||||
inspectionDetContent: '',
|
||||
productionId: '',
|
||||
sectionId: '',
|
||||
checkPerson: '',
|
||||
checkTime: '',
|
||||
source: '',
|
||||
explainText: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
inspectionDetId: [
|
||||
{ required: true, message: '检测内容id不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspectionDetContent: [
|
||||
{ required: true, message: '检测内容(设备推送消息时,可能无对应id,只填这个字段)不能为空', trigger: 'blur' }
|
||||
],
|
||||
productionId: [
|
||||
{ required: true, message: '产线id不能为空', trigger: 'blur' }
|
||||
],
|
||||
sectionId: [
|
||||
{ required: true, message: '工段id不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkPerson: [
|
||||
{ required: true, message: '检测人员,可以多个不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkTime: [
|
||||
{ required: true, message: '检测时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
source: [
|
||||
{ required: true, message: '来源 1,手动(默认) 2,自动不能为空', trigger: 'blur' }
|
||||
],
|
||||
explainText: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/qualityinspectionrecord/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.inspectionDetId = data.qualityInspectionRecord.inspectionDetId
|
||||
this.dataForm.inspectionDetContent = data.qualityInspectionRecord.inspectionDetContent
|
||||
this.dataForm.productionId = data.qualityInspectionRecord.productionId
|
||||
this.dataForm.sectionId = data.qualityInspectionRecord.sectionId
|
||||
this.dataForm.checkPerson = data.qualityInspectionRecord.checkPerson
|
||||
this.dataForm.checkTime = data.qualityInspectionRecord.checkTime
|
||||
this.dataForm.source = data.qualityInspectionRecord.source
|
||||
this.dataForm.explainText = data.qualityInspectionRecord.explainText
|
||||
this.dataForm.remark = data.qualityInspectionRecord.remark
|
||||
this.dataForm.valid = data.qualityInspectionRecord.valid
|
||||
this.dataForm.creatorId = data.qualityInspectionRecord.creatorId
|
||||
this.dataForm.creatorName = data.qualityInspectionRecord.creatorName
|
||||
this.dataForm.createTime = data.qualityInspectionRecord.createTime
|
||||
this.dataForm.updaterId = data.qualityInspectionRecord.updaterId
|
||||
this.dataForm.updaterName = data.qualityInspectionRecord.updaterName
|
||||
this.dataForm.updateTime = data.qualityInspectionRecord.updateTime
|
||||
this.dataForm.version = data.qualityInspectionRecord.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/qualityinspectionrecord/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'inspectionDetId': this.dataForm.inspectionDetId,
|
||||
'inspectionDetContent': this.dataForm.inspectionDetContent,
|
||||
'productionId': this.dataForm.productionId,
|
||||
'sectionId': this.dataForm.sectionId,
|
||||
'checkPerson': this.dataForm.checkPerson,
|
||||
'checkTime': this.dataForm.checkTime,
|
||||
'source': this.dataForm.source,
|
||||
'explainText': this.dataForm.explainText,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
174
src/views/modules/code/qualityinspectiontype-add-or-update.vue
Normal file
174
src/views/modules/code/qualityinspectiontype-add-or-update.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="检测类型名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="检测类型名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测类型编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="检测类型编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
name: '',
|
||||
code: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
name: [
|
||||
{ required: true, message: '检测类型名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '检测类型编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/qualityinspectiontype/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.name = data.qualityInspectionType.name
|
||||
this.dataForm.code = data.qualityInspectionType.code
|
||||
this.dataForm.remark = data.qualityInspectionType.remark
|
||||
this.dataForm.valid = data.qualityInspectionType.valid
|
||||
this.dataForm.creatorId = data.qualityInspectionType.creatorId
|
||||
this.dataForm.creatorName = data.qualityInspectionType.creatorName
|
||||
this.dataForm.createTime = data.qualityInspectionType.createTime
|
||||
this.dataForm.updaterId = data.qualityInspectionType.updaterId
|
||||
this.dataForm.updaterName = data.qualityInspectionType.updaterName
|
||||
this.dataForm.updateTime = data.qualityInspectionType.updateTime
|
||||
this.dataForm.version = data.qualityInspectionType.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/qualityinspectiontype/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'name': this.dataForm.name,
|
||||
'code': this.dataForm.code,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
201
src/views/modules/code/reporsheecategory-add-or-update.vue
Normal file
201
src/views/modules/code/reporsheecategory-add-or-update.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
code: '',
|
||||
name: '',
|
||||
description: '',
|
||||
externalCode: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/reporsheecategory/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.code = data.reporsheecategory.code
|
||||
this.dataForm.name = data.reporsheecategory.name
|
||||
this.dataForm.description = data.reporsheecategory.description
|
||||
this.dataForm.externalCode = data.reporsheecategory.externalCode
|
||||
this.dataForm.enabled = data.reporsheecategory.enabled
|
||||
this.dataForm.remark = data.reporsheecategory.remark
|
||||
this.dataForm.valid = data.reporsheecategory.valid
|
||||
this.dataForm.creatorId = data.reporsheecategory.creatorId
|
||||
this.dataForm.creatorName = data.reporsheecategory.creatorName
|
||||
this.dataForm.createTime = data.reporsheecategory.createTime
|
||||
this.dataForm.updaterId = data.reporsheecategory.updaterId
|
||||
this.dataForm.updaterName = data.reporsheecategory.updaterName
|
||||
this.dataForm.updateTime = data.reporsheecategory.updateTime
|
||||
this.dataForm.version = data.reporsheecategory.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/reporsheecategory/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'description': this.dataForm.description,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
228
src/views/modules/code/reporsheet-add-or-update.vue
Normal file
228
src/views/modules/code/reporsheet-add-or-update.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="分类:关联report_sheet_category" prop="category">
|
||||
<el-input v-model="dataForm.category" placeholder="分类:关联report_sheet_category"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接地址" prop="url">
|
||||
<el-input v-model="dataForm.url" placeholder="链接地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="报表内容" prop="content">
|
||||
<el-input v-model="dataForm.content" placeholder="报表内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
category: '',
|
||||
code: '',
|
||||
name: '',
|
||||
fileName: '',
|
||||
url: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
content: ''
|
||||
},
|
||||
dataRule: {
|
||||
category: [
|
||||
{ required: true, message: '分类:关联report_sheet_category不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileName: [
|
||||
{ required: true, message: '文件名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
url: [
|
||||
{ required: true, message: '链接地址不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: '报表内容不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/reporsheet/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.category = data.reporsheet.category
|
||||
this.dataForm.code = data.reporsheet.code
|
||||
this.dataForm.name = data.reporsheet.name
|
||||
this.dataForm.fileName = data.reporsheet.fileName
|
||||
this.dataForm.url = data.reporsheet.url
|
||||
this.dataForm.description = data.reporsheet.description
|
||||
this.dataForm.enabled = data.reporsheet.enabled
|
||||
this.dataForm.remark = data.reporsheet.remark
|
||||
this.dataForm.valid = data.reporsheet.valid
|
||||
this.dataForm.creatorId = data.reporsheet.creatorId
|
||||
this.dataForm.creatorName = data.reporsheet.creatorName
|
||||
this.dataForm.createTime = data.reporsheet.createTime
|
||||
this.dataForm.updaterId = data.reporsheet.updaterId
|
||||
this.dataForm.updaterName = data.reporsheet.updaterName
|
||||
this.dataForm.updateTime = data.reporsheet.updateTime
|
||||
this.dataForm.version = data.reporsheet.version
|
||||
this.dataForm.content = data.reporsheet.content
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/reporsheet/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'category': this.dataForm.category,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'fileName': this.dataForm.fileName,
|
||||
'url': this.dataForm.url,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'content': this.dataForm.content
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
259
src/views/modules/code/reportSheet.vue
Normal file
259
src/views/modules/code/reportSheet.vue
Normal file
@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:reporsheet:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:reporsheet:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="category"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="分类:关联report_sheet_category">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="url"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="链接地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="报表内容">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './reporsheet-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/reporsheet/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/reporsheet/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
241
src/views/modules/code/reportSheetCategory.vue
Normal file
241
src/views/modules/code/reportSheetCategory.vue
Normal file
@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:reporsheecategory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:reporsheecategory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部编码,用于对照外部系统的编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './reporsheecategory-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/reporsheecategory/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/reporsheecategory/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
192
src/views/modules/code/sysfile-add-or-update.vue
Normal file
192
src/views/modules/code/sysfile-add-or-update.vue
Normal file
@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="文件类型编号" prop="typeCode">
|
||||
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件编号" prop="fileCode">
|
||||
<el-input v-model="dataForm.fileCode" placeholder="文件编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径URL" prop="fileUrl">
|
||||
<el-input v-model="dataForm.fileUrl" placeholder="文件路径URL"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
typeCode: '',
|
||||
fileCode: '',
|
||||
fileName: '',
|
||||
fileUrl: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
typeCode: [
|
||||
{ required: true, message: '文件类型编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileCode: [
|
||||
{ required: true, message: '文件编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileName: [
|
||||
{ required: true, message: '文件名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
fileUrl: [
|
||||
{ required: true, message: '文件路径URL不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/sysfile/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.typeCode = data.sysFile.typeCode
|
||||
this.dataForm.fileCode = data.sysFile.fileCode
|
||||
this.dataForm.fileName = data.sysFile.fileName
|
||||
this.dataForm.fileUrl = data.sysFile.fileUrl
|
||||
this.dataForm.remark = data.sysFile.remark
|
||||
this.dataForm.valid = data.sysFile.valid
|
||||
this.dataForm.creatorId = data.sysFile.creatorId
|
||||
this.dataForm.creatorName = data.sysFile.creatorName
|
||||
this.dataForm.createTime = data.sysFile.createTime
|
||||
this.dataForm.updaterId = data.sysFile.updaterId
|
||||
this.dataForm.updaterName = data.sysFile.updaterName
|
||||
this.dataForm.updateTime = data.sysFile.updateTime
|
||||
this.dataForm.version = data.sysFile.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/sysfile/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'typeCode': this.dataForm.typeCode,
|
||||
'fileCode': this.dataForm.fileCode,
|
||||
'fileName': this.dataForm.fileName,
|
||||
'fileUrl': this.dataForm.fileUrl,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
235
src/views/modules/code/sysfile.vue
Normal file
235
src/views/modules/code/sysfile.vue
Normal file
@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:sysfile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:sysfile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="主键,自增">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件类型编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fileUrl"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件路径URL">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './sysfile-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/sysfile/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/sysfile/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
223
src/views/modules/code/sysfileType.vue
Normal file
223
src/views/modules/code/sysfileType.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:sysfiletype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:sysfiletype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="主键,自增">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件类型编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="typeName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="文件类型名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './sysfiletype-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/sysfiletype/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/sysfiletype/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
174
src/views/modules/code/sysfiletype-add-or-update.vue
Normal file
174
src/views/modules/code/sysfiletype-add-or-update.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="文件类型编号" prop="typeCode">
|
||||
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型名称" prop="typeName">
|
||||
<el-input v-model="dataForm.typeName" placeholder="文件类型名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
typeCode: '',
|
||||
typeName: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
typeCode: [
|
||||
{ required: true, message: '文件类型编号不能为空', trigger: 'blur' }
|
||||
],
|
||||
typeName: [
|
||||
{ required: true, message: '文件类型名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/sysfiletype/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.typeCode = data.sysFileType.typeCode
|
||||
this.dataForm.typeName = data.sysFileType.typeName
|
||||
this.dataForm.remark = data.sysFileType.remark
|
||||
this.dataForm.valid = data.sysFileType.valid
|
||||
this.dataForm.creatorId = data.sysFileType.creatorId
|
||||
this.dataForm.creatorName = data.sysFileType.creatorName
|
||||
this.dataForm.createTime = data.sysFileType.createTime
|
||||
this.dataForm.updaterId = data.sysFileType.updaterId
|
||||
this.dataForm.updaterName = data.sysFileType.updaterName
|
||||
this.dataForm.updateTime = data.sysFileType.updateTime
|
||||
this.dataForm.version = data.sysFileType.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/sysfiletype/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'typeCode': this.dataForm.typeCode,
|
||||
'typeName': this.dataForm.typeName,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
253
src/views/modules/code/workShopSection.vue
Normal file
253
src/views/modules/code/workShopSection.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:workshopsection:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:workshopsection:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productionLineId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="产线ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enabled"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="启用状态:0 、停用,1、启用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="排序">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部系统编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './workshopsection-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/workshopsection/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/workshopsection/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
229
src/views/modules/code/workShopSectionEquipment.vue
Normal file
229
src/views/modules/code/workShopSectionEquipment.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('monitoring:workshopsectionequipment:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('monitoring:workshopsectionequipment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="workshopSectionId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="工段ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="排序">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="valid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标志,是否有效:1 可用 0不可用">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatorName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updaterName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新人姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="version"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="版本号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './workshopsectionequipment-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/workshopsectionequipment/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/workshopsectionequipment/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
219
src/views/modules/code/workshopsection-add-or-update.vue
Normal file
219
src/views/modules/code/workshopsection-add-or-update.vue
Normal file
@ -0,0 +1,219 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="产线ID" prop="productionLineId">
|
||||
<el-input v-model="dataForm.productionLineId" placeholder="产线ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="启用状态:0 、停用,1、启用" prop="enabled">
|
||||
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用,1、启用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="外部系统编码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
productionLineId: '',
|
||||
code: '',
|
||||
name: '',
|
||||
description: '',
|
||||
enabled: '',
|
||||
sort: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: '',
|
||||
externalCode: ''
|
||||
},
|
||||
dataRule: {
|
||||
productionLineId: [
|
||||
{ required: true, message: '产线ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: '排序不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
],
|
||||
externalCode: [
|
||||
{ required: true, message: '外部系统编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/workshopsection/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.productionLineId = data.workshopSection.productionLineId
|
||||
this.dataForm.code = data.workshopSection.code
|
||||
this.dataForm.name = data.workshopSection.name
|
||||
this.dataForm.description = data.workshopSection.description
|
||||
this.dataForm.enabled = data.workshopSection.enabled
|
||||
this.dataForm.sort = data.workshopSection.sort
|
||||
this.dataForm.remark = data.workshopSection.remark
|
||||
this.dataForm.valid = data.workshopSection.valid
|
||||
this.dataForm.creatorId = data.workshopSection.creatorId
|
||||
this.dataForm.creatorName = data.workshopSection.creatorName
|
||||
this.dataForm.createTime = data.workshopSection.createTime
|
||||
this.dataForm.updaterId = data.workshopSection.updaterId
|
||||
this.dataForm.updaterName = data.workshopSection.updaterName
|
||||
this.dataForm.updateTime = data.workshopSection.updateTime
|
||||
this.dataForm.version = data.workshopSection.version
|
||||
this.dataForm.externalCode = data.workshopSection.externalCode
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/workshopsection/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'productionLineId': this.dataForm.productionLineId,
|
||||
'code': this.dataForm.code,
|
||||
'name': this.dataForm.name,
|
||||
'description': this.dataForm.description,
|
||||
'enabled': this.dataForm.enabled,
|
||||
'sort': this.dataForm.sort,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version,
|
||||
'externalCode': this.dataForm.externalCode
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="工段ID" prop="workshopSectionId">
|
||||
<el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备ID" prop="equipmentId">
|
||||
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
|
||||
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="creatorId">
|
||||
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人姓名" prop="creatorName">
|
||||
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updaterId">
|
||||
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人姓名" prop="updaterName">
|
||||
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="dataForm.version" placeholder="版本号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
workshopSectionId: '',
|
||||
equipmentId: '',
|
||||
sort: '',
|
||||
remark: '',
|
||||
valid: '',
|
||||
creatorId: '',
|
||||
creatorName: '',
|
||||
createTime: '',
|
||||
updaterId: '',
|
||||
updaterName: '',
|
||||
updateTime: '',
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
workshopSectionId: [
|
||||
{ required: true, message: '工段ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备ID不能为空', trigger: 'blur' }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: '排序不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/workshopsectionequipment/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.workshopSectionId = data.workshopSectionEquipment.workshopSectionId
|
||||
this.dataForm.equipmentId = data.workshopSectionEquipment.equipmentId
|
||||
this.dataForm.sort = data.workshopSectionEquipment.sort
|
||||
this.dataForm.remark = data.workshopSectionEquipment.remark
|
||||
this.dataForm.valid = data.workshopSectionEquipment.valid
|
||||
this.dataForm.creatorId = data.workshopSectionEquipment.creatorId
|
||||
this.dataForm.creatorName = data.workshopSectionEquipment.creatorName
|
||||
this.dataForm.createTime = data.workshopSectionEquipment.createTime
|
||||
this.dataForm.updaterId = data.workshopSectionEquipment.updaterId
|
||||
this.dataForm.updaterName = data.workshopSectionEquipment.updaterName
|
||||
this.dataForm.updateTime = data.workshopSectionEquipment.updateTime
|
||||
this.dataForm.version = data.workshopSectionEquipment.version
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/workshopsectionequipment/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'workshopSectionId': this.dataForm.workshopSectionId,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'sort': this.dataForm.sort,
|
||||
'remark': this.dataForm.remark,
|
||||
'valid': this.dataForm.valid,
|
||||
'creatorId': this.dataForm.creatorId,
|
||||
'creatorName': this.dataForm.creatorName,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updaterId': this.dataForm.updaterId,
|
||||
'updaterName': this.dataForm.updaterName,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'version': this.dataForm.version
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user