update
This commit is contained in:
parent
2c8b72f2fb
commit
c34d5e8abd
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 物联大屏管理系统
|
||||
VITE_APP_TITLE = 微工厂设备物联管理系统
|
||||
|
||||
# 开发环境配置
|
||||
VITE_APP_ENV = 'development'
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VITE_APP_TITLE = 物联大屏管理系统
|
||||
VITE_APP_TITLE = 微工厂设备物联管理系统
|
||||
|
||||
# 生产环境配置
|
||||
VITE_APP_ENV = 'production'
|
||||
|
@ -7,7 +7,7 @@
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<title>物联大屏管理系统</title>
|
||||
<title>微工厂设备物联管理系统</title>
|
||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||
<style>
|
||||
html,
|
||||
|
@ -36,6 +36,7 @@
|
||||
"vue": "3.2.45",
|
||||
"vue-cropper": "1.0.3",
|
||||
"vue-echarts": "^7.0.3",
|
||||
"vue-i18n": "9.10.2",
|
||||
"vue-router": "4.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,29 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
//big/getScreen
|
||||
|
||||
// 查询历史记录
|
||||
export function getGuoJianRecord(query) {
|
||||
return request({
|
||||
url: 'screen/guoJian/getGuoJianRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询短信发送记录
|
||||
export function getSmsRecord(query) {
|
||||
return request({
|
||||
url: 'screen/guoJian/getSmsRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询短信发送记录
|
||||
export function getSmsRecordFromAliyun() {
|
||||
return request({
|
||||
url: 'screen/guoJian/getSmsRecordFromAliyun',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
94
src/api/pms/checkplan.js
Normal file
94
src/api/pms/checkplan.js
Normal file
@ -0,0 +1,94 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备点检计划头列表
|
||||
export function listCheckplan(query) {
|
||||
return request({
|
||||
url: '/pms/CheckPlan/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备点检计划头详细
|
||||
export function getCheckplan(planId) {
|
||||
return request({
|
||||
url: '/pms/CheckPlan/' + planId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备点检计划头
|
||||
export function addCheckplan(data) {
|
||||
return request({
|
||||
url: '/pms/CheckPlan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备点检计划头
|
||||
export function updateCheckplan(data) {
|
||||
return request({
|
||||
url: '/pms/CheckPlan',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备点检计划头
|
||||
export function delCheckplan(planId) {
|
||||
return request({
|
||||
url: '/pms/CheckPlan/' + planId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
//设备点检保养状态修改
|
||||
export function changeCheckplanStatus(id, status) {
|
||||
return request({
|
||||
url: '/pms/CheckPlan/updateStatus',
|
||||
method: 'put',
|
||||
data: {
|
||||
id,
|
||||
status
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 查询设备点检保养记录列表
|
||||
export function listCheckRecord(query) {
|
||||
return request({
|
||||
url: '/pms/checkRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询保养记录详细
|
||||
export function getCheckRecord(id) {
|
||||
return request({
|
||||
url: '/pms/checkRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改保养记录
|
||||
export function updateCheckRecord(data) {
|
||||
return request({
|
||||
url: '/pms/checkRecord',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 删除保养记录
|
||||
export function delCheckRecord(id) {
|
||||
return request({
|
||||
url: '/pms/checkRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
169
src/api/pms/device.js
Normal file
169
src/api/pms/device.js
Normal file
@ -0,0 +1,169 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备信息列表
|
||||
export function listDevice(query) {
|
||||
return request({
|
||||
url: '/pms/device/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备信息详细
|
||||
export function getDevice(id) {
|
||||
return request({
|
||||
url: '/pms/device/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备信息
|
||||
export function addDevice(data) {
|
||||
return request({
|
||||
url: '/pms/device',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备信息
|
||||
export function updateDevice(data) {
|
||||
return request({
|
||||
url: '/pms/device',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备信息
|
||||
export function delDevice(id) {
|
||||
return request({
|
||||
url: '/pms/device/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 获取设备信息
|
||||
export function selectDevicelnfo(query) {
|
||||
return request({
|
||||
url: '/pms/device/selectDeviceInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//生成设备报表
|
||||
export function downloadDeviceReport(id) {
|
||||
return request({
|
||||
url: '/pms/statement/equipmentReport/'+ id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//下载设备报表
|
||||
export function downloadDeviceReportFile(url) {
|
||||
return request({
|
||||
url: url,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**设备类型 **********************************************************/
|
||||
// 查询DeviceType列表
|
||||
export function listDeviceType(query) {
|
||||
return request({
|
||||
url: '/pms/DeviceType/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询DeviceType详细
|
||||
export function getDeviceType(code) {
|
||||
return request({
|
||||
url: '/pms/DeviceType/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获取默认配置信息
|
||||
export function getNamesByType(code) {
|
||||
return request({
|
||||
url: '/pms/DeviceType/getNamesByType/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增DeviceType
|
||||
export function addDeviceType(data) {
|
||||
return request({
|
||||
url: '/pms/DeviceType',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改DeviceType
|
||||
export function updateDeviceType(data) {
|
||||
return request({
|
||||
url: '/pms/DeviceType',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除DeviceType
|
||||
export function delDeviceType(code) {
|
||||
return request({
|
||||
url: '/pms/DeviceType/' + code,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************设备配置 **************************************/
|
||||
|
||||
// 查询设备配置列表
|
||||
export function listDeviceConfig(query) {
|
||||
return request({
|
||||
url: '/pms/DeviceConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备配置详细
|
||||
export function getDeviceConfig(code) {
|
||||
return request({
|
||||
url: '/pms/DeviceConfig/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备配置
|
||||
export function addDeviceConfig(data) {
|
||||
return request({
|
||||
url: '/pms/DeviceConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备配置
|
||||
export function updateDeviceConfig(data) {
|
||||
return request({
|
||||
url: '/pms/DeviceConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备配置
|
||||
export function delDeviceConfig(code) {
|
||||
return request({
|
||||
url: '/pms/DeviceConfig/' + code,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/pms/dvsubject.js
Normal file
44
src/api/pms/dvsubject.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备点检保养项目列表
|
||||
export function listDvsubject(query) {
|
||||
return request({
|
||||
url: '/pms/subject/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备点检保养项目详细
|
||||
export function getDvsubject(subjectId) {
|
||||
return request({
|
||||
url: '/pms/subject/' + subjectId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备点检保养项目
|
||||
export function addDvsubject(data) {
|
||||
return request({
|
||||
url: '/pms/subject',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备点检保养项目
|
||||
export function updateDvsubject(data) {
|
||||
return request({
|
||||
url: '/pms/subject',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备点检保养项目
|
||||
export function delDvsubject(subjectId) {
|
||||
return request({
|
||||
url: '/pms/subject/' + subjectId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/pms/file.js
Normal file
44
src/api/pms/file.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询附件管理列表
|
||||
export function listFile(query) {
|
||||
return request({
|
||||
url: '/pms/file/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询附件管理详细
|
||||
export function getFile(id) {
|
||||
return request({
|
||||
url: '/pms/file/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增附件管理
|
||||
export function addFile(data) {
|
||||
return request({
|
||||
url: '/pms/file',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改附件管理
|
||||
export function updateFile(data) {
|
||||
return request({
|
||||
url: '/pms/file',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除附件管理
|
||||
export function delFile(id) {
|
||||
return request({
|
||||
url: '/pms/file/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/pms/operationRecords.js
Normal file
44
src/api/pms/operationRecords.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备操作记录列表
|
||||
export function listOperationRecords(query) {
|
||||
return request({
|
||||
url: '/pms/operationRecords/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备操作记录详细
|
||||
export function getOperationRecords(id) {
|
||||
return request({
|
||||
url: '/pms/operationRecords/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备操作记录
|
||||
export function addOperationRecords(data) {
|
||||
return request({
|
||||
url: '/pms/operationRecords',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备操作记录
|
||||
export function updateOperationRecords(data) {
|
||||
return request({
|
||||
url: '/pms/operationRecords',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备操作记录
|
||||
export function delOperationRecords(id) {
|
||||
return request({
|
||||
url: '/pms/operationRecords/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
65
src/api/pms/output.js
Normal file
65
src/api/pms/output.js
Normal file
@ -0,0 +1,65 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询生产管理列表
|
||||
export function listOutput(query) {
|
||||
return request({
|
||||
url: '/pms/output/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询生产管理详细
|
||||
export function getOutput(id) {
|
||||
return request({
|
||||
url: '/pms/output/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增生产管理
|
||||
export function addOutput(data) {
|
||||
return request({
|
||||
url: '/pms/output',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改生产管理
|
||||
export function updateOutput(data) {
|
||||
return request({
|
||||
url: '/pms/output',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除生产管理
|
||||
export function delOutput(id) {
|
||||
return request({
|
||||
url: '/pms/output/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 生产追踪
|
||||
export function getOutputTrack(query) {
|
||||
return request({
|
||||
url: '/pms/quality/outputTrack',
|
||||
method: 'get',
|
||||
params: query
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 生产追踪 详情
|
||||
export function selectProductionTracking(query) {
|
||||
return request({
|
||||
url: '/pms/device/selectProductionTracking',
|
||||
method: 'get',
|
||||
params: query
|
||||
|
||||
})
|
||||
}
|
17
src/api/pms/prodMonitor.js
Normal file
17
src/api/pms/prodMonitor.js
Normal file
@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询生产管理列表
|
||||
export function onInfo() {
|
||||
return request({
|
||||
url: '/pms/home/onInfo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getHomeDeviceInfo(query) {
|
||||
return request({
|
||||
url: '/pms/home/getHomeDeviceInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
61
src/api/pms/produce.js
Normal file
61
src/api/pms/produce.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询生产管理列表
|
||||
export function listOutput(query) {
|
||||
return request({
|
||||
url: '/pms/output/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询生产管理详细
|
||||
export function getOutput(id) {
|
||||
return request({
|
||||
url: '/pms/output/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询生产管理详细
|
||||
export function getOutputInfo(id) {
|
||||
return request({
|
||||
url: '/pms/output/getOutputInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增生产管理
|
||||
export function addOutput(data) {
|
||||
return request({
|
||||
url: '/pms/output',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改生产管理
|
||||
export function updateOutput(data) {
|
||||
return request({
|
||||
url: '/pms/output',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除生产管理
|
||||
export function delOutput(id) {
|
||||
return request({
|
||||
url: '/pms/output/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 生产任务单下发
|
||||
export function sendTask(data) {
|
||||
return request({
|
||||
url: '/pms/output/sendTask',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
44
src/api/pms/production.js
Normal file
44
src/api/pms/production.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品信息列表
|
||||
export function listProduction(query) {
|
||||
return request({
|
||||
url: '/pms/production/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品信息详细
|
||||
export function getProduction(code) {
|
||||
return request({
|
||||
url: '/pms/production/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增产品信息
|
||||
export function addProduction(data) {
|
||||
return request({
|
||||
url: '/pms/production',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改产品信息
|
||||
export function updateProduction(data) {
|
||||
return request({
|
||||
url: '/pms/production',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除产品信息
|
||||
export function delProduction(code) {
|
||||
return request({
|
||||
url: '/pms/production/' + code,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
55
src/api/pms/quality.js
Normal file
55
src/api/pms/quality.js
Normal file
@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询质量管理列表
|
||||
export function listQuality(query) {
|
||||
return request({
|
||||
url: '/pms/quality/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询质量管理详细
|
||||
export function getQuality(id) {
|
||||
return request({
|
||||
url: '/pms/quality/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增质量管理
|
||||
export function addQuality(data) {
|
||||
return request({
|
||||
url: '/pms/quality',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改质量管理
|
||||
export function updateQuality(data) {
|
||||
return request({
|
||||
url: '/pms/quality',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除质量管理
|
||||
export function delQuality(id) {
|
||||
return request({
|
||||
url: '/pms/quality/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取合格率
|
||||
export function qualitystandardRate() {
|
||||
return request({
|
||||
url: '/pms/quality/getQualityRate',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
53
src/api/pms/repair.js
Normal file
53
src/api/pms/repair.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备维修单列表
|
||||
export function listRepair(query) {
|
||||
return request({
|
||||
url: '/pms/repair/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备维修单详细
|
||||
export function getRepair(repairId) {
|
||||
return request({
|
||||
url: '/pms/repair/' + repairId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备维修单
|
||||
export function addRepair(data) {
|
||||
return request({
|
||||
url: '/pms/repair',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备维修单
|
||||
export function updateRepair(data) {
|
||||
return request({
|
||||
url: '/pms/repair',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备维修单
|
||||
export function delRepair(repairId) {
|
||||
return request({
|
||||
url: '/pms/repair/' + repairId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 设备维修单操作记录
|
||||
export function selectRepairFLow(query) {
|
||||
return request({
|
||||
url: '/pms/repair/selectRepairFLow',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
44
src/api/pms/updateRecord.js
Normal file
44
src/api/pms/updateRecord.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备软硬件升级记录列表
|
||||
export function listRecords(query) {
|
||||
return request({
|
||||
url: '/pms/records/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备软硬件升级记录详细
|
||||
export function getRecords(id) {
|
||||
return request({
|
||||
url: '/pms/records/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备软硬件升级记录
|
||||
export function addRecords(data) {
|
||||
return request({
|
||||
url: '/pms/records',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备软硬件升级记录
|
||||
export function updateRecords(data) {
|
||||
return request({
|
||||
url: '/pms/records',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备软硬件升级记录
|
||||
export function delRecords(id) {
|
||||
return request({
|
||||
url: '/pms/records/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/pms/upgrade.js
Normal file
44
src/api/pms/upgrade.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备软硬件升级计划列表
|
||||
export function listUpgrade(query) {
|
||||
return request({
|
||||
url: '/mf/upgrade/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备软硬件升级计划详细
|
||||
export function getUpgrade(id) {
|
||||
return request({
|
||||
url: '/mf/upgrade/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备软硬件升级计划
|
||||
export function addUpgrade(data) {
|
||||
return request({
|
||||
url: '/mf/upgrade',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备软硬件升级计划
|
||||
export function updateUpgrade(data) {
|
||||
return request({
|
||||
url: '/mf/upgrade',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备软硬件升级计划
|
||||
export function delUpgrade(id) {
|
||||
return request({
|
||||
url: '/mf/upgrade/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
45
src/api/system/autocode/part.js
Normal file
45
src/api/system/autocode/part.js
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询规则组成
|
||||
export function listPart(query) {
|
||||
return request({
|
||||
url: '/system/autocode/part/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询规则组成详细
|
||||
export function getPart(partId) {
|
||||
return request({
|
||||
url: '/system/autocode/part/' + partId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 新增规则组成
|
||||
export function addPart(data) {
|
||||
return request({
|
||||
url: '/system/autocode/part',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改规则组成
|
||||
export function updatePart(data) {
|
||||
return request({
|
||||
url: '/system/autocode/part',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除规则组成
|
||||
export function delPart(partIds) {
|
||||
return request({
|
||||
url: '/system/autocode/part/' + partIds,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
51
src/api/system/autocode/rule.js
Normal file
51
src/api/system/autocode/rule.js
Normal file
@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function genCode(ruleCode){
|
||||
return request({
|
||||
url: '/pms/autoCode/get/'+ruleCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典类型列表
|
||||
export function listRule(query) {
|
||||
return request({
|
||||
url: '/system/autocode/rule/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典类型详细
|
||||
export function getRule(ruleId) {
|
||||
return request({
|
||||
url: '/system/autocode/rule/' + ruleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典类型
|
||||
export function addRule(data) {
|
||||
return request({
|
||||
url: '/system/autocode/rule',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典类型
|
||||
export function updateRule(data) {
|
||||
return request({
|
||||
url: '/system/autocode/rule',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典类型
|
||||
export function delRule(ruleId) {
|
||||
return request({
|
||||
url: '/system/autocode/rule/' + ruleId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
28
src/api/system/repair.js
Normal file
28
src/api/system/repair.js
Normal file
@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
|
||||
// 查询维修人员配置列表
|
||||
export function selectRepairUser(query) {
|
||||
return request({
|
||||
url: '/pms/repair/selectRepairUser',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 添加维修人员配置
|
||||
export function addRepairUser(data) {
|
||||
return request({
|
||||
url: '/pms/repair/addRepairUser',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 删除维修人员配置
|
||||
export function delRepairUser(ids) {
|
||||
return request({
|
||||
url: '/pms/repair/delRepairUser',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
59
src/assets/iconfont/iconfont.css
Normal file
59
src/assets/iconfont/iconfont.css
Normal file
@ -0,0 +1,59 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4503445 */
|
||||
src: url('iconfont.woff2?t=1712901332022') format('woff2'),
|
||||
url('iconfont.woff?t=1712901332022') format('woff'),
|
||||
url('iconfont.ttf?t=1712901332022') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-renyuanxinxi-copy:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-baojing:before {
|
||||
content: "\e64b";
|
||||
}
|
||||
|
||||
.icon-zidongtaiyajiao:before {
|
||||
content: "\e61f";
|
||||
}
|
||||
|
||||
.icon-taiyajiaogaodu:before {
|
||||
content: "\e623";
|
||||
}
|
||||
|
||||
.icon-jizhenzhenshu:before {
|
||||
content: "\e61a";
|
||||
}
|
||||
|
||||
.icon-caijian:before {
|
||||
content: "\e66e";
|
||||
}
|
||||
|
||||
.icon-shebeixinxi:before {
|
||||
content: "\ea02";
|
||||
}
|
||||
|
||||
.icon-tonganrenyuanxinxi:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
|
||||
.icon-a-zu496:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.icon-shengchanxiaoshuai:before {
|
||||
content: "\e612";
|
||||
}
|
||||
|
||||
.icon-zhinengjiaju:before {
|
||||
content: "\e61c";
|
||||
}
|
||||
|
BIN
src/assets/iconfont/iconfont.ttf
Normal file
BIN
src/assets/iconfont/iconfont.ttf
Normal file
Binary file not shown.
BIN
src/assets/iconfont/iconfont.woff
Normal file
BIN
src/assets/iconfont/iconfont.woff
Normal file
Binary file not shown.
BIN
src/assets/iconfont/iconfont.woff2
Normal file
BIN
src/assets/iconfont/iconfont.woff2
Normal file
Binary file not shown.
44
src/components/LangSelect/index.vue
Normal file
44
src/components/LangSelect/index.vue
Normal file
@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dropdown trigger="click" @command="handleSetLang">
|
||||
<div class="size-icon--style">
|
||||
<svg preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" width="1.2em" height="1.2em" data-v-12008bb2=""><path fill="currentColor" d="m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"></path></svg>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="item of langOptions" :key="item.value" :disabled="lang === item.value" :command="item.value">
|
||||
{{ item.label }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import useAppStore from "@/store/modules/app";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const lang = computed(() => appStore.lang);
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const langOptions = ref([
|
||||
{ label: "中文", value: "zh-CN" },
|
||||
{ label: "English", value: "en-US" },
|
||||
]);
|
||||
|
||||
function handleSetLang(lang) {
|
||||
proxy.$modal.loading("正在设置语言,请稍候...");
|
||||
appStore.setLang(lang);
|
||||
setTimeout("window.location.reload()", 1000);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.size-icon--style {
|
||||
font-size: 18px;
|
||||
line-height: 60px;
|
||||
padding:0 7px;
|
||||
}
|
||||
</style>
|
409
src/lang/i18n-en-US.js
Normal file
409
src/lang/i18n-en-US.js
Normal file
@ -0,0 +1,409 @@
|
||||
export default {
|
||||
"menus": {
|
||||
"首页": "Home",
|
||||
"实时生产监控": "Prod Monitoring",
|
||||
"仪表盘": "Dashboard",
|
||||
"设备管理": "Dev",
|
||||
"产品管理": "Product",
|
||||
"生产管理": "Production",
|
||||
"质量管理": "Quality",
|
||||
"系统管理": "System",
|
||||
"用户管理": "User",
|
||||
"角色管理": "Role",
|
||||
"菜单管理": "Menu",
|
||||
"部门管理": "Dept",
|
||||
"岗位管理": "Job",
|
||||
"字典管理": "Dict",
|
||||
"参数管理": "Config",
|
||||
"通知公告": "Notice",
|
||||
"操作日志": "Log",
|
||||
"登录日志": "LoginLog",
|
||||
"定时任务": "Task",
|
||||
"系统监控": "Druid",
|
||||
"系统工具": "Tools",
|
||||
"大盘监控": "DruidWallBoard",
|
||||
"SQL监控": "DruidSql",
|
||||
"统计监控": "DruidStat",
|
||||
"添加": "Add",
|
||||
"修改": "Edit",
|
||||
"删除": "Delete",
|
||||
"组织架构": "Organization",
|
||||
"针管理": "Needle",
|
||||
"加工次数管理": "Process",
|
||||
"配件管理": "Accessory",
|
||||
"面线管理": "Upper Thread",
|
||||
"底线管理": "Bottom Thread",
|
||||
"梭芯信息": "Bobbin",
|
||||
"设备台账": "Dev Ledger",
|
||||
"类型管理": "Type",
|
||||
"配置管理": "Type Config",
|
||||
"保养项目": "Maint items",
|
||||
"点检保养计划": "Maint Plan",
|
||||
"点检保养记录": "Maint Record",
|
||||
"维修记录": "Repair Record",
|
||||
"设备操作记录": "Dev Oper Record",
|
||||
"产品信息管理": "Product Info",
|
||||
"附件管理": "Product Annex",
|
||||
"生产任务单": "Prod Order",
|
||||
"维修人员配置": "Repair Staff Config",
|
||||
"生产追踪": "Prod Trace",
|
||||
},
|
||||
"common": {
|
||||
"新增": "Add",
|
||||
"添加": "Add",
|
||||
"修改": "Edit",
|
||||
"删除": "Delete",
|
||||
"搜索": "Search",
|
||||
"重置": "Reset",
|
||||
"导入": "Import",
|
||||
"导出": "Export",
|
||||
"确定": "Confirm",
|
||||
"取消": "Cancel",
|
||||
"成功": "Success",
|
||||
"失败": "Error",
|
||||
"操作": "Operation",
|
||||
"详情": "Detail",
|
||||
"状态": "Status",
|
||||
"序号": "Index",
|
||||
"创建时间": "Create Time ",
|
||||
"更新时间": "Update Time ",
|
||||
"请输入": "Please input ",
|
||||
"请选择": "Please select ",
|
||||
"请确认": "Please confirm ",
|
||||
"确 定": "OK",
|
||||
"取 消": "Cancel",
|
||||
"添加成功": "Add Success",
|
||||
"修改成功": "Edit Success",
|
||||
"删除成功": "Delete Success",
|
||||
"合格": "Pass",
|
||||
"不合格": "Fail",
|
||||
"未完成": "Unfinished",
|
||||
"已完成": "Finished",
|
||||
"无法判断": "Unknown",
|
||||
"下载": "Download",
|
||||
"分钟": "Minute",
|
||||
"选择语言":"Select Language",
|
||||
"布局大小":"Layout Size",
|
||||
"较大":"Large",
|
||||
"默认":"Default",
|
||||
"较小":"Small",
|
||||
"个人中心":"Profile",
|
||||
"退出登录":"Logout",
|
||||
"保存":"Save",
|
||||
"关闭":"Close",
|
||||
"下载报表": "Download Report",
|
||||
"下发": "Issue",
|
||||
"生产中": "Producing",
|
||||
"未开始": "Not Start",
|
||||
"暂停": "Pause",
|
||||
"延期完成": "Delay Finished",
|
||||
"下发成功": "Issue Success",
|
||||
"暂停成功": "Pause Success",
|
||||
"启用": "Enable",
|
||||
"停用": "Disable",
|
||||
"已启用": "Enabled",
|
||||
"已停用": "Disabled",
|
||||
"完成": "Finished",
|
||||
"延期": "Delay",
|
||||
"查看": "View",
|
||||
"已延期": "Delayed",
|
||||
"天": "Day",
|
||||
"备注": "Remark",
|
||||
"文件": "File",
|
||||
"暂存": "PREPARE",
|
||||
"提 交": "Submit",
|
||||
"撤回": "Withdraw",
|
||||
"退回": "Return",
|
||||
"终止": "Terminate",
|
||||
"审批通过": "Approve",
|
||||
"完成维修": "Repair Finished",
|
||||
"完成验收": "Acceptance Finished",
|
||||
"验收未通过": "Acceptance Failed",
|
||||
},
|
||||
"validate": {
|
||||
"不能为空": "Can not be empty ",
|
||||
"格式不正确": "Format is incorrect",
|
||||
"长度不正确": "Length is incorrect",
|
||||
"范围不正确": "Range is incorrect",
|
||||
"最大值为": "Maximum value is",
|
||||
"最小值为": "Minimum value is",
|
||||
"最小针数不能大于最大针数": "Min needle can not be greater than max needle",
|
||||
"开始时间不能大于结束时间": "Start time can not be greater than end time",
|
||||
"开始日期不能大于结束日期": "Start date can not be greater than end date",
|
||||
},
|
||||
"tip": {
|
||||
"确定删除选中记录?": "Are you sure to delete the selected record?",
|
||||
"请上传": "Please upload",
|
||||
"大小不超过": "Size is not more than",
|
||||
"格式为": "Format is",
|
||||
"的文件": "file",
|
||||
"选取文件": "Select File",
|
||||
"是否确定下发生产任务?": "Are you sure to issue the production task?",
|
||||
"是否确定解绑当前设备?": "Are you sure to unbind the current device?",
|
||||
"是否确定暂停当前生产任务?": "Are you sure to pause the current production task?",
|
||||
"确定要": "Are you sure to ",
|
||||
},
|
||||
"login": {
|
||||
"标题": "Machine IoT management system",
|
||||
"用户登录": "User Login",
|
||||
"登录": "Login in",
|
||||
"账号": "Username",
|
||||
"密码": "Password",
|
||||
"验证码": "Code",
|
||||
"记住密码": "Remember Me",
|
||||
"登录中": "Logging in",
|
||||
"立即注册": "Register Now",
|
||||
"版权": "Copyright © 天津市再登软件有限公司, LIMITED All rights reserved"
|
||||
},
|
||||
"tagsView": {
|
||||
"隐藏搜索": "Hide Search",
|
||||
"显示搜索": "Show Search",
|
||||
"显隐列": "Hide/Show Column",
|
||||
"刷新": "Refresh",
|
||||
"关闭": "Close",
|
||||
"关闭其它": "Close Others",
|
||||
"关闭所有": "Close All",
|
||||
"显示": "Show",
|
||||
"隐藏": "Hide",
|
||||
},
|
||||
"settings": {
|
||||
"title": "Page style setting",
|
||||
"theme": "Theme Color",
|
||||
"tagsView": "Open Tags-View",
|
||||
"fixedHeader": "Fixed Header",
|
||||
"sidebarLogo": "Sidebar Logo"
|
||||
},
|
||||
"home":{
|
||||
"员工总数": "Staff Total",
|
||||
"设备总数": "Dev Total",
|
||||
"产出进度": "Output Progress",
|
||||
"设备": "Dev",
|
||||
"使用中": "In Use",
|
||||
"停机": "Stopped",
|
||||
"总数": "Total",
|
||||
"工作人员": "Staff",
|
||||
"加工信息": "Process Info",
|
||||
"产量": "Output",
|
||||
"稼动率": "Utilization",
|
||||
"设备利用率": "Dev Utilization",
|
||||
"设备状态": "Dev Status",
|
||||
"台": "Units",
|
||||
"人": "Pepole",
|
||||
"张力值": "Tension Value",
|
||||
"张力": "Tension",
|
||||
'针数': 'Needle',
|
||||
"针1": "Needle1",
|
||||
"针2": "Needle2",
|
||||
"任务信息": "Task Info",
|
||||
"产品完成率": "Product Finish Rate",
|
||||
"实际产量": "Actual Output",
|
||||
"目标产量": "Target Output",
|
||||
"在线数": "Online",
|
||||
"件":'pcs',
|
||||
"工作": "Working",
|
||||
"待机": "Idle",
|
||||
"急停": "Emergency Stop",
|
||||
"故障总览": "Fault Overview",
|
||||
"维修": "Repairing",
|
||||
|
||||
},
|
||||
"user":{
|
||||
'人员信息': 'User Info',
|
||||
'操作员': 'Operator',
|
||||
'人员ID': 'Staff ID',
|
||||
'员工姓名': 'Staff Name',
|
||||
'员工编号': 'Staff Code',
|
||||
'用户名称': 'Username',
|
||||
"手机号码": "Mobile",
|
||||
"用户邮箱": "Email",
|
||||
"所属部门": "Dept",
|
||||
"所属角色": "Role",
|
||||
"创建日期": "Create Date",
|
||||
"基本资料": "Basic Info",
|
||||
"修改密码": "Change Password",
|
||||
"用户昵称": "Nickname",
|
||||
"男": "male",
|
||||
"女": "famale",
|
||||
"旧密码": "Old Password",
|
||||
"新密码": "New Password",
|
||||
"确认密码": "Confirm Password",
|
||||
|
||||
},
|
||||
"device": {
|
||||
"设备": "Device",
|
||||
"设备信息": "Dev Info",
|
||||
"设备名称": "Dev Name",
|
||||
"设备编码": "Dev Code",
|
||||
"设备类型": "Type",
|
||||
"车间名称": "Workshop",
|
||||
"产线名称": "Prod Line",
|
||||
"保养周期": "Maint Cycle",
|
||||
"供货商名称": "Supplier",
|
||||
"供货商联络人": "Contact",
|
||||
"生产厂家": "Manufacturer",
|
||||
"联系电话": "Phone",
|
||||
"品牌": "Brand",
|
||||
"设备型号": "Model",
|
||||
"备注": "Remark",
|
||||
"图片": "Image",
|
||||
"运行时长": "Run Time",
|
||||
"工作时长": "Work Time",
|
||||
"设备版本": "Version",
|
||||
"厂家电话": "MFR Phone",
|
||||
"负责人": "Leader",
|
||||
"生产日期": "Produce Date",
|
||||
"投产日期": "Start Date",
|
||||
"设备位置": "Location",
|
||||
"机头数": "Needle Count",
|
||||
"设备详情": "Dev Detail",
|
||||
"其他信息": "Other Info",
|
||||
"配置信息": "Config Info",
|
||||
"设备信息": "Dev Info",
|
||||
"联系人":"Contact Person",
|
||||
"供应商电话":"Supplier Phone",
|
||||
"备注信息":"Remark",
|
||||
"设备图片":"Dev Image",
|
||||
"保养手册":"Maint Manual",
|
||||
"类型名称":"Type Name",
|
||||
"关联配置":"Related Config",
|
||||
"配置名称":"Config Name",
|
||||
"设备配置":"Dev Config",
|
||||
"操作时间":"Oper Time",
|
||||
"操作类型":"Oper Type",
|
||||
"操作位置":"Oper Location",
|
||||
"操作时长":"Oper Duration",
|
||||
"设备故障率":"Fault Rate",
|
||||
"工作头数":"Work Head Count",
|
||||
},
|
||||
"pms":{
|
||||
"项目编码": "Project Code",
|
||||
"项目名称": "Project Name",
|
||||
"项目类型": "Project Type",
|
||||
"项目内容": "Project Content",
|
||||
"标准": "Standard",
|
||||
"点检保养项目": "Maint Item",
|
||||
'计划编码': 'Plan Code',
|
||||
'计划名称': 'Plan Name',
|
||||
"计划类型": "Plan Type",
|
||||
"草稿": "Draft",
|
||||
"开始日期": "Start Date",
|
||||
"结束日期": "End Date",
|
||||
"频率": "Frequency",
|
||||
"点检": "Check",
|
||||
"保养": "Maint",
|
||||
"周": "Week",
|
||||
"月": "Month",
|
||||
"设备点检": "Dev Check",
|
||||
"设备保养": "Dev Maint",
|
||||
"次数": "Times",
|
||||
"计划": "Plan",
|
||||
"执行单编码": "Order Code",
|
||||
"执行人" : "Operator",
|
||||
"实际执行时间": "Actual Time",
|
||||
"计划执行时间": "Plan Time",
|
||||
"最晚执行时间": "Latest Time",
|
||||
"执行提醒": "Remind",
|
||||
"待执行": "Pending",
|
||||
"维修单编号": "Repair Code",
|
||||
"维修单名称": "Repair Name",
|
||||
"维修结果": "Repair Result",
|
||||
"单据状态": "Order Status",
|
||||
"报修日期": "report date",
|
||||
"维修完成日期": "finish date",
|
||||
"验收日期": "Acceptance date",
|
||||
"维修人员": "Repair personnel",
|
||||
"验收人员": "Acceptance personnel",
|
||||
"记录": "Record",
|
||||
"最晚维修日期": "Latest Date",
|
||||
"报修备注": "report Remark",
|
||||
"审核备注": "Audit Remark",
|
||||
"维修备注": "Repair Remark",
|
||||
"验收备注": "Acceptance Remark",
|
||||
"维修成功": "Repair Success",
|
||||
"维修失败": "Repair Fail",
|
||||
"维修内容": "Repair Content",
|
||||
"故障描述": "Fault Description",
|
||||
"故障描述内容": "Fault Description Content",
|
||||
"维修情况": "Repair Situation",
|
||||
"设备维修单": "Dev Repair Order",
|
||||
},
|
||||
"product": {
|
||||
"产品信息": "Product Info",
|
||||
"产品名称": "ProductName",
|
||||
"产品编码": "ProductCode",
|
||||
"产品类型": "ProductType",
|
||||
"备注": "Remark",
|
||||
"图片": "Image",
|
||||
"底线编码": "BottomCode",
|
||||
"面线编码": "UpperCode",
|
||||
"表面张力": "Tension",
|
||||
"最小张力": "Min Tension",
|
||||
"最大张力": "Max Tension",
|
||||
"最小值": "Min",
|
||||
"最大值": "Max",
|
||||
"最小针数": "MinNeedle",
|
||||
"最大针数": "MaxNeedle",
|
||||
"缝纫次数": "SewingTimes",
|
||||
"针号": "Needle",
|
||||
"面线信息": "UpperThread",
|
||||
"底线信息": "BottomThread",
|
||||
"梭芯信息": "Bobbin",
|
||||
"排序": "Sort",
|
||||
"类型": "Type",
|
||||
"第几次": "Needle No.",
|
||||
"步骤": "Step",
|
||||
"二维码": "QRCode",
|
||||
"编码": "Code",
|
||||
"总针数": "Total Needle",
|
||||
"花样名称": "Pattern Name",
|
||||
"针数": "Needle Count",
|
||||
"花色": "Color",
|
||||
"产品序列号": "ProductSN",
|
||||
"底线材质": "Bottom Material",
|
||||
"面线材质": "Upper Material",
|
||||
"花样附件": "Pattern Annex",
|
||||
"附件名称": "Annex Name",
|
||||
"附件编码": "Annex Code",
|
||||
"附件图片": "Annex Image",
|
||||
"附件文件": "Annex File",
|
||||
"当前针数": "Current Needle",
|
||||
"合格样板": "Qualified template",
|
||||
},
|
||||
"produce": {
|
||||
"产品编码": "ProductCode",
|
||||
"设备编码": "Dev Code",
|
||||
"员工编号": "Staff Code",
|
||||
"目标产量": "TargetOutput",
|
||||
"当前产量": "CurrentOutput",
|
||||
"开始时间": "StartTime",
|
||||
"结束时间": "EndTime",
|
||||
"批次": "Batch",
|
||||
"备注": "Remark",
|
||||
"状态": "Status",
|
||||
"二维码": "QRCode",
|
||||
"获取二维码": "Get QRCode",
|
||||
"生产信息": "Prod Info",
|
||||
"操作员编号": "Oper Code",
|
||||
"操作人员": "Operator",
|
||||
"工作进度": "Work Progress",
|
||||
"待机时长": "Idle Time",
|
||||
"产品状态": "Prod Status",
|
||||
"宽度": "Width",
|
||||
"高度": "Height",
|
||||
"当前色序": "Current Color",
|
||||
"总色序数": "Total Color",
|
||||
},
|
||||
"quality": {
|
||||
"产品名称": "ProductName",
|
||||
"产品编码": "ProductCode",
|
||||
"产品序列号": "ProductSN",
|
||||
"员工姓名": "StaffName",
|
||||
"设备名称": "DevName",
|
||||
"开始时间": "StartTime",
|
||||
"完成时间": "FinishTime",
|
||||
"状态": "Status",
|
||||
"产品合格率": "PassRate",
|
||||
"产品不合格率": "FailRate",
|
||||
"产品完成量": "FinishCount",
|
||||
}
|
||||
}
|
412
src/lang/i18n-zh-CN.js
Normal file
412
src/lang/i18n-zh-CN.js
Normal file
@ -0,0 +1,412 @@
|
||||
export default {
|
||||
//菜单
|
||||
"menus": {
|
||||
"首页": "首页",
|
||||
"实时生产监控": "实时生产监控",
|
||||
"仪表盘": "仪表盘",
|
||||
"设备管理": "设备管理",
|
||||
"产品管理": "产品管理",
|
||||
"生产管理": "生产管理",
|
||||
"质量管理": "质量管理",
|
||||
"系统管理": "系统管理",
|
||||
"用户管理": "用户管理",
|
||||
"角色管理": "角色管理",
|
||||
"菜单管理": "菜单管理",
|
||||
"部门管理": "部门管理",
|
||||
"岗位管理": "岗位管理",
|
||||
"字典管理": "字典管理",
|
||||
"参数管理": "参数管理",
|
||||
"通知公告": "通知公告",
|
||||
"操作日志": "操作日志",
|
||||
"登录日志": "登录日志",
|
||||
"定时任务": "定时任务",
|
||||
"系统监控": "系统监控",
|
||||
"系统工具": "系统工具",
|
||||
"大盘监控": "大盘监控",
|
||||
"SQL监控": "SQL监控",
|
||||
"统计监控": "统计监控",
|
||||
"添加": "添加",
|
||||
"修改": "修改",
|
||||
"删除": "删除",
|
||||
"组织架构": "组织架构",
|
||||
"针管理": "针管理",
|
||||
"加工次数管理": "加工次数管理",
|
||||
"配件管理": "配件管理",
|
||||
"面线管理": "面线管理",
|
||||
"底线管理": "底线管理",
|
||||
"梭芯信息": "梭芯管理",
|
||||
"设备台账": "设备台账",
|
||||
"类型管理": "类型管理",
|
||||
"配置管理": "配置管理",
|
||||
"保养项目": "保养项目",
|
||||
"点检保养计划": "点检保养计划",
|
||||
"点检保养记录": "点检保养记录",
|
||||
"维修记录": "维修记录",
|
||||
"设备操作记录": "设备操作记录",
|
||||
"产品信息管理": "产品信息管理",
|
||||
"附件管理": "附件管理",
|
||||
"生产任务单": "生产任务单",
|
||||
"维修人员配置": "维修人员配置",
|
||||
"生产追踪": "生产追踪",
|
||||
|
||||
},
|
||||
"common": {
|
||||
"新增": "新增",
|
||||
"添加": "添加",
|
||||
"修改": "修改",
|
||||
"删除": "删除",
|
||||
"搜索": "搜索",
|
||||
"重置": "重置",
|
||||
"导入": "导入",
|
||||
"导出": "导出",
|
||||
"确定": "确定",
|
||||
"取消": "取消",
|
||||
"成功": "成功",
|
||||
"失败": "失败",
|
||||
"操作": "操作",
|
||||
"详情": "详情",
|
||||
"状态": "状态",
|
||||
"序号": "序号",
|
||||
"创建时间": "创建时间",
|
||||
"更新时间": "更新时间",
|
||||
"请输入": "请输入",
|
||||
"请选择": "请选择",
|
||||
"请确认": "请确认",
|
||||
"确 定": "确 定",
|
||||
"取 消": "取 消",
|
||||
"添加成功": "添加成功",
|
||||
"修改成功": "修改成功",
|
||||
"删除成功": "删除成功",
|
||||
'合格': '合格',
|
||||
'不合格': '不合格',
|
||||
"未完成": "未完成",
|
||||
"已完成": "已完成",
|
||||
"无法判断": "无法判断",
|
||||
"下载": "下载",
|
||||
"分钟": " 分钟",
|
||||
"选择语言": "选择语言",
|
||||
"布局大小": "布局大小",
|
||||
"较大": "较大",
|
||||
"默认": "默认",
|
||||
"较小": "较小",
|
||||
"个人中心": "个人中心",
|
||||
"退出登录": "退出登录",
|
||||
"保存": "保存",
|
||||
"关闭": "关闭",
|
||||
"下载报表": "下载报表",
|
||||
"下发": "下发",
|
||||
"生产中": "生产中",
|
||||
"未开始": "未开始",
|
||||
"暂停": "暂停",
|
||||
"延期完成": "延期完成",
|
||||
"下发成功": "下发成功",
|
||||
"暂停成功": "暂停成功",
|
||||
"启用": "启用",
|
||||
"停用": "停用",
|
||||
"已启用": "已启用",
|
||||
"已停用": "已停用",
|
||||
"完成": "完成",
|
||||
"延期": "延期",
|
||||
"查看": "查看",
|
||||
"已延期": "已延期",
|
||||
"天": "天",
|
||||
"备注": "备注",
|
||||
"文件": "文件",
|
||||
"暂存": "暂存",
|
||||
"提 交": "提 交",
|
||||
"撤回": "撤回",
|
||||
"退回": "退回",
|
||||
"终止": "终止",
|
||||
"审批通过": "审批通过",
|
||||
"完成维修": "完成维修",
|
||||
"完成验收": "完成验收",
|
||||
"验收未通过": "验收未通过",
|
||||
},
|
||||
"validate": {
|
||||
"不能为空": "不能为空",
|
||||
"格式不正确": "格式不正确",
|
||||
"长度不正确": "长度不正确",
|
||||
"范围不正确": "范围不正确",
|
||||
"最大值为": "最大值为",
|
||||
"最小值为": "最小值为",
|
||||
"最小针数不能大于最大针数": "最小针数不能大于最大针数",
|
||||
"开始时间不能大于结束时间": "开始时间不能大于结束时间",
|
||||
"开始日期不能大于结束日期": "开始日期不能大于结束日期",
|
||||
},
|
||||
"tip": {
|
||||
"确定删除选中记录?": "确定删除选中记录?",
|
||||
"请上传": "请上传",
|
||||
"大小不超过": "大小不超过",
|
||||
"格式为": "格式为",
|
||||
"的文件": "的文件",
|
||||
'选取文件': '选取文件',
|
||||
"是否确定下发生产任务?": "是否确定下发生产任务?",
|
||||
"是否确定解绑当前设备?": "是否确定解绑当前设备?",
|
||||
"是否确定暂停当前生产任务?": "是否确定暂停当前生产任务?",
|
||||
"确定要" : "确定要 ",
|
||||
},
|
||||
"login": {
|
||||
"标题": "机器物联管理系统",
|
||||
"用户登录": "用户登录",
|
||||
"登录": "登录",
|
||||
"账号": "账号",
|
||||
"密码": "密码",
|
||||
"验证码": "验证码",
|
||||
"记住密码": "记住密码",
|
||||
"登录中": "登录中...",
|
||||
"立即注册": "立即注册",
|
||||
"版权": "Copyright © 天津市再登软件有限公司 版权所有"
|
||||
},
|
||||
"tagsView": {
|
||||
"隐藏搜索": "隐藏搜索",
|
||||
"显示搜索": "显示搜索",
|
||||
"显隐列": "显隐列",
|
||||
"刷新": "刷新",
|
||||
"关闭": "关闭",
|
||||
"关闭其它": "关闭其它",
|
||||
"关闭所有": "关闭所有",
|
||||
"显示": "显示",
|
||||
"隐藏": "隐藏",
|
||||
},
|
||||
"settings": {
|
||||
"title": "系统布局配置",
|
||||
"theme": "主题色",
|
||||
"tagsView": "开启 Tags-View",
|
||||
"fixedHeader": "固定 Header",
|
||||
"sidebarLogo": "侧边栏 Logo"
|
||||
},
|
||||
"home": {
|
||||
"员工总数": "员工总数",
|
||||
"设备总数": "设备总数",
|
||||
"产出进度": "产出进度",
|
||||
"设备": "设备",
|
||||
"使用中": "使用中",
|
||||
"停机": "停机",
|
||||
"总数": "总数",
|
||||
"工作人员": "工作人员",
|
||||
"加工信息": "加工信息",
|
||||
"产量": "产量",
|
||||
"稼动率": "稼动率",
|
||||
"设备利用率": "设备利用率",
|
||||
"设备状态": "设备状态",
|
||||
"台": "台",
|
||||
"人": "人",
|
||||
"张力值": "张力值",
|
||||
"张力": "张力",
|
||||
'针数': '针数',
|
||||
"针1": "针1",
|
||||
"针2": "针2",
|
||||
"任务信息": "任务信息",
|
||||
"产品完成率": "产品完成率",
|
||||
"实际产量": "实际产量",
|
||||
"目标产量": "目标产量",
|
||||
"在线数": "在线数",
|
||||
"件": "件",
|
||||
"工作": "工作",
|
||||
"待机": "待机",
|
||||
"急停": "急停",
|
||||
"故障总览": "故障总览",
|
||||
"维修": "维修",
|
||||
|
||||
},
|
||||
"user": {
|
||||
'人员信息': '人员信息',
|
||||
'操作员': '操作员',
|
||||
'人员ID': '人员ID',
|
||||
'员工姓名': '员工姓名',
|
||||
'员工编号': '员工编号',
|
||||
"个人信息": "个人信息",
|
||||
"用户名称": "用户名称",
|
||||
"手机号码": "手机号码",
|
||||
"用户邮箱": "用户邮箱",
|
||||
"所属部门": "所属部门",
|
||||
"所属角色": "所属角色",
|
||||
"创建日期": "创建日期",
|
||||
"基本资料": "基本资料",
|
||||
"修改密码": "修改密码",
|
||||
"用户昵称": "用户昵称",
|
||||
"男": "男",
|
||||
"女": "女",
|
||||
"旧密码": "旧密码",
|
||||
"新密码": "新密码",
|
||||
"确认密码": "确认密码",
|
||||
|
||||
},
|
||||
"device": {
|
||||
"设备": "设备",
|
||||
"设备信息": "设备信息",
|
||||
"设备名称": "设备名称",
|
||||
"设备编码": "设备编码",
|
||||
"设备类型": "设备类型",
|
||||
"车间名称": "车间名称",
|
||||
"产线名称": "产线名称",
|
||||
"保养周期": "保养周期",
|
||||
"供货商名称": "供货商名称",
|
||||
"供货商联络人": "供货商联络人",
|
||||
"生产厂家": "生产厂家",
|
||||
"联系电话": "联系电话",
|
||||
"品牌": "品牌",
|
||||
"设备型号": "设备型号",
|
||||
"备注": "备注",
|
||||
"图片": "图片",
|
||||
"运行时长": "运行时长",
|
||||
"工作时长": "工作时长",
|
||||
"设备版本": "设备版本",
|
||||
"厂家电话": "厂家电话",
|
||||
"负责人": "负责人",
|
||||
"生产日期": "生产日期",
|
||||
"投产日期": "投产日期",
|
||||
"设备位置": "设备位置",
|
||||
"机头数": "机头数",
|
||||
"设备详情": "设备详情",
|
||||
"设备信息": "设备信息",
|
||||
"配置信息": "配置信息",
|
||||
"其他信息": "其他信息",
|
||||
"联系人": "联系人",
|
||||
"供应商电话": "供应商电话",
|
||||
"备注信息": "备注信息",
|
||||
"设备图片": "设备图片",
|
||||
"保养手册": "保养手册",
|
||||
"类型名称": "类型名称",
|
||||
"关联配置": "关联配置",
|
||||
"配置名称": "配置名称",
|
||||
"设备配置": "设备配置",
|
||||
"操作时间": "操作时间",
|
||||
"操作类型": "操作类型",
|
||||
"操作位置": "操作位置",
|
||||
"操作时长": "操作时长",
|
||||
"设备故障率": "设备故障率",
|
||||
"工作头数": "工作头数",
|
||||
},
|
||||
"pms": {
|
||||
"项目编码": "项目编码",
|
||||
"项目名称": "项目名称",
|
||||
"项目类型": "项目类型",
|
||||
"项目内容": "项目内容",
|
||||
"标准": "标准",
|
||||
"点检保养项目": "点检保养项目",
|
||||
'计划编码': '计划编码',
|
||||
'计划名称': '计划名称',
|
||||
"计划类型": "计划类型",
|
||||
"草稿": "草稿",
|
||||
"开始日期": "开始日期",
|
||||
"结束日期": "结束日期",
|
||||
"频率": "频率",
|
||||
'点检': '点检',
|
||||
'保养': '保养',
|
||||
"周": "周",
|
||||
"月": "月",
|
||||
"设备点检": "设备点检",
|
||||
"设备保养": "设备保养",
|
||||
'次数': '次数',
|
||||
'计划': '计划',
|
||||
"执行单编码": "执行单编码",
|
||||
"执行人": "执行人",
|
||||
"实际执行时间": "实际执行时间",
|
||||
"计划执行时间": "计划执行时间",
|
||||
"最晚执行时间": "最晚执行时间",
|
||||
"执行提醒": "执行提醒",
|
||||
"待执行": "待执行",
|
||||
"维修单编号": "维修单编号",
|
||||
"维修单名称": "维修单名称",
|
||||
"维修结果": "维修结果",
|
||||
"单据状态": "单据状态",
|
||||
"报修日期": "报修日期",
|
||||
"维修完成日期": "维修完成日期",
|
||||
"验收日期": "验收日期",
|
||||
"维修人员": "维修人员",
|
||||
"验收人员": "验收人员",
|
||||
"记录": "记录",
|
||||
"最晚维修日期": "最晚维修日期",
|
||||
"报修备注": "报修备注",
|
||||
"审核备注": "审核备注",
|
||||
"维修备注": "维修备注",
|
||||
"验收备注": "验收备注",
|
||||
"维修成功": "维修成功",
|
||||
"维修失败": "维修失败",
|
||||
"维修内容": "维修内容",
|
||||
"故障描述": "故障描述",
|
||||
"故障描述内容": "故障描述内容",
|
||||
"维修情况": "维修情况",
|
||||
"设备维修单": "设备维修单",
|
||||
},
|
||||
"product": {
|
||||
"产品信息": "产品信息",
|
||||
"产品名称": "产品名称",
|
||||
"产品编码": "产品编码",
|
||||
"产品类型": "产品类型",
|
||||
"备注": "备注",
|
||||
"图片": "图片",
|
||||
"底线编码": "底线编码",
|
||||
"面线编码": "面线编码",
|
||||
"表面张力": "表面张力",
|
||||
"最小张力": "最小张力",
|
||||
"最大张力": "最大张力",
|
||||
"最小值": "最小值",
|
||||
"最大值": "最大值",
|
||||
"最小针数": "最小针数",
|
||||
"最大针数": "最大针数",
|
||||
"缝纫次数": "缝纫次数",
|
||||
"针号": "针号",
|
||||
"面线信息": "面线信息",
|
||||
"底线信息": "底线信息",
|
||||
"梭芯信息": "梭芯信息",
|
||||
"排序": "排序",
|
||||
"类型": "类型",
|
||||
"第几针": "第几针",
|
||||
"步骤": "步骤",
|
||||
"二维码": "二维码",
|
||||
"编码": "编码",
|
||||
"总针数": "总针数",
|
||||
"花样名称": "花样名称",
|
||||
"针数": "针数",
|
||||
"花色": "花色",
|
||||
"产品序列号": "产品序列号",
|
||||
"底线材质": "底线材质",
|
||||
"面线材质": "面线材质",
|
||||
"花样附件": "花样附件",
|
||||
"附件名称": "附件名称",
|
||||
"附件编码": "附件编码",
|
||||
"附件图片": "附件图片",
|
||||
"附件文件": "附件文件",
|
||||
"当前针数": "当前针数",
|
||||
"合格样板": "合格样板",
|
||||
},
|
||||
"produce": {
|
||||
"产品编码": "产品编码",
|
||||
"设备编码": "设备编码",
|
||||
"员工编号": "员工编号",
|
||||
"目标产量": "目标产量",
|
||||
"当前产量": "当前产量",
|
||||
"开始时间": "开始时间",
|
||||
"结束时间": "结束时间",
|
||||
"批次": "批次",
|
||||
"备注": "备注",
|
||||
"状态": "状态",
|
||||
"二维码": "二维码",
|
||||
"获取二维码": "获取二维码",
|
||||
"生产信息": "生产信息",
|
||||
"操作员编号": "操作员编号",
|
||||
"操作人员": "操作人员",
|
||||
"工作进度": "工作进度",
|
||||
"待机时长": "待机时长",
|
||||
"产品状态": "产品状态",
|
||||
"宽度": "宽度",
|
||||
"高度": "高度",
|
||||
"当前色序": "当前色序",
|
||||
"总色序数": "总色序数",
|
||||
},
|
||||
"quality": {
|
||||
"产品名称": "产品名称",
|
||||
"产品编码": "产品编码",
|
||||
"产品序列号": "产品序列号",
|
||||
"员工姓名": "员工姓名",
|
||||
"设备名称": "设备名称",
|
||||
"开始时间": "开始时间",
|
||||
"完成时间": "完成时间",
|
||||
"状态": "状态",
|
||||
"产品合格率": "产品合格率",
|
||||
"产品不合格率": "产品不合格率",
|
||||
"产品完成量": "产品完成量",
|
||||
}
|
||||
}
|
30
src/lang/i18n.js
Normal file
30
src/lang/i18n.js
Normal file
@ -0,0 +1,30 @@
|
||||
// I18n
|
||||
import { createI18n } from 'vue-i18n'
|
||||
|
||||
import { getStoredLanguage, saveStoredLanguage } from "@/utils/languageStorage";
|
||||
// 引入 elementui 的多语言
|
||||
import zhLocale from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import enLocale from 'element-plus/dist/locale/en.mjs'
|
||||
// 如果还有新的语言在下面继续添加
|
||||
|
||||
// 引入自己定义的 I18n 文件
|
||||
import myI18nEn from './i18n-en-US'
|
||||
import myI18nZh from './i18n-zh-CN'
|
||||
// 如果还有新的语言在下面继续添加
|
||||
|
||||
// 默认中文
|
||||
const defaultLocale = "zh-CN";
|
||||
const storedLocale = getStoredLanguage() || defaultLocale;
|
||||
const i18n = createI18n({
|
||||
globalInjection: true, //全局生效$t
|
||||
locale: storedLocale,
|
||||
legacy: false, // 解决legacy mode 报错
|
||||
messages: {
|
||||
// 会把myI18nZh的所有内容拷贝到zhCnLocale文件中
|
||||
'zh-CN': Object.assign(zhLocale, myI18nZh),
|
||||
'en-US': Object.assign(enLocale, myI18nEn),
|
||||
// 如果还有新的语言在下面继续添加
|
||||
}
|
||||
})
|
||||
|
||||
export default i18n;
|
@ -17,7 +17,9 @@
|
||||
</el-tooltip> -->
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
|
||||
<el-tooltip :content="tLang('common','选择语言')" effect="dark" placement="bottom">
|
||||
<lang-select id="lang-select" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||
</el-tooltip> -->
|
||||
@ -53,6 +55,7 @@ import Breadcrumb from '@/components/Breadcrumb'
|
||||
import TopNav from '@/components/TopNav'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
import LangSelect from '@/components/LangSelect'
|
||||
import SizeSelect from '@/components/SizeSelect'
|
||||
import HeaderSearch from '@/components/HeaderSearch'
|
||||
import RuoYiGit from '@/components/RuoYi/Git'
|
||||
|
22
src/main.js
22
src/main.js
@ -3,7 +3,8 @@ import { createApp } from 'vue'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
import ElementPlus from 'element-plus'
|
||||
import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言
|
||||
import zhLocale from 'element-plus/es/locale/lang/zh-cn'
|
||||
import enLocale from 'element-plus/es/locale/lang/en'
|
||||
|
||||
import '@/assets/styles/index.scss' // global css
|
||||
|
||||
@ -56,6 +57,8 @@ import 'virtual:svg-icons-register'
|
||||
import SvgIcon from '@/components/SvgIcon'
|
||||
import elementIcons from '@/components/SvgIcon/svgicon'
|
||||
|
||||
// i18n js
|
||||
import i18n from './lang/i18n.js'
|
||||
import './permission' // permission control
|
||||
|
||||
import { useDict } from '@/utils/dict'
|
||||
@ -80,6 +83,13 @@ import DictTag from '@/components/DictTag'
|
||||
//dialog组件
|
||||
import BaseDialog from '@/components/BaseDialog'
|
||||
|
||||
|
||||
import { getStoredLanguage, saveStoredLanguage } from "@/utils/languageStorage";
|
||||
//引入iconfont
|
||||
import './assets/iconfont/iconfont.css'
|
||||
|
||||
// 设置语言
|
||||
let locale = getStoredLanguage() === 'en-US' ? enLocale : zhLocale
|
||||
const app = createApp(App)
|
||||
|
||||
// 全局方法挂载
|
||||
@ -92,6 +102,15 @@ app.config.globalProperties.handleTree = handleTree
|
||||
app.config.globalProperties.addDateRange = addDateRange
|
||||
app.config.globalProperties.selectDictLabel = selectDictLabel
|
||||
app.config.globalProperties.selectDictLabels = selectDictLabels
|
||||
// 此段代码写入main.js中
|
||||
app.config.globalProperties.$t = i18n.global.t
|
||||
app.config.globalProperties.$te = i18n.global.te
|
||||
app.config.globalProperties.tLang = (parent, item) => {
|
||||
if (i18n.global.te(parent + "." + item)) {
|
||||
return i18n.global.t(parent + "." + item)
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
// 全局组件挂载
|
||||
app.component('DictTag', DictTag)
|
||||
@ -108,6 +127,7 @@ app.component('v-chart', VECharts)
|
||||
|
||||
app.use(router)
|
||||
app.use(store)
|
||||
app.use(i18n)
|
||||
app.use(plugins)
|
||||
app.use(elementIcons)
|
||||
app.component('svg-icon', SvgIcon)
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Cookies from 'js-cookie'
|
||||
import { getStoredLanguage, saveStoredLanguage } from "@/utils/languageStorage";
|
||||
|
||||
const useAppStore = defineStore(
|
||||
'app',
|
||||
@ -10,7 +11,8 @@ const useAppStore = defineStore(
|
||||
hide: false
|
||||
},
|
||||
device: 'desktop',
|
||||
size: Cookies.get('size') || 'default'
|
||||
size: Cookies.get('size') || 'default',
|
||||
lang: getStoredLanguage() || 'zh-CN'
|
||||
}),
|
||||
actions: {
|
||||
toggleSideBar(withoutAnimation) {
|
||||
@ -37,6 +39,10 @@ const useAppStore = defineStore(
|
||||
this.size = size;
|
||||
Cookies.set('size', size)
|
||||
},
|
||||
setLang(lang) {
|
||||
this.lang = lang;
|
||||
saveStoredLanguage(lang)
|
||||
},
|
||||
toggleSideBarHide(status) {
|
||||
this.sidebar.hide = status
|
||||
}
|
||||
|
17
src/utils/languageStorage.js
Normal file
17
src/utils/languageStorage.js
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
//获取用户保存的语言首选项
|
||||
export function getStoredLanguage() {
|
||||
return localStorage.getItem("selectedLanguage");
|
||||
}
|
||||
//保存新的语言选择
|
||||
export function saveStoredLanguage(language) {
|
||||
localStorage.setItem("selectedLanguage", language);
|
||||
}
|
||||
|
||||
export function languageHash(language) {
|
||||
return {
|
||||
en: "English/USD",
|
||||
zh: "简体中文",
|
||||
es: "Spanish/USD",
|
||||
}[language];
|
||||
}
|
251
src/views/device/devConfig/index.vue
Normal file
251
src/views/device/devConfig/index.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item :label="tLang('device', '配置名称')" prop="name">
|
||||
<el-input v-model="queryParams.name" :placeholder="tLang('common', '请输入') + tLang('device', '配置名称')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" size="mini" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="refresh" size="mini" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" size="mini" @click="handleAdd" v-hasPermi="['pms:devConfig:add']">{{
|
||||
$t('common.新增') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:devConfig:edit']">{{ $t('common.修改') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:devConfig:remove']">{{ $t('common.删除') }}</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['device:devConfig:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" :label="$t('common.序号')" width="60" align="center" />
|
||||
<el-table-column :label="tLang('device', '配置名称')" align="center" v-if="columns[0].visible" prop="name" />
|
||||
<el-table-column :label="tLang('common', '操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="tLang('common', '修改')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:devConfig:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="tLang('common', '删除')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:devConfig:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination">
|
||||
<el-pagination :hide-on-single-page="true" v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize" :page-sizes="[25, 50, 100, 150]"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getList"
|
||||
@current-change="getList" />
|
||||
</div>
|
||||
|
||||
<!-- 添加或修改设备信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="150px">
|
||||
<!-- <el-form-item :label="tLang('device', '配置编码')" prop="code">
|
||||
<el-input v-model="form.code" :placeholder="tLang('common', '请输入') + tLang('device', '配置编码')" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="tLang('device', '配置名称')" prop="name">
|
||||
<el-input v-model="form.name" :placeholder="tLang('common', '请输入') + tLang('device', '配置名称')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">{{ tLang('common', '确 定') }}</el-button>
|
||||
<el-button @click="cancel">{{ tLang('common', '取 消') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, onMounted } from 'vue'
|
||||
import { listDeviceConfig, getDeviceConfig, addDeviceConfig, updateDeviceConfig, delDeviceConfig } from "@/api/pms/device.js";
|
||||
const { proxy } = getCurrentInstance();
|
||||
// 遮罩层
|
||||
let loading = ref(true)
|
||||
// 选中数组
|
||||
let ids = ref([])
|
||||
// 非单个禁用
|
||||
let single = ref(true)
|
||||
// 非多个禁用
|
||||
let multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
let showSearch = ref(false)
|
||||
// 总条数
|
||||
let total = ref(0)
|
||||
// 设备信息表格数据
|
||||
let deviceList = ref([])
|
||||
// 弹出层标题
|
||||
let title = ref("")
|
||||
// 是否显示弹出层
|
||||
let open = ref(false)
|
||||
let infoDialog = ref(false)
|
||||
let deviceinfo = ref({})
|
||||
// 查询参数
|
||||
let queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
})
|
||||
// 表单参数
|
||||
let form = ref({})
|
||||
const formRef = ref(null)
|
||||
// 表单校验
|
||||
let rules = ref({
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: proxy.tLang('common', '请输入') + proxy.tLang('device', '配置名称'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
})
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
{ key: 0, label: proxy.tLang('device', `设备名称`), visible: true },
|
||||
]);
|
||||
/** 查询设备配置信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listDeviceConfig(queryParams).then(response => {
|
||||
deviceList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
name: null,
|
||||
code: null
|
||||
};
|
||||
//resetForm("form");
|
||||
}
|
||||
|
||||
//** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryParams.pageNum = 1
|
||||
queryParams.pageSize = 10
|
||||
queryParams.name = null
|
||||
|
||||
handleQuery();
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.code)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/**详情按钮操作 */
|
||||
function handleInfo(row) {
|
||||
deviceinfo.value = row
|
||||
infoDialog.value = true
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common', '添加') + ' ' + proxy.tLang('device', '设备配置');
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.code || ids.value
|
||||
getDeviceConfig(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common', '修改') + ' ' + proxy.tLang('device', '设备配置');
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.code != null) {
|
||||
updateDeviceConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDeviceConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '新增成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const id = row.code || ids.value;
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '确定删除选中记录?') + ` [${id}]`).then(function () {
|
||||
return delDeviceConfig(id);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '删除成功'));
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
this.download('casm/device/export', {
|
||||
...queryParams
|
||||
}, `device_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.demo-form-inline :deep(.el-input) {
|
||||
--el-input-width: 220px;
|
||||
}
|
||||
|
||||
.demo-form-inlinee :deep(.el-select) {
|
||||
--el-select-width: 220px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
85
src/views/device/devType/add_edit.vue
Normal file
85
src/views/device/devType/add_edit.vue
Normal file
@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" :title="props.title" @close="close" width="800" @open="getListDeviceConfig">
|
||||
<el-form ref="formRef" :model="props.form" :rules="rules" label-width="150px">
|
||||
<el-form-item :label="tLang('device', '类型名称')" prop="name">
|
||||
<el-input v-model="props.form.name" :placeholder="tLang('common', '请输入') + tLang('device', '类型名称')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device', '关联配置')" prop="defalutConfig">
|
||||
<el-select v-model="props.form.defalutConfig" multiple filterable :placeholder="tLang('common', '请选择')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">{{ tLang('common', '确 定') }}</el-button>
|
||||
<el-button @click="cancel">{{ tLang('common', '取 消') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { listDeviceConfig} from "@/api/pms/device.js";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits();
|
||||
const props = defineProps({
|
||||
modelValue: [String, Object, Array],
|
||||
title: String,
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const formRef = ref(null);
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
const rules = {
|
||||
deviceCode: [
|
||||
{ required: true, message: `${proxy.tLang('produce', '设备编码')} ` + proxy.tLang('validate', '不能为空'), trigger: "blur" }
|
||||
]
|
||||
}
|
||||
let loading = ref(false);
|
||||
const options = ref([]);
|
||||
|
||||
const getListDeviceConfig = (query) => {
|
||||
listDeviceConfig({pageSize:100}).then(res=>{
|
||||
loading.value = false
|
||||
options.value = res.rows.map(item => {
|
||||
return {
|
||||
value: item.code,
|
||||
label: item.name
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function validateStarttime(rule, value, callback) {
|
||||
let start = new Date(props.form.starttime).getTime();
|
||||
let end = new Date(props.form.endtime).getTime();
|
||||
if (start > end) {
|
||||
callback(new Error('开始时间不能大于结束时间'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
emit("update:modelValue", false);
|
||||
}
|
||||
function submitForm() {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
emit("submitForm", props.form);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function cancel() {
|
||||
emit("update:form", {});
|
||||
close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
217
src/views/device/devType/index.vue
Normal file
217
src/views/device/devType/index.vue
Normal file
@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"
|
||||
label-width="80px">
|
||||
<el-form-item :label="tLang('device', '类型名称')" prop="name">
|
||||
<el-input v-model="queryParams.name"
|
||||
:placeholder="tLang('common', '请输入') + tLang('device', '类型名称')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" size="mini"
|
||||
@click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="refresh" size="mini" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['pms:devType:add']">{{ tLang('common', '新增') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:devType:edit']">{{ tLang('common', '修改') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:devType:remove']">{{ tLang('common', '删除') }}</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['product:product:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="deviceTypeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" :label="tLang('common', '序号')" width="60" align="center" />
|
||||
<el-table-column :label="tLang('device', '类型名称')" v-if="columns[0].visible" align="center"
|
||||
prop="name" />
|
||||
<el-table-column :label="tLang('common', '操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="tLang('common', '修改')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:devType:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="tLang('common', '删除')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:devType:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination">
|
||||
<el-pagination :hide-on-single-page="true" v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize" :page-sizes="[25, 50, 100, 150]"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getList"
|
||||
@current-change="getList" />
|
||||
</div>
|
||||
<AddEdit :title="title" v-model="open" :form="form" @submitForm="submitForm"></AddEdit>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, onMounted } from 'vue'
|
||||
import { listDeviceType, getDeviceType, addDeviceType, updateDeviceType, delDeviceType } from "@/api/pms/device";
|
||||
import AddEdit from './add_edit.vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 遮罩层
|
||||
let loading = ref(true)
|
||||
// 选中数组
|
||||
let ids = ref([])
|
||||
// 非单个禁用
|
||||
let single = ref(true)
|
||||
// 非多个禁用
|
||||
let multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
let showSearch = ref(false)
|
||||
// 表单参数
|
||||
let form = ref({})
|
||||
// 是否显示弹出层
|
||||
let open = ref(false)
|
||||
// 弹出层标题
|
||||
let title = ref("")
|
||||
// 查询参数
|
||||
let queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
})
|
||||
|
||||
let total = ref(0)
|
||||
// 设备信息表格数据
|
||||
let deviceTypeList = ref([
|
||||
{ name: '设备1', code: 'code1', id: 1 },
|
||||
])
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
{ key: 0, label: proxy.tLang('produce', '类型名称'), visible: true },
|
||||
]);
|
||||
|
||||
const infoDialog = ref(false)
|
||||
let produceinfo = ref({})
|
||||
/** 查询设备信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listDeviceType(queryParams).then(response => {
|
||||
deviceTypeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.code)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
//** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryParams.pageNum = 1
|
||||
queryParams.pageSize = 10
|
||||
queryParams.name = null
|
||||
|
||||
handleQuery();
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common', '添加') + ' ' + proxy.tLang('device', '设备配置');
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm(propform) {
|
||||
form.value.defalutConfig = form.value.defalutConfig&&form.value.defalutConfig.length >0?form.value.defalutConfig.join(','):null;
|
||||
if (propform.code != null) {
|
||||
updateDeviceType(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDeviceType(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '新增成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
code: null,
|
||||
name: null,
|
||||
defalutConfig: null,
|
||||
};
|
||||
//resetForm("form");
|
||||
}
|
||||
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.code || ids.value
|
||||
getDeviceType(id).then(response => {
|
||||
form.value = response.data;
|
||||
if (form.value.defalutConfig) {
|
||||
form.value.defalutConfig = response.data.defalutConfig.split(",");
|
||||
} else {
|
||||
form.value.defalutConfig = []
|
||||
}
|
||||
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common', '修改') + ' ' + proxy.tLang('device', '设备配置');
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const id = row.code || ids.value;
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '确定删除选中记录?') + ` [${id}]`).then(function () {
|
||||
return delDeviceType(id);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '删除成功'));
|
||||
}).catch(() => { });
|
||||
}
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pagination {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
288
src/views/device/device/add_edit.vue
Normal file
288
src/views/device/device/add_edit.vue
Normal file
@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" :destroy-on-close="true" :title="props.title" @close="close" width="800"
|
||||
@open="dialogInit">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" class="demo-form-inline" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '设备名称')" prop="name">
|
||||
<el-input v-model="form.name" :placeholder="tLang('common', '请输入') + tLang('device', '设备名称')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '设备编码')" prop="code">
|
||||
<el-input v-model="form.code" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')"
|
||||
:disabled="form.id !== null" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '设备类型')" prop="type">
|
||||
<el-select v-model="form.type" :placeholder="tLang('common', '请选择') + tLang('device', '设备类型')"
|
||||
@change="devTypeChange" style="width: 200px">
|
||||
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '设备型号')" prop="model">
|
||||
<el-input v-model="form.model" :placeholder="tLang('common', '请输入') + tLang('device', '设备型号')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '设备版本')" prop="version">
|
||||
<el-input v-model="form.version" :placeholder="tLang('common', '请输入') + tLang('device', '设备版本')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '机头数')" prop="machineHead">
|
||||
<el-input-number v-model="form.machineHead" :min="1" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '负责人')" prop="director">
|
||||
<el-input v-model="form.director" :placeholder="tLang('common', '请输入') + tLang('device', '设备负责人')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '生产日期')" prop="manufactureDate">
|
||||
<el-date-picker clearable v-model="form.manufactureDate" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common', '请输入') + tLang('device', '生产日期')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '投产日期')" prop="commissionDate">
|
||||
<el-date-picker clearable v-model="form.commissionDate" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common', '请输入') + tLang('device', '投产日期')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '设备位置')" prop="deviceLocation">
|
||||
<el-input v-model="form.deviceLocation" :placeholder="tLang('common', '请输入') + tLang('device', '设备位置')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '生产厂家')" prop="manufacturer">
|
||||
<el-input v-model="form.manufacturer" :placeholder="tLang('common', '请输入') + tLang('device', '生产厂家')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '厂家电话')" prop="contactPhone">
|
||||
<el-input v-model="form.contactPhone" :placeholder="tLang('common', '请输入') + tLang('device', '联系电话')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '品牌')" prop="brand">
|
||||
<el-input v-model="form.brand" :placeholder="tLang('common', '请输入') + tLang('device', '品牌')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '供货商名称')" prop="supplier">
|
||||
<el-input v-model="form.supplier" :placeholder="tLang('common', '请输入') + tLang('device', '供货商名称')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '供货商联络人')" prop="supplierContactPerson">
|
||||
<el-input v-model="form.supplierContactPerson"
|
||||
:placeholder="tLang('common', '请输入') + tLang('device', '供货商联络人')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '供应商电话')" prop="supplierPhoneNumber">
|
||||
<el-input v-model="form.supplierPhoneNumber"
|
||||
:placeholder="tLang('common', '请输入') + tLang('device', '联系电话')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '产线名称')" prop="lineName">
|
||||
<el-input v-model="form.lineName" :placeholder="tLang('common', '请输入') + tLang('device', '产线名称')" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device', '保养周期')" prop="maintenance">
|
||||
<el-input v-model="form.maintenance" :placeholder="tLang('common', '请输入') + tLang('device', '保养周期')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-form-item :label="tLang('device', '图片')" prop="file">
|
||||
<image-upload v-model="form.file" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device', '保养手册')" prop="maintenanceManual">
|
||||
<file-upload v-model="form.maintenanceManual" :download="true" :fileType="[]" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device', '备注')" prop="remark">
|
||||
<el-input v-model="form.remark" :placeholder="tLang('common', '请输入') + tLang('device', '备注')" />
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-divider content-position="center">
|
||||
<el-form-item label="设备配置">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-select v-model="singleConfig" :placeholder="tLang('common', '请选择') + tLang('device', '设备配置')">
|
||||
<el-option v-for="item in configOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button @click="addDomain">添加配置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="8" v-for="(item, index) in form.configList" :key="item.code">
|
||||
<el-form-item :label="tLang('device', item.name)">
|
||||
<el-input v-model="item.value" :placeholder="tLang('common', '请输入') + tLang('device', item.name)">
|
||||
<template #suffix>
|
||||
<el-icon class="el-input__icon" @click="removeDomain(index)">
|
||||
<Close />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">{{ tLang('common', '确 定') }}</el-button>
|
||||
<el-button @click="cancel">{{ tLang('common', '取 消') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { listDeviceType, getNamesByType, listDeviceConfig } from "@/api/pms/device.js";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits();
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
title: String,
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const formRef = ref(null);
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
const rules = {
|
||||
name: [
|
||||
{ required: true, message: `${proxy.tLang('device', '设备名称')} ` + proxy.tLang('validate', '不能为空'), trigger: "blur" }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: `${proxy.tLang('device', '设备编码')} ` + proxy.tLang('validate', '不能为空'), trigger: "blur" }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: `${proxy.tLang('device', '设备类型')} ` + proxy.tLang('validate', '不能为空'), trigger: "change" }
|
||||
],
|
||||
director: [
|
||||
{ required: true, message: `${proxy.tLang('device', '负责人')} ` + proxy.tLang('validate', '不能为空'), trigger: "blur" }
|
||||
],
|
||||
}
|
||||
const configOptions = ref([]);
|
||||
const typeOptions = ref([]);
|
||||
const singleConfig = ref(null);
|
||||
function dialogInit() {
|
||||
getListDeviceConfig();
|
||||
getListDeviceType();
|
||||
}
|
||||
|
||||
function getListDeviceConfig(query) {
|
||||
listDeviceConfig({ pageSize: 100 }).then(res => {
|
||||
configOptions.value = res.rows.map(item => {
|
||||
return {
|
||||
value: item.code,
|
||||
label: item.name
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function getListDeviceType(query) {
|
||||
listDeviceType({ pageSize: 100 }).then(res => {
|
||||
typeOptions.value = res.rows.map(item => {
|
||||
return {
|
||||
value: item.code,
|
||||
label: item.name
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function devTypeChange(value) {
|
||||
console.log(value);
|
||||
getNamesByType(value).then(res => {
|
||||
if (res.code === 200) {
|
||||
props.form.configList = res.data.map(item => {
|
||||
return {
|
||||
code: item.code,
|
||||
name: item.name,
|
||||
value: ''
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
//添加配置
|
||||
function addDomain() {
|
||||
if (singleConfig) {
|
||||
let domain = configOptions.value.find(item => item.value === singleConfig.value);
|
||||
let index = props.form.configList.findIndex(item => item.code === domain.value);
|
||||
if (index > -1) {
|
||||
return;
|
||||
}
|
||||
props.form.configList.push({
|
||||
code: domain.value,
|
||||
name: domain.label,
|
||||
value: ''
|
||||
});
|
||||
}
|
||||
}
|
||||
//删除配置
|
||||
function removeDomain(domain) {
|
||||
props.form.configList.splice(domain, 1);
|
||||
}
|
||||
function close() {
|
||||
emit("update:modelValue", false);
|
||||
}
|
||||
function submitForm() {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
emit("submitForm", props.form);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function cancel() {
|
||||
emit("update:form", {});
|
||||
close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-input__icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
405
src/views/device/device/index.vue
Normal file
405
src/views/device/device/index.vue
Normal file
@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item :label="tLang('device', '设备名称')" prop="name">
|
||||
<el-input v-model="queryParams.name" :placeholder="tLang('common', '请输入') + tLang('device', '设备名称')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device', '设备编码')" prop="code">
|
||||
<el-input v-model="queryParams.code" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device', '车间名称')" prop="workShop">
|
||||
<el-input v-model="queryParams.workShop" :placeholder="tLang('common', '请输入') + tLang('device', '车间名称')"
|
||||
clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device', '产线名称')" prop="lineName">
|
||||
<el-input v-model="queryParams.lineName" :placeholder="tLang('common', '请输入') + tLang('device', '产线名称')"
|
||||
clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="tLang('device', '供货商名称')" prop="supplier" label-width="100px">
|
||||
<el-input v-model="queryParams.supplier" :placeholder="tLang('common', '请输入') + tLang('device', '供货商名称')"
|
||||
clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="tLang('device', '生产厂家')" prop="manufacturer">
|
||||
<el-input v-model="queryParams.manufacturer" :placeholder="tLang('common', '请输入') + tLang('device', '生产厂家')"
|
||||
clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="tLang('device', '品牌')" prop="brand">
|
||||
<el-input v-model="queryParams.brand" :placeholder="tLang('common', '请输入') + tLang('device', '品牌')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="针数" prop="needleNum">
|
||||
<el-input v-model="queryParams.needleNum" :placeholder="tLang('common','请输入') + 针数" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="tLang('device', '设备型号')" prop="model">
|
||||
<el-input v-model="queryParams.model" :placeholder="tLang('common', '请输入') + tLang('device', '设备型号')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" @click="handleAdd" v-hasPermi="['pms:device:add']">
|
||||
{{ $t('common.新增') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:device:edit']">{{ $t('common.修改') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:device:remove']">{{ $t('common.删除') }}</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="download" @click="handleExport"
|
||||
v-hasPermi="['device:device:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" :label="$t('common.序号')" width="60" align="center" />
|
||||
<el-table-column :label="tLang('device', '设备名称')" align="center" v-if="columns[0].visible" prop="name" />
|
||||
<el-table-column :label="tLang('device', '设备编码')" align="center" v-if="columns[1].visible" prop="code" />
|
||||
<el-table-column :label="tLang('device', '设备类型')" align="center" v-if="columns[2].visible" prop="type">
|
||||
<template #default="{ row }">
|
||||
<span>{{ typeOptions.find(item => item.value == row.type)?.label }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('device', '设备型号')" align="center" v-if="columns[3].visible" prop="model" />
|
||||
<el-table-column :label="tLang('device', '设备版本')" align="center" v-if="columns[4].visible" prop="version" />
|
||||
<el-table-column :label="tLang('device', '保养周期')" align="center" v-if="columns[5].visible" prop="maintenance" />
|
||||
<el-table-column :label="tLang('device', '供货商名称')" align="center" v-if="columns[6].visible" prop="supplier" />
|
||||
<el-table-column :label="tLang('device', '供货商联络人')" align="center" v-if="columns[7].visible"
|
||||
prop="supplierContactPerson" />
|
||||
<el-table-column :label="tLang('device', '生产厂家')" align="center" v-if="columns[8].visible" prop="manufacturer" />
|
||||
<el-table-column :label="tLang('device', '厂家电话')" align="center" v-if="columns[9].visible"
|
||||
prop="contactPhone" />
|
||||
<el-table-column :label="tLang('device', '品牌')" align="center" v-if="columns[10].visible" prop="brand" />
|
||||
<!-- <el-table-column :label="tLang('device', '设备型号')" align="center" v-if="columns[11].visible" prop="model" /> -->
|
||||
<el-table-column :label="tLang('device', '负责人')" align="center" v-if="columns[11].visible" prop="director" />
|
||||
<el-table-column :label="tLang('device', '备注')" align="center" v-if="columns[12].visible" prop="remark" />
|
||||
<el-table-column :label="tLang('common', '操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="tLang('common', '下载报表')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Download" @click="handleDownload(scope.row)"
|
||||
v-hasPermi="['pms:device:download']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="tLang('common', '详情')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Tickets" @click="handleInfo(scope.row)"
|
||||
v-hasPermi="['pms:device:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="tLang('common', '修改')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:device:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="tLang('common', '解绑')" placement="top" v-if="scope.row.sn&&scope.row.sn.length > 0">
|
||||
<el-button link type="primary" icon="Failed" @click="handleUnbind(scope.row)"
|
||||
v-hasPermi="['pms:device:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="tLang('common', '删除')" placement="top" v-if="scope.row.userId !== 1">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:device:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination">
|
||||
<el-pagination :hide-on-single-page="true" v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize" :page-sizes="[25, 50, 100, 150]"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getList"
|
||||
@current-change="getList" />
|
||||
</div>
|
||||
|
||||
<AddEdit :title="title" v-model="open" :form="form" @submitForm="submitForm"></AddEdit>
|
||||
<InfoVue v-model="infoDialog" :info="deviceinfo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, onMounted } from 'vue'
|
||||
import { listDevice, getDevice, delDevice, addDevice, updateDevice, listDeviceType,downloadDeviceReport,downloadDeviceReportFile } from "@/api/pms/device.js";
|
||||
import InfoVue from "./info.vue";
|
||||
import AddEdit from './add_edit.vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
// 遮罩层
|
||||
let loading = ref(true)
|
||||
// 选中数组
|
||||
let ids = ref([])
|
||||
// 非单个禁用
|
||||
let single = ref(true)
|
||||
// 非多个禁用
|
||||
let multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
let showSearch = ref(false)
|
||||
// 总条数
|
||||
let total = ref(0)
|
||||
// 设备信息表格数据
|
||||
let deviceList = ref([])
|
||||
// 弹出层标题
|
||||
let title = ref("")
|
||||
// 是否显示弹出层
|
||||
let open = ref(false)
|
||||
let infoDialog = ref(false)
|
||||
let deviceinfo = ref({})
|
||||
// 查询参数
|
||||
let queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
code: null,
|
||||
type: null,
|
||||
workShop: null,
|
||||
lineName: null,
|
||||
maintenance: null,
|
||||
supplier: null,
|
||||
supplierContactPerson: null,
|
||||
manufacturer: null,
|
||||
contactPhone: null,
|
||||
brand: null,
|
||||
// needleNum: null,
|
||||
model: null,
|
||||
file: null,
|
||||
})
|
||||
// 表单参数
|
||||
let form = ref({})
|
||||
const formRef = ref(null)
|
||||
// 表单校验
|
||||
let rules = ref({
|
||||
code: [
|
||||
{
|
||||
required: true,
|
||||
message: proxy.tLang('common', '请输入') + proxy.tLang('device', '设备编码'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: proxy.tLang('common', '请输入') + proxy.tLang('device', '设备名称'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
})
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
{ key: 0, label: proxy.tLang('device', `设备名称`), visible: true },
|
||||
{ key: 1, label: proxy.tLang('device', `设备编码`), visible: true },
|
||||
{ key: 2, label: proxy.tLang('device', `设备类型`), visible: true },
|
||||
{ key: 3, label: proxy.tLang('device', `设备型号`), visible: false },
|
||||
{ key: 4, label: proxy.tLang('device', `设备版本`), visible: true },
|
||||
{ key: 5, label: proxy.tLang('device', `保养周期`), visible: true },
|
||||
{ key: 6, label: proxy.tLang('device', `供货商名称`), visible: true },
|
||||
{ key: 7, label: proxy.tLang('device', `供货商联络人`), visible: true },
|
||||
{ key: 8, label: proxy.tLang('device', `生产厂家`), visible: true },
|
||||
{ key: 9, label: proxy.tLang('device', `联系电话`), visible: true },
|
||||
{ key: 10, label: proxy.tLang('device', `品牌`), visible: true },
|
||||
{ key: 11, label: proxy.tLang('device', `负责人`), visible: true },
|
||||
{ key: 12, label: proxy.tLang('device', `备注`), visible: false },
|
||||
]);
|
||||
/** 查询设备信息列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listDevice(queryParams).then(response => {
|
||||
deviceList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
let typeOptions = ref([])
|
||||
function getListDeviceType() {
|
||||
listDeviceType({ pageSize: 100 }).then(res => {
|
||||
typeOptions.value = res.rows.map(item => {
|
||||
return {
|
||||
value: item.code,
|
||||
label: item.name
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//下载
|
||||
function handleDownload(row) {
|
||||
downloadDeviceReport(row.id).then(res => {
|
||||
// downloadDeviceReportFile(row.code).then(result=>{
|
||||
|
||||
// })
|
||||
// const blob = new Blob([baseUrl + res.msg])
|
||||
const url = baseUrl + res.msg
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
link.setAttribute('download', `${row.code}`)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
})
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
name: null,
|
||||
code: null,
|
||||
workShop: null,
|
||||
lineName: null,
|
||||
maintenance: null,
|
||||
supplier: null,
|
||||
supplierContactPerson: null,
|
||||
manufacturer: null,
|
||||
machineHead: 1,
|
||||
contactPhone: null,
|
||||
brand: null,
|
||||
// needleNum: 1,
|
||||
model: null,
|
||||
file: null,
|
||||
remark: null,
|
||||
director: null,
|
||||
config: '',
|
||||
maintenanceManual: '',
|
||||
configList: [],
|
||||
};
|
||||
//resetForm("form");
|
||||
}
|
||||
|
||||
//** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryParams.pageNum = 1
|
||||
queryParams.pageSize = 10
|
||||
queryParams.name = null
|
||||
queryParams.code = null
|
||||
queryParams.type = null
|
||||
queryParams.workShop = null
|
||||
queryParams.lineName = null
|
||||
queryParams.maintenance = null
|
||||
queryParams.supplier = null
|
||||
queryParams.supplierContactPerson = null
|
||||
queryParams.manufacturer = null
|
||||
queryParams.contactPhone = null
|
||||
queryParams.brand = null
|
||||
// queryParams.needleNum = null
|
||||
queryParams.model = null
|
||||
queryParams.file = null
|
||||
|
||||
handleQuery();
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/**详情按钮操作 */
|
||||
function handleInfo(row) {
|
||||
deviceinfo.value = JSON.parse(JSON.stringify(row))
|
||||
deviceinfo.value.config = JSON.parse(deviceinfo.value.config)
|
||||
infoDialog.value = true
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common', '添加') + ' ' + proxy.tLang('device', '设备信息');
|
||||
}
|
||||
|
||||
//解绑平板设备
|
||||
function handleUnbind(row) {
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '是否确定解绑当前设备?') + ` [${row.id}]`).then(function () {
|
||||
return updateDevice({id:row.id,sn:''});
|
||||
}).then(() => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '解绑成功'));
|
||||
getList();
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value
|
||||
getDevice(id).then(response => {
|
||||
form.value = response.data;
|
||||
form.value.configList = JSON.parse(form.value.config) || []
|
||||
form.value.type = parseInt(form.value.type)
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common', '修改') + ' ' + proxy.tLang('device', '设备信息');
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
form.value.config = JSON.stringify(form.value.configList)
|
||||
if (form.value.id != null) {
|
||||
updateDevice(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDevice(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '新增成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const id = row.id || ids.value;
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '确定删除选中记录?') + ` [${id}]`).then(function () {
|
||||
return delDevice(id);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '删除成功'));
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
this.download('casm/device/export', {
|
||||
...queryParams
|
||||
}, `device_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getListDeviceType()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.demo-form-inline :deep(.el-input) {
|
||||
--el-input-width: 220px;
|
||||
}
|
||||
|
||||
.demo-form-inlinee :deep(.el-select) {
|
||||
--el-select-width: 220px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
74
src/views/device/device/info.vue
Normal file
74
src/views/device/device/info.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" :title="tLang('device','设备详情')" @close="close" width="800">
|
||||
<el-descriptions :title="tLang('device','设备信息')">
|
||||
<el-descriptions-item :label="tLang('device','设备编码')">{{ props.info.code }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','设备名称')">{{ props.info.name }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','设备类型')">{{ props.info.type }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item :label="tLang('device','设备型号')">{{ props.info.model }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','设备版本')">{{ props.info.version }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','保养周期')">{{ props.info.maintenance }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item :label="tLang('device','机头数')">{{ props.info.machineHead }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','生产日期')">{{ props.info.manufactureDate }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','投产日期')">{{ props.info.commissionDate }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :title="tLang('device','配置信息')">
|
||||
<el-descriptions-item :label="item.name" v-for="(item,index) in props.info.config" :key="item.code">{{ item.value }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :title="tLang('device','其他信息')">
|
||||
<el-descriptions-item :label="tLang('device','生产厂家')">{{ props.info.manufacturer }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','品牌')">{{ props.info.brand }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','厂家电话')">{{ props.info.contactPhone }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item :label="tLang('device','供货商名称')">{{ props.info.supplier }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','联系人')">{{ props.info.supplierContactPerson }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','供应商电话')">{{ props.info.supplierPhoneNumber }}</el-descriptions-item>
|
||||
|
||||
|
||||
|
||||
<el-descriptions-item :label="tLang('device','设备型号')">{{ props.info.model }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','设备版本')">{{ props.info.version }}</el-descriptions-item>
|
||||
<el-descriptions-item :label="tLang('device','设备位置')">{{ props.info.deviceLocation }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="" column="1">
|
||||
<el-descriptions-item :label="tLang('device','备注信息')">{{ props.info.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="" column="">
|
||||
<el-descriptions-item :label="tLang('device','设备图片')">
|
||||
<div v-if="props.info.file && props.info.file.length > 0" style="width: 100%;display: flex;flex-direction: row;justify-content: center;">
|
||||
<el-image v-for="(item, index) in props.info?.file.split(',')" :key="index" :src="baseUrl + item"
|
||||
style="width: 100px; height: 100px; margin-right: 10px; margin-bottom: 10px"
|
||||
@click="dialogImageUrl = item; dialogVisible = true"></el-image>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="" column="">
|
||||
<el-descriptions-item :label="tLang('device','保养手册')">
|
||||
<div v-if="props.info.maintenanceManual && props.info.maintenanceManual.length > 0" style="width: 100%;display: flex;flex-direction: row;justify-content: center;">
|
||||
<el-link type="primary" download :href="baseUrl + item" v-for="(item, index) in props.info?.maintenanceManual.split(',')" style=" margin-right: 20px; margin-bottom: 10px" :key="index">{{ item.split("/").slice(-1)[0] }}</el-link>
|
||||
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
const emit = defineEmits(['update']);
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
info: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
let column = ref(2);
|
||||
function close() {
|
||||
emit("update:modelValue", false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
234
src/views/device/operationRecords/index.vue
Normal file
234
src/views/device/operationRecords/index.vue
Normal file
@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item :label="tLang('device', '设备编码')" prop="RackNumber">
|
||||
<el-input v-model="queryParams.RackNumber" :placeholder="tLang('common', '请输入') + tLang('device', '设备编码')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('user', '员工编号')" prop="userCode">
|
||||
<el-input v-model="queryParams.userCode" :placeholder="tLang('common', '请输入') + tLang('user', '员工编号')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['pms:operationRecords:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:operationRecords:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:operationRecords:remove']">删除</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['pms:operationRecords:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="operationRecordsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="$t('common.序号')" align="center" width="55" type="index" />
|
||||
<el-table-column :label="tLang('device', '设备名称')" align="center" prop="name" />
|
||||
<el-table-column :label="tLang('device', '设备编码')" prop="rackNumber" />
|
||||
<el-table-column :label="tLang('user', '员工编号')" align="center" prop="userCode" />
|
||||
<el-table-column :label="tLang('device', '操作时间')" align="center" prop="operationTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.operationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('device', '操作类型')" align="center" prop="operationType" />
|
||||
<el-table-column :label="tLang('device', '操作位置')" align="center" prop="deviceLocation" />
|
||||
<el-table-column :label="tLang('device', '操作时长') + '(min)'" align="center" prop="operationTimeCounts" />
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:operationRecords:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:operationRecords:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改设备操作记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="operationRecordsRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="机架号" prop="RackNumber">
|
||||
<el-input v-model="form.RackNumber" placeholder="请输入机架号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="人员编码" prop="userCode">
|
||||
<el-input v-model="form.userCode" placeholder="请输入人员编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作时间" prop="operationTime">
|
||||
<el-date-picker clearable v-model="form.operationTime" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择操作时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作位置" prop="deviceLocation">
|
||||
<el-input v-model="form.deviceLocation" placeholder="请输入操作位置" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作时长" prop="operationTimeCounts">
|
||||
<el-input v-model="form.operationTimeCounts" placeholder="请输入操作时长" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="OperationRecords">
|
||||
import { listOperationRecords, getOperationRecords, delOperationRecords, addOperationRecords, updateOperationRecords } from "@/api/pms/operationRecords";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const operationRecordsList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(false);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
RackNumber: null,
|
||||
userCode: null,
|
||||
operationTime: null,
|
||||
operationType: null,
|
||||
deviceLocation: null,
|
||||
operationTimeCounts: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询设备操作记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listOperationRecords(queryParams.value).then(response => {
|
||||
operationRecordsList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
RackNumber: null,
|
||||
userCode: null,
|
||||
operationTime: null,
|
||||
operationType: null,
|
||||
deviceLocation: null,
|
||||
operationTimeCounts: null
|
||||
};
|
||||
proxy.resetForm("operationRecordsRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加设备操作记录";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getOperationRecords(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改设备操作记录";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["operationRecordsRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateOperationRecords(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addOperationRecords(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除设备操作记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delOperationRecords(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('pms/operationRecords/export', {
|
||||
...queryParams.value
|
||||
}, `operationRecords_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
246
src/views/device/updateRecord/index.vue
Normal file
246
src/views/device/updateRecord/index.vue
Normal file
@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="关联的计划" prop="upgradeId">
|
||||
<el-input v-model="queryParams.upgradeId" placeholder="请输入关联的计划" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人员" prop="operator">
|
||||
<el-input v-model="queryParams.operator" placeholder="请输入更新人员" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本" prop="version">
|
||||
<el-input v-model="queryParams.version" placeholder="请输入版本" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['pms:records:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:records:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:records:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['pms:records:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" :label="$t('common.序号')" width="60" align="center" />
|
||||
<el-table-column label="关联的计划" align="center" prop="upgradeId" >
|
||||
<template #default="scope">
|
||||
{{ upgradeList.find(item => item.id === scope.row.upgradeId)?.upgradePlan }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新内容" align="center" prop="updateContent" />
|
||||
<el-table-column label="更新人员" align="center" prop="operator" />
|
||||
<el-table-column label="版本" align="center" prop="version" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:records:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:records:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改设备软硬件升级记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="recordsRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="关联的计划" prop="upgradeId">
|
||||
<el-select v-model="form.upgradeId" filterable placeholder="请选择关联的计划" style="width: 240px">
|
||||
<el-option v-for="item in upgradeList" :key="item.id" :label="item.upgradePlan" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新内容">
|
||||
<el-input v-model="form.updateContent" style="width: 6000px" :rows="5" type="textarea"
|
||||
placeholder="请输入更新内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人员" prop="operator">
|
||||
<el-input v-model="form.operator" placeholder="请输入更新人员" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本" prop="version">
|
||||
<el-input v-model="form.version" placeholder="请输入版本" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Records">
|
||||
import { listRecords, getRecords, delRecords, addRecords, updateRecords } from "@/api/pms/updateRecord";
|
||||
import { listUpgrade } from "@/api/pms/upgrade";
|
||||
import Editor from "@/components/Editor";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const recordsList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
upgradeId: null,
|
||||
updateContent: null,
|
||||
operator: null,
|
||||
version: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询设备软硬件升级记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listRecords(queryParams.value).then(response => {
|
||||
recordsList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
let upgradeList = ref([]);
|
||||
/** 查询设备软硬件升级计划列表 */
|
||||
function getUpgradeList() {
|
||||
loading.value = true;
|
||||
let query = {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
flag: 1
|
||||
}
|
||||
listUpgrade(query).then(response => {
|
||||
upgradeList.value = response.rows;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
upgradeId: null,
|
||||
updateContent: null,
|
||||
updateTime: null,
|
||||
operator: null,
|
||||
version: null
|
||||
};
|
||||
proxy.resetForm("recordsRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加设备软硬件升级记录";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getRecords(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改设备软硬件升级记录";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["recordsRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateRecords(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addRecords(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除设备软硬件升级记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delRecords(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('pms/records/export', {
|
||||
...queryParams.value
|
||||
}, `records_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
getUpgradeList();
|
||||
</script>
|
277
src/views/device/upgrade/index.vue
Normal file
277
src/views/device/upgrade/index.vue
Normal file
@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="88px">
|
||||
<el-form-item label="升级计划" prop="upgradePlan">
|
||||
<el-input
|
||||
v-model="queryParams.upgradePlan"
|
||||
placeholder="请输入升级计划"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="升级时间" prop="upgradeTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.upgradeTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择升级时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否已完成" prop="flag">
|
||||
<el-select v-model="queryParams.flag" placeholder="请选择是否已完成" clearable>
|
||||
<el-option
|
||||
v-for="dict in num_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['mf:upgrade:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['mf:upgrade:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['mf:upgrade:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['mf:upgrade:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="upgradeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" :label="$t('common.序号')" width="60" align="center" />
|
||||
<el-table-column label="升级计划" align="center" prop="upgradePlan" />
|
||||
<el-table-column label="升级时间" align="center" prop="upgradeTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.upgradeTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否已完成" align="center" prop="flag">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="num_yes_no" :value="scope.row.flag"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['mf:upgrade:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['mf:upgrade:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改设备软硬件升级计划对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="upgradeRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="升级计划" prop="upgradePlan">
|
||||
<el-input v-model="form.upgradePlan" placeholder="请输入升级计划" />
|
||||
</el-form-item>
|
||||
<el-form-item label="升级时间" prop="upgradeTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.upgradeTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择升级时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否已完成" prop="flag">
|
||||
<el-radio-group v-model="form.flag">
|
||||
<el-radio
|
||||
v-for="dict in num_yes_no"
|
||||
:key="dict.value"
|
||||
:label="parseInt(dict.value)"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Upgrade">
|
||||
import { listUpgrade, getUpgrade, delUpgrade, addUpgrade, updateUpgrade } from "@/api/pms/upgrade";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { num_yes_no } = proxy.useDict('num_yes_no');
|
||||
|
||||
const upgradeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
upgradePlan: null,
|
||||
upgradeTime: null,
|
||||
flag: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询设备软硬件升级计划列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listUpgrade(queryParams.value).then(response => {
|
||||
upgradeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
upgradePlan: null,
|
||||
upgradeTime: null,
|
||||
flag: 1
|
||||
};
|
||||
proxy.resetForm("upgradeRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加设备软硬件升级计划";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getUpgrade(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改设备软硬件升级计划";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["upgradeRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateUpgrade(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addUpgrade(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除设备软硬件升级计划编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delUpgrade(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('mf/upgrade/export', {
|
||||
...queryParams.value
|
||||
}, `upgrade_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">物联大屏管理系统</h3>
|
||||
<h3 class="title">微工厂设备物联管理系统</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
@ -76,7 +76,7 @@ const { proxy } = getCurrentInstance();
|
||||
|
||||
const loginForm = ref({
|
||||
username: "admin",
|
||||
password: "123456",
|
||||
password: "admin123",
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: ""
|
||||
|
565
src/views/pms/checkplan/index.vue
Normal file
565
src/views/pms/checkplan/index.vue
Normal file
@ -0,0 +1,565 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item :label="tLang('pms','计划编码')" prop="planCode">
|
||||
<el-input v-model="queryParams.planCode" :placeholder="tLang('common', '请输入') + tLang('pms', '计划编码')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','计划名称')" prop="planName">
|
||||
<el-input v-model="queryParams.planName" :placeholder="tLang('common', '请输入') + tLang('pms', '计划名称')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','计划类型')" prop="planType">
|
||||
<el-select v-model="queryParams.planType" :placeholder="tLang('common', '请选择') + tLang('pms', '计划类型')" clearable>
|
||||
<el-option v-for="dict in pms_plan_type" :key="dict.value" :label="tLang('pms',dict.label)" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('common','状态')" prop="status">
|
||||
<el-select v-model="queryParams.status" :placeholder="tLang('common', '请选择') + tLang('common', '状态')" clearable>
|
||||
<el-option key="PREPARE" :label="tLang('pms','草稿')" value="PREPARE" />
|
||||
<el-option key="FINISHED" :label="tLang('common','已完成')" value="FINISHED" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" @click="handleAdd"
|
||||
v-hasPermi="['mes:dv:checkplan:add']">{{ $t('common.新增') }}</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['mes:dv:checkplan:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['mes:dv:checkplan:remove']">删除</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="checkplanList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="tLang('pms','计划编码')" align="center" prop="planCode">
|
||||
<template #default="scope">
|
||||
<el-button type="text" @click="handleView(scope.row)" v-hasPermi="['mes:dv:checkplan:query']">{{
|
||||
scope.row.planCode }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','计划名称')" align="center" width="200px" prop="planName" />
|
||||
<el-table-column :label="tLang('pms','计划类型')" align="center" width="120px" prop="planType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_plan_type" :value="scope.row.planType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','开始日期')" align="center" prop="startDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','结束日期')" align="center" prop="endDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','频率')" align="center" prop="cycleType">
|
||||
<template #default="scope">
|
||||
{{ scope.row.cycleCount }}
|
||||
<dict-tag :options="pms_cycle_type" :value="scope.row.cycleType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('common','状态')" align="center" key="status">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('common','操作')" align="center" width="130px" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="text" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.status == '1'" v-hasPermi="['mes:dv:checkplan:edit']">{{ tLang('common', '修改') }}</el-button>
|
||||
<el-button size="small" type="text" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-if="scope.row.status == '1'" v-hasPermi="['mes:dv:checkplan:remove']">{{tLang('common', '删除')}}</el-button>
|
||||
<!-- <el-button size="small" type="text" icon="stopwatch" @click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.status == 'FINISHED'" v-hasPermi="['mes:dv:checkplan:edit']">停用</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改设备点检计划头对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="960px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px"
|
||||
:disabled="optType == 'view' || form.status == 'FINISHED'">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','计划编码')" prop="planCode">
|
||||
<el-input v-model="form.planCode" :placeholder="tLang('common', '请输入') + tLang('pms', '计划编码')" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-form-item label-width="10">
|
||||
<el-switch v-model="autoGenFlag" active-color="#13ce66" active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'&&optType != 'edit'">
|
||||
</el-switch>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','计划名称')" prop="planName">
|
||||
<el-input v-model="form.planName" :placeholder="tLang('common', '请输入') + tLang('pms', '计划名称')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','计划类型')" prop="planType">
|
||||
<el-select v-model="form.planType" :placeholder="tLang('common', '请选择') + tLang('pms', '计划类型')" @change="changePlanType">
|
||||
<el-option v-for="dict in pms_plan_type" :key="dict.value" :label="tLang('pms', dict.label)"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','频率')" prop="cycleCount">
|
||||
<el-input-number :min="1" :step="1" v-model="form.cycleCount" :placeholder="tLang('common', '请输入') + tLang('pms', '频率')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="cycleType" label-width="00">
|
||||
<el-select v-model="form.cycleType" >
|
||||
<el-option v-for="dict in pms_cycle_type" :key="dict.value" :label="tLang('pms', dict.label)"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device','设备名称')" prop="deviceId">
|
||||
<!-- <el-input v-model="form.deviceId" :placeholder="请选择设备" disabled>
|
||||
<el-button style="border-color: #46a6ff; background-color: #46a6ff;color: white;"
|
||||
slot="append" @click="handleMachineryAdd" icon="el-icon-search"></el-button>
|
||||
</el-input> -->
|
||||
<el-select v-model="form.deviceId" ::placeholder="tLang('common', '请选择') + tLang('device', '设备')">
|
||||
<el-option v-for="item in deviceList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-form-item label="设备名称" prop="machineryName">
|
||||
<el-input v-model="form.machineryName" :placeholder="请选择设备" disabled />
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="执行人" prop="checkUser">
|
||||
<el-input v-model="form.checkUser" :placeholder="请输入执行人" />
|
||||
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<!-- <el-select v-model="form.checkUser" filterable
|
||||
::placeholder="tLang('common', '请选择') + tLang('produce', '执行人')" style="width: 240px">
|
||||
<el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','开始日期')" prop="startDate">
|
||||
<el-date-picker clearable v-model="form.startDate" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common', '请选择') + tLang('pms', '开始日期')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','结束日期')" prop="endDate">
|
||||
<el-date-picker clearable v-model="form.endDate" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common', '请选择') + tLang('pms', '结束日期')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" disabled>
|
||||
<el-option v-for="dict in pms_order_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="tLang('device','备注')" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :placeholder="tLang('common', '请输入') + tLang('device', '备注')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane :label="form.planType == 'CHECK' ? tLang('pms','点检') : tLang('pms','保养')">
|
||||
<Checksubject ref="subjectlist" :subjectList="subjectList" :checksubjectList="form.subjects"
|
||||
:checkstatus="form.status" :optType="optType"></Checksubject>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm"
|
||||
v-if="form.status == 1 && optType != 'view'">{{ tLang('common','保存') }}</el-button>
|
||||
<!-- <el-button type="success" @click="handleFinish"
|
||||
v-if="form.status == 1 && optType != 'view' && form.id != null">启用</el-button>
|
||||
<el-button type="success" @click="handleDeFinish"
|
||||
v-if="form.status == 0 && optType != 'view' && form.id != null">停用</el-button> -->
|
||||
<el-button @click="cancel">{{tLang('common','取 消')}}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, getCurrentInstance } from "vue";
|
||||
import { listCheckplan, getCheckplan, delCheckplan, addCheckplan, updateCheckplan,changeCheckplanStatus } from "@/api/pms/checkplan";
|
||||
import { listDvsubject } from "@/api/pms/dvsubject";
|
||||
import { listDevice } from "@/api/pms/device.js";
|
||||
import Checksubject from "./subject.vue"
|
||||
import { listUser } from "@/api/system/user";
|
||||
import { genCode } from "@/api/system/autocode/rule"
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { pms_cycle_type, pms_order_status, pms_plan_type } = proxy.useDict("pms_cycle_type", "pms_order_status", "pms_plan_type");
|
||||
let autoGenFlag = ref(false)
|
||||
let optType = ref(undefined)
|
||||
// 遮罩层
|
||||
let loading = ref(true)
|
||||
// 选中数组
|
||||
let ids = ref([])
|
||||
// 非单个禁用
|
||||
let single = ref(true)
|
||||
// 非多个禁用
|
||||
let multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
let showSearch = ref(false)
|
||||
// 总条数
|
||||
let total = ref(0)
|
||||
// 设备点检计划头表格数据
|
||||
let checkplanList = ref([])
|
||||
// 弹出层标题
|
||||
let title = ref("")
|
||||
// 是否显示弹出层
|
||||
let open = ref(false)
|
||||
// 查询参数
|
||||
let queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
planCode: null,
|
||||
planName: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
cycleType: null,
|
||||
cycleCount: null,
|
||||
status: null
|
||||
})
|
||||
// 表单参数
|
||||
let form = ref({})
|
||||
let formRef = ref(null)
|
||||
|
||||
let deviceList = ref([])
|
||||
// 表单校验
|
||||
let rules = {
|
||||
planCode: [
|
||||
{ required: true, message: proxy.tLang('pms','计划编码') + proxy.tLang('common','不能为空'), trigger: "blur" }
|
||||
],
|
||||
planName: [
|
||||
{ required: true, message: proxy.tLang('pms','计划名称')+ proxy.tLang('common','不能为空'), trigger: "blur" }
|
||||
],
|
||||
planType: [
|
||||
{ required: true, message: proxy.tLang('pms','计划类型')+ proxy.tLang('common','不能为空'), trigger: "blur" }
|
||||
],
|
||||
deviceId: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('device','设备'), trigger: "blur" }
|
||||
],
|
||||
cycleType: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','频率'), trigger: "blur" }
|
||||
],
|
||||
cycleCount: [
|
||||
{ required: true, message: proxy.tLang('common','请输入') + proxy.tLang('pms','次数'), trigger: "blur" }
|
||||
],
|
||||
startDate: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','开始日期'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }
|
||||
],
|
||||
endDate: [
|
||||
{ required: true, message:proxy.tLang('common','请选择') + proxy.tLang('pms','结束日期'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }
|
||||
],
|
||||
}
|
||||
|
||||
const userList = ref([])
|
||||
|
||||
// 初始化下拉框数据
|
||||
function selectListInit() {
|
||||
|
||||
listUser({ pageSize: 1000 }).then(response => {
|
||||
userList.value = response.rows.map(item => {
|
||||
return {
|
||||
value: item.userId,
|
||||
label: item.nickName + '_' + item.code
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function validateStarttime(rule, value, callback) {
|
||||
let start = new Date(form.value.startDate).getTime();
|
||||
let end = new Date(form.value.endDate).getTime();
|
||||
if (start > 0 && end > 0 && start > end) {
|
||||
callback(new Error(proxy.tLang('validate','开始日期不能大于结束日期')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 查询设备点检计划头列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listCheckplan(queryParams).then(response => {
|
||||
checkplanList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
//获取设备列表
|
||||
function getDeviceList() {
|
||||
listDevice({ pageSize: 100 }).then(response => {
|
||||
deviceList.value = response.rows.map(item => {
|
||||
return {
|
||||
value: item.id + '',
|
||||
label: item.name,
|
||||
brand: item.brand,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
let subjectList = ref([]);
|
||||
// 点检保养项目列表
|
||||
function getListDvsubject(subjectType) {
|
||||
listDvsubject({ pageSize: 100, subjectType }).then(response => {
|
||||
subjectList.value = response.rows.map(item => {
|
||||
return {
|
||||
value: item.subjectCode,
|
||||
label: item.subjectName,
|
||||
subjectCode: item.subjectCode,
|
||||
subjectName: item.subjectName,
|
||||
subjectType: item.subjectType,
|
||||
subjectContent: item.subjectContent,
|
||||
subjectStandard: item.subjectStandard
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
let checksubjectList = ref([]);
|
||||
|
||||
//改变计划类型
|
||||
function changePlanType(e) {
|
||||
getListDvsubject(e);
|
||||
form.value.subjects = [];
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
planCode: null,
|
||||
planName: null,
|
||||
planType: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
cycleType: null,
|
||||
cycleCount: null,
|
||||
status: 1,
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
subjectCodes: [],
|
||||
deviceId: null,
|
||||
subjects: []
|
||||
}
|
||||
autoGenFlag.value = false;
|
||||
proxy.resetForm("formRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryForm");
|
||||
handleQuery();
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','添加')+ proxy.tLang('pms','计划');
|
||||
optType.value = "add";
|
||||
handleAutoGenChange(true)
|
||||
}
|
||||
|
||||
// 查询明细按钮操作
|
||||
function handleView(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value;
|
||||
getCheckplan(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','查看')+ proxy.tLang('pms','计划');
|
||||
optType.value = "view";
|
||||
});
|
||||
}
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value
|
||||
getCheckplan(id).then(response => {
|
||||
form.value = response.data;
|
||||
getListDvsubject(response.data.planType)
|
||||
if (form.value.subjects&&form.value.subjects.length > 0) {
|
||||
form.value.subjectCodes = form.value.subjects.map(item => item.subjectCode);
|
||||
} else {
|
||||
form.value.subjectCodes = [];
|
||||
}
|
||||
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','修改')+ proxy.tLang('pms','计划');
|
||||
optType.value = "edit";
|
||||
});
|
||||
}
|
||||
|
||||
/** 点检保养状态修改 */
|
||||
function handleStatusChange(row) {
|
||||
let text = row.status === 0 ? proxy.tLang('common','启用') : proxy.tLang('common','停用');
|
||||
proxy.$modal.confirm(proxy.tLang('tip','确定要') + text + ' "' + row.planCode + '"?').then(function () {
|
||||
return changeCheckplanStatus(row.id, row.status);
|
||||
}).then(() => {
|
||||
proxy.$modal.msgSuccess(text + proxy.tLang('common','成功'));
|
||||
}).catch(function () {
|
||||
row.status = row.status === 0 ? 1 : 0;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.subjects&&form.value.subjects.length > 0) {
|
||||
form.value.subjectCodes = form.value.subjects.map(item => item.subjectCode).join(",");
|
||||
} else {
|
||||
form.value.subjectCodes = '';
|
||||
}
|
||||
if (form.value.id != null) {
|
||||
updateCheckplan(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addCheckplan(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '新增成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleFinish() {
|
||||
if (form.value.id != null && form.value.status == 'PREPARE') {
|
||||
form.value.status = 'FINISHED';
|
||||
form.value.subjectCodes = form.value.subjects.map(item => item.subjectCode).join(",");
|
||||
updateCheckplan(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '已启用'));
|
||||
open.value = false;
|
||||
getList();
|
||||
}, err => {
|
||||
form.value.status = 'PREPARE';
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleDeFinish() {
|
||||
if (form.value.id != null && form.value.status == 'FINISHED') {
|
||||
form.value.status = 'PREPARE';
|
||||
form.value.subjectCodes = form.value.subjects.map(item => item.subjectCode).join(",");
|
||||
updateCheckplan(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '已停用'));
|
||||
open.value = false;
|
||||
getList();
|
||||
}, err => {
|
||||
form.value.status = 'FINISHED';
|
||||
});
|
||||
}
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const ids1 = row.id || ids.value;
|
||||
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '确定删除选中记录?') + ids1 ).then(function () {
|
||||
return delCheckplan(ids1);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '删除成功'));
|
||||
}).catch(() => { })
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('dv/checkplan/export', {
|
||||
...queryParams
|
||||
}, `checkplan_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
//自动生成编码
|
||||
function handleAutoGenChange(autoGenFlag) {
|
||||
if (autoGenFlag) {
|
||||
genCode('CHECKPLAN_CODE').then(response => {
|
||||
form.value.planCode = response;
|
||||
});
|
||||
} else {
|
||||
form.value.planCode = null;
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getDeviceList();
|
||||
selectListInit();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
112
src/views/pms/checkplan/subject.vue
Normal file
112
src/views/pms/checkplan/subject.vue
Normal file
@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" size="mini" @click="handleAdd" v-if="optType != 'view'&&checkstatus != 'FINISHED'"
|
||||
v-hasPermi="['pms:checkplan:add']">{{ tLang('common','新增') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="checksubjectList">
|
||||
<el-table-column :label="tLang('pms','项目名称')" align="center" prop="subjectCode" width="200px">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.subjectCode"
|
||||
:placeholder="tLang('common', '请选择') + tLang('device', '项目名称')"
|
||||
@change="changeSubject(scope.row)" :disabled="optType == 'view'||checkstatus == 'FINISHED'">
|
||||
<el-option v-for="item in subjectList" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目编码')" align="center" prop="subjectCode"></el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目类型')" align="center" prop="subjectType" >
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_dvsubject_type" :value="scope.row.subjectType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目内容')" align="center" width="200px" prop="subjectContent"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column :label="tLang('pms','标准')" align="center" width="100px" prop="subjectStandard"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column :label="tLang('common','操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="{ row, $index }">
|
||||
<el-button size="mini" type="text" icon="delete" v-if="optType != 'view'&&checkstatus != 'FINISHED'"
|
||||
@click="handleDelete($index)" v-hasPermi="['pms:checkplan:remove']">{{ tLang('common','删除') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance } from 'vue';
|
||||
const prop = defineProps({
|
||||
subjectList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
checksubjectList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
optType: {
|
||||
type: String,
|
||||
default: "add"
|
||||
},
|
||||
checkstatus: {
|
||||
type: String,
|
||||
default: "PREPARE"
|
||||
}
|
||||
});
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_yes_no, pms_dvsubject_type } = proxy.useDict("sys_yes_no", "pms_dvsubject_type");
|
||||
// 遮罩层
|
||||
let loading = ref(false);
|
||||
const emit = defineEmits();
|
||||
|
||||
|
||||
//修改项目编码
|
||||
function changeSubject(row) {
|
||||
let subject = prop.subjectList.find(item => item.value == row.subjectCode);
|
||||
row.subjectName = subject.subjectName;
|
||||
row.subjectType = subject.subjectType;
|
||||
row.subjectContent = subject.subjectContent;
|
||||
row.subjectStandard = subject.subjectStandard;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
let list = prop.checksubjectList || [];
|
||||
list.push({
|
||||
subjectCode: "",
|
||||
subjectName: "",
|
||||
subjectType: "",
|
||||
subjectContent: "",
|
||||
subjectStandard: "",
|
||||
});
|
||||
emit("update:checksubjectList", list);
|
||||
}
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(i) {
|
||||
|
||||
let list = prop.checksubjectList || [];
|
||||
let length = list.length;
|
||||
list.splice(i, 1);
|
||||
emit("update:checksubjectList", list);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
150
src/views/pms/checkplanRecode/checkplanTemp.vue
Normal file
150
src/views/pms/checkplanRecode/checkplanTemp.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" :destroy-on-close="true" @open="openDialog" :title="props.title"
|
||||
@close="close" width="800">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px" :disabled="true">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','计划编码')" prop="planCode">
|
||||
<el-input v-model="form.planCode" :placeholder="tLang('common', '请输入') + tLang('pms', '计划编码')" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-form-item label-width="10">
|
||||
<el-switch v-model="autoGenFlag" active-color="#13ce66" active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'&&optType != 'edit'">
|
||||
</el-switch>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','计划名称')" prop="planName">
|
||||
<el-input v-model="form.planName" :placeholder="tLang('common', '请输入') + tLang('pms', '计划名称')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','计划类型')" prop="planType">
|
||||
<el-select v-model="form.planType" :placeholder="tLang('common', '请选择') + tLang('pms', '计划类型')" @change="changePlanType">
|
||||
<el-option v-for="dict in pms_plan_type" :key="dict.value" :label="tLang('pms', dict.label)"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','频率')" prop="cycleCount">
|
||||
<el-input-number :min="1" :step="1" v-model="form.cycleCount" :placeholder="tLang('common', '请输入') + tLang('pms', '频率')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item prop="cycleType" label-width="00">
|
||||
<el-select v-model="form.cycleType" :placeholder="请选择频率">
|
||||
<el-option v-for="dict in pms_cycle_type" :key="dict.value" :label="tLang('pms', dict.label)"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('device','设备名称')" prop="deviceId">
|
||||
<!-- <el-input v-model="form.deviceId" :placeholder="请选择设备" disabled>
|
||||
<el-button style="border-color: #46a6ff; background-color: #46a6ff;color: white;"
|
||||
slot="append" @click="handleMachineryAdd" icon="el-icon-search"></el-button>
|
||||
</el-input> -->
|
||||
<el-select v-model="form.deviceId"
|
||||
:placeholder="tLang('common', '请选择') + tLang('device', '设备')">
|
||||
<el-option v-for="item in deviceList" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-form-item label="设备名称" prop="machineryName">
|
||||
<el-input v-model="form.machineryName" :placeholder="请选择设备" disabled />
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-form-item label="执行人" prop="userId">
|
||||
<el-select v-model="form.userId" filterable
|
||||
:placeholder="tLang('common', '请选择') + tLang('produce', '执行人')" style="width: 240px">
|
||||
<el-option v-for="item in userList" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','开始日期')" prop="startDate">
|
||||
<el-date-picker clearable v-model="form.startDate" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common', '请选择') + tLang('pms', '开始日期')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','结束日期')" prop="endDate">
|
||||
<el-date-picker clearable v-model="form.endDate" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common', '请选择') + tLang('pms', '结束日期')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" disabled>
|
||||
<el-option v-for="dict in pms_order_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="tLang('device','备注')" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :placeholder="tLang('common', '请输入') + tLang('device', '备注')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane :label="form.planType == 'CHECK' ? tLang('pms','点检') : tLang('pms','保养')">
|
||||
<Checksubject ref="subjectlist" :checksubjectList="form.subjects"></Checksubject>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<!-- <el-button type="primary" @click="submitForm">{{ tLang('common', '确 定') }}</el-button> -->
|
||||
<el-button @click="cancel">{{ tLang('common', '关 闭') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import Checksubject from "./subject.vue"
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const { pms_cycle_type, pms_order_status, pms_plan_type } = proxy.useDict("pms_cycle_type", "pms_order_status", "pms_plan_type");
|
||||
|
||||
const emit = defineEmits();
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
title: String,
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const formRef = ref(null);
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
|
||||
function close() {
|
||||
emit("update:modelValue", false);
|
||||
}
|
||||
function cancel() {
|
||||
emit("update:form", {});
|
||||
close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
349
src/views/pms/checkplanRecode/index.vue
Normal file
349
src/views/pms/checkplanRecode/index.vue
Normal file
@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item :label="tLang('pms','执行单编码')" prop="checkCode">
|
||||
<el-input v-model="queryParams.checkCode" :placeholder="tLang('common','请输入') + tLang('pms','执行单编码')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="tLang('','')实际保养时间" prop="checkTime">
|
||||
<el-date-picker clearable v-model="queryParams.checkTime" type="date" value-format="YYYY-MM-DD"
|
||||
:placeholder="tLang('common','请选择') + tLang('','')实际保养时间">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="tLang('pms','计划编码')" prop="checkPlanCode">
|
||||
<el-input v-model="queryParams.checkPlanCode" :placeholder="tLang('common','请输入') + tLang('pms','计划编码')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','执行人')" prop="checkUser">
|
||||
<el-input v-model="queryParams.checkUser" :placeholder="tLang('common','请输入') + tLang('pms','执行人')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','计划类型')" prop="planType">
|
||||
<el-select v-model="queryParams.planType" :placeholder="tLang('common','请选择') + tLang('pms','计划类型')" clearable @change="handleQuery">
|
||||
<el-option v-for="item in pms_plan_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:checkRecord:edit']">{{ $t('common.修改') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:checkRecord:remove']">{{ $t('common.删除') }}</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="checkRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="tLang('common','序号')" align="center" type="index" width="60" />
|
||||
<el-table-column :label="tLang('pms','执行单编码')" align="center" prop="checkCode" />
|
||||
<!-- <el-table-column :label="tLang('','')保养项目集合" align="center" prop="subjectCodes" /> -->
|
||||
<el-table-column :label="tLang('pms','计划编码')" align="center" prop="checkPlanCode" width="200">
|
||||
<template #default="scope">
|
||||
<el-button type="text" @click="handleView(scope.row)">{{
|
||||
scope.row.checkPlanCode }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','计划类型')" align="center" prop="planType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_plan_type" :value="scope.row.planType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','实际执行时间')" align="center" prop="checkTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','执行人')" align="center" prop="checkUser" />
|
||||
<el-table-column :label="tLang('pms','计划执行时间')" align="center" prop="nextCheckTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.nextCheckTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','最晚执行时间')" align="center" prop="deadline" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.deadline, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','执行提醒')" align="center" prop="" width="180">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.status == 1" :type="deadlineFun(scope)['color']">{{ deadlineFun(scope)['text'] }}</el-tag>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('common','状态')" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 1 ? 'info' : scope.row.status == 2 ? 'success' : 'danger'">
|
||||
{{ scope.row.status == 1 ? tLang('pms','待执行') : scope.row.status == 2 ? tLang('common','完成') : tLang('common','延期') }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="tLang('','')文件" align="center" prop="file" /> -->
|
||||
<el-table-column :label="tLang('common','备注')" align="center" prop="remark" />
|
||||
<el-table-column :label="tLang('common','操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:checkRecord:edit']">{{ scope.row.status == 1 ? tLang('common','修改') : tLang('common','查看') }}</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:checkRecord:remove']">{{tLang('common','删除')}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改保养记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||
<el-form ref="checkRecordRef" :model="form" :rules="rules" label-width="140px">
|
||||
<el-form-item :label="tLang('pms','执行单编码')" prop="checkCode">
|
||||
<el-input v-model="form.checkCode" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','实际执行时间')" prop="checkTime">
|
||||
<el-date-picker clearable v-model="form.checkTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:placeholder="tLang('common','请选择') + tLang('pms','实际执行时间')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="tLang('pms','')保养项目集合" prop="subjectCodes">
|
||||
<el-input v-model="form.subjectCodes" placeholder="请输入保养项目集合" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="tLang('pms','计划编码')" prop="checkPlanCode">
|
||||
<el-input v-model="form.checkPlanCode" disabled :placeholder="tLang('common','请输入') + tLang('pms','计划编码')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','执行人')" prop="checkUser">
|
||||
<el-input v-model="form.checkUser" :placeholder="tLang('common','请输入') + tLang('pms','执行人')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','计划执行时间')" prop="nextCheckTime">
|
||||
<el-date-picker clearable v-model="form.nextCheckTime" disabled type="date" value-format="YYYY-MM-DD">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','最晚执行时间')" prop="deadline">
|
||||
<el-date-picker clearable v-model="form.deadline" disabled type="date" value-format="YYYY-MM-DD">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('common','文件')" prop="file">
|
||||
<file-upload v-model="form.file" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('common','备注')" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :placeholder="tLang('common','请输入') + tLang('common','备注')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" v-if="form.status === 1" @click="submitForm">{{tLang('common','确 定')}}</el-button>
|
||||
<el-button @click="cancel">{{tLang('common','取 消')}}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<CheckplanTemp :form="checkplanForm" v-model="checkplanTempOpen" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="CheckRecord">
|
||||
import CheckplanTemp from "./checkplanTemp.vue"
|
||||
import { listCheckRecord, getCheckRecord, updateCheckRecord, delCheckRecord } from "@/api/pms/checkplan";
|
||||
import { getCheckplan } from "@/api/pms/checkplan";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { pms_cycle_type, pms_order_status, pms_plan_type } = proxy.useDict("pms_cycle_type", "pms_order_status", "pms_plan_type");
|
||||
|
||||
const checkRecordList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(false);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const checkplanTempOpen = ref(false);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
checkCode: null,
|
||||
checkPlanCode: null,
|
||||
checkUser: null,
|
||||
planType: null,
|
||||
},
|
||||
rules: {
|
||||
checkTime: [{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','实际执行时间'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询保养记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listCheckRecord(queryParams.value).then(response => {
|
||||
checkRecordList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
//时间验证
|
||||
function validateStarttime(rule, value, callback) {
|
||||
let checkTime = new Date(form.value.checkTime).getTime();
|
||||
let NowTime = new Date().getTime();
|
||||
if (checkTime > 0 && checkTime>NowTime) {
|
||||
callback(new Error('实际执行时间不能超过当前时间'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
// if (start > 0 && end > 0 && start > end) {
|
||||
// callback(new Error('开始时间不能大于结束时间'));
|
||||
// } else {
|
||||
// callback();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算剩余天数
|
||||
*/
|
||||
function deadlineFun(scope) {
|
||||
const now = new Date().getTime();
|
||||
const nextCheckTime = new Date(scope.row.nextCheckTime).getTime();
|
||||
const deadline = new Date(scope.row.deadline).getTime();
|
||||
let color = 'success';
|
||||
let diff = 0;
|
||||
let day = 0;
|
||||
if (now < nextCheckTime) {
|
||||
diff = nextCheckTime - now;
|
||||
day = '剩余'+Math.floor(diff / (24 * 3600 * 1000));
|
||||
} else if(now > nextCheckTime && now < deadline) {
|
||||
diff = deadline - now;
|
||||
day = '剩余'+Math.floor(diff / (24 * 3600 * 1000));
|
||||
color = 'warning';
|
||||
} else {
|
||||
diff = now - deadline;
|
||||
color = 'danger';
|
||||
day = '已延期'+Math.floor(diff / (24 * 3600 * 1000));
|
||||
}
|
||||
|
||||
return {
|
||||
color:color,
|
||||
text: day + '天'
|
||||
};
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
checkCode: null,
|
||||
checkTime: null,
|
||||
subjectCodes: null,
|
||||
checkPlanCode: null,
|
||||
checkUser: null,
|
||||
nextCheckTime: null,
|
||||
deadline: null,
|
||||
createTime: null,
|
||||
status: null,
|
||||
file: null,
|
||||
remark: null
|
||||
};
|
||||
proxy.resetForm("checkRecordRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
const checkplanForm = ref({});
|
||||
//查看保养单
|
||||
function handleView(row) {
|
||||
getCheckplan(row.planId).then(response => {
|
||||
checkplanForm.value = response.data;
|
||||
checkplanTempOpen.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
// function handleAdd() {
|
||||
// reset();
|
||||
// open.value = true;
|
||||
// title.value = "添加保养记录";
|
||||
// }
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getCheckRecord(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改保养记录";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["checkRecordRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateCheckRecord(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addCheckRecord(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除保养记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delCheckRecord(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('pms/checkRecord/export', {
|
||||
...queryParams.value
|
||||
}, `checkRecord_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
72
src/views/pms/checkplanRecode/subject.vue
Normal file
72
src/views/pms/checkplanRecode/subject.vue
Normal file
@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-table v-loading="loading" :data="checksubjectList">
|
||||
<el-table-column :label="tLang('pms','项目名称')" align="center" prop="subjectCode" width="200px">
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目编码')" align="center" prop="subjectCode"></el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目类型')" align="center" prop="subjectType" >
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_dvsubject_type" :value="scope.row.subjectType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目内容')" align="center" prop="subjectContent"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column :label="tLang('pms','标准')" align="center" prop="subjectStandard"
|
||||
:show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance } from 'vue';
|
||||
const prop = defineProps({
|
||||
checksubjectList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
});
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_yes_no, pms_dvsubject_type } = proxy.useDict("sys_yes_no", "pms_dvsubject_type");
|
||||
// 遮罩层
|
||||
let loading = ref(false);
|
||||
const emit = defineEmits();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
let list = prop.checksubjectList || [];
|
||||
list.push({
|
||||
subjectCode: "",
|
||||
subjectName: "",
|
||||
subjectType: "",
|
||||
subjectContent: "",
|
||||
subjectStandard: "",
|
||||
});
|
||||
emit("update:checksubjectList", list);
|
||||
}
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(i) {
|
||||
|
||||
let list = prop.checksubjectList || [];
|
||||
let length = list.length;
|
||||
list.splice(i, 1);
|
||||
emit("update:checksubjectList", list);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
321
src/views/pms/dvsubject/index.vue
Normal file
321
src/views/pms/dvsubject/index.vue
Normal file
@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"
|
||||
label-width="110px">
|
||||
<el-form-item :label="tLang('pms','项目编码')" prop="subjectCode">
|
||||
<el-input v-model="queryParams.subjectCode" :placeholder="tLang('common', '请输入') + tLang('pms','项目编码')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','项目名称')" prop="subjectName">
|
||||
<el-input v-model="queryParams.subjectName" :placeholder="tLang('common', '请输入') + tLang('pms','项目名称')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','项目类型')" prop="subjectType">
|
||||
<el-select v-model="queryParams.subjectType" :placeholder="tLang('common', '请输入') + tLang('pms','项目类型')" clearable>
|
||||
<el-option v-for="dict in pms_dvsubject_type" :key="dict.value" :label="tLang('pms',dict.label)"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" size="mini" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="refresh" size="mini" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['mes:dv:dvsubject:add']">{{ $t('common.新增') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['mes:dv:dvsubject:edit']">{{ $t('common.修改') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['mes:dv:dvsubject:remove']">{{ $t('common.删除') }}</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dvsubjectList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="tLang('pms','项目编码')" align="center" prop="subjectCode" />
|
||||
<el-table-column :label="tLang('pms','项目类型')" align="center" prop="subjectType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_dvsubject_type" :value="scope.row.subjectType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','项目名称')" align="center" prop="subjectName" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="tLang('pms','项目内容')" align="center" prop="subjectContent" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="tLang('pms','标准')" align="center" prop="subjectStandard" :show-overflow-tooltip="true" />
|
||||
<!-- <el-table-column :label="是否启用" align="center" prop="enableFlag">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_yes_no" :value="scope.row.enableFlag" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column :label="tLang('device','备注')" align="center" prop="remark" />
|
||||
<el-table-column :label="tLang('common','操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button size="mini" type="text" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['mes:dv:dvsubject:edit']">{{tLang('common', '修改')}}</el-button>
|
||||
<el-button size="mini" type="text" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['mes:dv:dvsubject:remove']">{{tLang('common', '删除')}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改设备点检保养项目对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="960px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','项目编码')" prop="subjectCode">
|
||||
<el-input v-model="form.subjectCode" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-form-item label-width="10">
|
||||
<el-switch v-model="autoGenFlag" active-color="#13ce66" active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="form.id === null" />
|
||||
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','项目编码')" prop="subjectName">
|
||||
<el-input v-model="form.subjectName" :placeholder="tLang('common', '请输入') + tLang('pms','项目名称')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','项目类型')" prop="subjectType">
|
||||
<el-radio-group v-model="form.subjectType">
|
||||
<el-radio v-for="dict in pms_dvsubject_type" :key="dict.value" :label="dict.value">
|
||||
{{ tLang('pms',dict.label) }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="是否启用">
|
||||
<el-radio-group v-model="form.enableFlag">
|
||||
<el-radio v-for="dict in sys_yes_no" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-form-item :label="tLang('pms','项目内容')" prop="subjectContent">
|
||||
<el-input type="textarea" v-model="form.subjectContent" :placeholder="tLang('common', '请输入') + tLang('pms','项目内容')" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','标准')" prop="subjectStandard">
|
||||
<el-input type="textarea" v-model="form.subjectStandard" :placeholder="tLang('common', '请输入') + tLang('pms','标准')" autosize />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('common','备注')" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" :placeholder="tLang('common', '请输入') + tLang('common','备注')" autosize />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">{{ tLang('common', '确 定') }}</el-button>
|
||||
<el-button @click="cancel">{{ tLang('common', '取 消') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, getCurrentInstance } from "vue";
|
||||
import { listDvsubject, getDvsubject, delDvsubject, addDvsubject, updateDvsubject } from "@/api/pms/dvsubject";
|
||||
import { genCode } from "@/api/system/autocode/rule"
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const { sys_yes_no, pms_dvsubject_type } = proxy.useDict("sys_yes_no", "pms_dvsubject_type");
|
||||
|
||||
|
||||
let formRef = ref(null);
|
||||
let autoGenFlag = ref(false);
|
||||
// 遮罩层
|
||||
let loading = ref(true);
|
||||
// 选中数组
|
||||
let ids = ref([]);
|
||||
// 非单个禁用
|
||||
let single = ref(true);
|
||||
// 非多个禁用
|
||||
let multiple = ref(true);
|
||||
// 显示搜索条件
|
||||
let showSearch = ref(false);
|
||||
// 总条数
|
||||
let total = ref(0);
|
||||
// 点检设备表格数据
|
||||
let dvsubjectList = ref([]);
|
||||
// 弹出层标题
|
||||
let title = ref("");
|
||||
// 是否显示弹出层
|
||||
let open = ref(false);
|
||||
// 查询参数
|
||||
let queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
subjectCode: null,
|
||||
subjectName: null,
|
||||
subjectType: null,
|
||||
subjectContent: null,
|
||||
subjectStandard: null,
|
||||
// enableFlag: null,
|
||||
})
|
||||
// 表单参数
|
||||
let form = ref({})
|
||||
let rules = {
|
||||
subjectCode: [
|
||||
{ required: true, message: proxy.tLang('pms','项目编码') + proxy.tLang('validate','不能为空'), trigger: "blur" }
|
||||
],
|
||||
subjectType: [
|
||||
{ required: true, message: proxy.tLang('common', '请选择') + proxy.tLang('pms','项目类型'), trigger: "blur" }
|
||||
],
|
||||
subjectContent: [
|
||||
{ required: true, message: proxy.tLang('pms','项目内容') + proxy.tLang('validate','不能为空'), trigger: "blur" }
|
||||
],
|
||||
// enableFlag: [
|
||||
// { required: true, message: "是否启用不能为空", trigger: "blur" }
|
||||
// ],
|
||||
subjectName: [
|
||||
{ required: true, message: proxy.tLang('pms','项目名称') + proxy.tLang('validate','不能为空'), trigger: "blur" }
|
||||
],
|
||||
}
|
||||
|
||||
// 页面加载
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listDvsubject(queryParams).then(response => {
|
||||
dvsubjectList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
subjectCode: null,
|
||||
subjectName: null,
|
||||
subjectType: null,
|
||||
subjectContent: null,
|
||||
subjectStandard: null,
|
||||
// enableFlag: "Y",
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
}
|
||||
autoGenFlag.value = false;
|
||||
proxy.resetForm("formRef");
|
||||
}
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryForm");
|
||||
handleQuery();
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','添加') + proxy.tLang('pms','点检保养项目');
|
||||
handleAutoGenChange(true)
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const id = row.id || ids.value
|
||||
getDvsubject(id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','修改') + proxy.tLang('pms','点检保养项目');
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateDvsubject(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addDvsubject(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '新增成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const subjectIds = row.id || ids.value;
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '确定删除选中记录?') + subjectIds ).then(function () {
|
||||
return delDvsubject(subjectIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '删除成功'));
|
||||
}).catch(() => { });
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('dv/dvsubject/export', {
|
||||
...queryParams
|
||||
}, `dvsubject_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
//自动生成编码
|
||||
function handleAutoGenChange(autoGenFlag) {
|
||||
if (autoGenFlag) {
|
||||
genCode('SUBJECT_CODE').then(response => {
|
||||
form.value.subjectCode = response;
|
||||
});
|
||||
} else {
|
||||
form.value.subjectCode = null;
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getList();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
667
src/views/pms/repair/index.vue
Normal file
667
src/views/pms/repair/index.vue
Normal file
@ -0,0 +1,667 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item :label="tLang('pms','维修单编号')" prop="repairCode">
|
||||
<el-input v-model="queryParams.repairCode" :placeholder="tLang('common','请输入') + tLang('pms','维修单编号')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','维修单名称')" prop="repairName">
|
||||
<el-input v-model="queryParams.repairName" :placeholder="tLang('common','请输入') + tLang('pms','维修单名称')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="tLang('device','设备编码')" prop="deviceId">
|
||||
<el-input v-model="queryParams.deviceId" :placeholder="tLang('common','请输入') + tLang('device','设备编码')" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('device','设备名称')" prop="machineryName">
|
||||
<el-input v-model="queryParams.machineryName" :placeholder="tLang('common','请输入') + tLang('device','设备名称')" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','维修结果')" prop="repairResult">
|
||||
<el-select v-model="queryParams.repairResult" :placeholder="tLang('common','请选择') + tLang('pms','维修结果')" clearable>
|
||||
<el-option v-for="dict in pms_repair_result" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="tLang('pms','单据状态')" prop="status">
|
||||
<el-select v-model="queryParams.status" :placeholder="tLang('common','请选择') + tLang('pms','单据状态')" clearable>
|
||||
<el-option v-for="dict in pms_order_status" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" size="mini" @click="handleQuery">{{ tLang('common', '搜索') }}</el-button>
|
||||
<el-button icon="refresh" size="mini" @click="resetQuery">{{ tLang('common', '重置') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['pms:repair:add']">{{ $t('common.新增') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['pms:repair:edit']">{{ $t('common.修改') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['pms:repair:remove']">{{ $t('common.删除') }}</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="repairList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="tLang('pms','维修单编号')" width="120px" align="center" prop="repairCode" />
|
||||
<el-table-column :label="tLang('pms','维修单名称')" width="150px" align="center" prop="repairName"
|
||||
:show-overflow-tooltip="true" />
|
||||
<el-table-column :label="tLang('device','设备编码')" align="center" prop="deviceCode" />
|
||||
<el-table-column :label="tLang('device','设备名称')" align="center" prop="deviceName" />
|
||||
<el-table-column :label="tLang('pms','报修日期')" align="center" prop="requireDate" width="140">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.requireDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','维修完成日期')" align="center" prop="finishDate" width="140">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.finishDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','验收日期')" align="center" prop="confirmDate" width="140">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.confirmDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','维修结果')" align="center" prop="repairResult">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_repair_result" :value="scope.row.repairResult" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','维修人员')" align="center" prop="acceptedName" />
|
||||
<el-table-column :label="tLang('pms','验收人员')" align="center" prop="confirmName" />
|
||||
<el-table-column :label="tLang('common','状态')" align="center" prop="dataStatus" />
|
||||
<!-- <el-table-column :label="tLang('pms','')单据状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pms_order_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column :label="tLang('common','操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button size="mini" type="text" icon="grid" @click="handleOpenLog(scope.row)"
|
||||
v-hasPermi="['pms:repair:log']">{{tLang('pms','记录')}}</el-button>
|
||||
<el-button size="mini" type="text" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['pms:repair:edit']">{{tLang('common','修改')}}</el-button>
|
||||
<el-button size="mini" type="text" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['pms:repair:remove']">{{tLang('common','删除')}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改设备维修单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="960px" append-to-body destroy-on-close>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','维修单编号')" prop="repairCode">
|
||||
<el-input v-model="form.repairCode" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<!-- <el-form-item label-width="10">
|
||||
<el-switch v-model="autoGenFlag" active-color="#13ce66" active-text="自动生成"
|
||||
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'"
|
||||
:disabled="form.status != 'PREPARE'">
|
||||
</el-switch>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="tLang('pms','维修单名称')" prop="repairName">
|
||||
<el-input v-model="form.repairName" :placeholder="tLang('common','请输入') + tLang('pms','维修单名称')"
|
||||
:disabled="form.status != 'PREPARE'&&form.status != 'SENDBACK'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','选择设备')" prop="deviceId">
|
||||
<el-select v-model="form.deviceId"
|
||||
:placeholder="tLang('common', '请选择') + tLang('device', '设备')" @change="changeDevice"
|
||||
:disabled="form.status != 'PREPARE'&&form.status != 'SENDBACK'">
|
||||
<el-option v-for="item in deviceList" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8" v-if="form.status !== 'PREPARE'">
|
||||
<el-form-item :label="tLang('pms','报修人员')" prop="createBy">
|
||||
<el-input v-model="form.createName" :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','报修日期')" prop="requireDate">
|
||||
<el-date-picker clearable v-model="form.requireDate" style="width: 187px" type="date"
|
||||
value-format="YYYY-MM-DD" :placeholder="tLang('common','请选择') + tLang('pms','报修日期')" :disabled="form.status != 'PREPARE'&&form.status != 'SENDBACK'">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','最晚维修日期')" prop="">
|
||||
<el-date-picker clearable v-model="form.deadline" style="width: 187px" type="date"
|
||||
value-format="YYYY-MM-DD" :placeholder="tLang('common','请选择') + tLang('pms','最晚维修日期')" :disabled="form.status != 'PREPARE'">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="tLang('pms','报修备注')" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :placeholder="tLang('common','请输入') + tLang('pms','报修备注')"
|
||||
:disabled="form.status !== 'PREPARE'&&form.status != 'SENDBACK'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="tLang('pms','审核备注')" prop="reviewerRemark"
|
||||
v-if="form.status != 'PREPARE'&&form.status != 'SENDBACK'">
|
||||
<el-input v-model="form.reviewerRemark" type="textarea" :placeholder="tLang('common','请输入') + tLang('pms','审核备注')"
|
||||
:disabled="!is_reviewer || form.status !== 'APPROVING'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','维修人员')" prop="acceptedBy"
|
||||
v-if="form.status == 'APPROVED' || form.status == 'FINISHED' || form.status == 'CONFIRMED' || form.status == 'APPROVING'||form.status == 'NOTPASS'">
|
||||
|
||||
<el-select v-model="form.acceptedBy" placeholder=""
|
||||
:disabled="!is_reviewer || form.status !== 'APPROVING'">
|
||||
<el-option v-for="item in acceptedByOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','维修完成日期')"
|
||||
v-if="form.status == 'APPROVED' || form.status == 'FINISHED' || form.status == 'CONFIRMED'||form.status == 'NOTPASS'"
|
||||
prop="finishDate">
|
||||
<el-date-picker clearable v-model="form.finishDate" style="width: 187px" type="date"
|
||||
value-format="YYYY-MM-DD" :placeholder="tLang('common','请选择') + tLang('pms','维修完成日期')"
|
||||
:disabled="!is_repairman || (form.status !== 'APPROVED'&&form.status !== 'NOTPASS')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','维修结果')" prop="repairResult"
|
||||
v-if="form.status == 'APPROVED' || form.status == 'FINISHED' || form.status == 'CONFIRMED'||form.status == 'NOTPASS'">
|
||||
<el-radio-group v-model="form.repairResult"
|
||||
:disabled="!is_repairman || (form.status !== 'APPROVED'&&form.status !== 'NOTPASS')">
|
||||
<el-radio v-for="dict in pms_repair_result" :key="dict.value" :label="tLang('pms',dict.value)">
|
||||
{{ tLang('pms',dict.value) }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="tLang('pms','维修备注')" prop="repairmanRemark"
|
||||
v-if="form.status == 'APPROVED' || form.status == 'FINISHED' || form.status == 'CONFIRMED'||form.status == 'NOTPASS'">
|
||||
<el-input v-model="form.repairmanRemark" type="textarea" :placeholder="tLang('common','请输入') + tLang('pms','维修备注')"
|
||||
:disabled="!is_repairman || (form.status !== 'APPROVED'&&form.status !== 'NOTPASS')" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','验收人员')" prop="confirmBy"
|
||||
v-if="form.status == 'APPROVED' || form.status == 'FINISHED' || form.status == 'CONFIRMED' || form.status == 'APPROVING'||form.status == 'NOTPASS'">
|
||||
<el-select v-model="form.confirmBy" placeholder=""
|
||||
:disabled="!is_reviewer || form.status !== 'APPROVING'">
|
||||
<el-option v-for="item in confirmByOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :label="tLang('pms','验收日期')" v-if="form.status == 'FINISHED' || form.status == 'CONFIRMED'"
|
||||
prop="confirmDate">
|
||||
<el-date-picker clearable v-model="form.confirmDate" style="width: 187px" type="date"
|
||||
value-format="YYYY-MM-DD" :placeholder="tLang('common','请选择') + tLang('pms','验收日期')"
|
||||
:disabled="!is_inspector || form.status != 'CONFIRMED'">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item :label="tLang('pms','验收备注')" prop="inspectorRemark"
|
||||
v-if="form.status == 'FINISHED' || form.status == 'CONFIRMED'">
|
||||
<el-input v-model="form.inspectorRemark" type="textarea" :placeholder="tLang('common','请输入') + tLang('pms','验收备注')"
|
||||
:disabled="!is_inspector || form.status != 'CONFIRMED'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-divider content-position="center">{{tLang('pms','维修内容')}}</el-divider>
|
||||
<el-card shadow="always" class="box-card">
|
||||
<Repairline ref="line" :repairlineList="form.line" :status="form.status"></Repairline>
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="warning" v-if="(form.status == 'PREPARE'||form.status == 'SENDBACK') && optType != 'view' && (userStore.id == form.createBy||form.createBy == null)"
|
||||
@click="submitForm('PREPARE')">{{tLang('common','暂存')}}</el-button>
|
||||
<el-button type="primary" @click="submitForm('APPROVING')"
|
||||
v-if="(form.status == 'PREPARE'||form.status == 'SENDBACK') && optType != 'view' && (userStore.id == form.createBy||form.createBy == null)">{{ tLang('common','提 交') }}</el-button>
|
||||
|
||||
<!--
|
||||
|
||||
//判断当前用户是否有审核权限
|
||||
let is_reviewer = ref(false)
|
||||
//判断当前用户是否有维修权限
|
||||
let is_repairman = ref(false)
|
||||
//判断当前用户是否有验收权限
|
||||
let is_inspector = ref(false)
|
||||
-->
|
||||
<el-button type="primary" @click="submitForm('PREPARE')"
|
||||
v-if="form.status == 'APPROVING' && optType != 'view' && userStore.id == form.createBy">{{tLang('common','撤回')}}</el-button>
|
||||
|
||||
<el-button type="danger" @click="submitForm('SENDBACK')"
|
||||
v-if="form.status == 'APPROVING' && optType != 'view'&&is_reviewer">{{tLang('common','退回')}}</el-button>
|
||||
|
||||
<el-button type="warning" @click="submitForm('STOP')"
|
||||
v-if="form.status == 'APPROVING' && optType != 'view'&&is_reviewer">{{tLang('common','终止')}}</el-button>
|
||||
|
||||
<el-button type="success" @click="submitForm('APPROVED')"
|
||||
v-if="form.status == 'APPROVING' && optType != 'view'&&is_reviewer">{{tLang('common','审批通过')}}</el-button>
|
||||
|
||||
<el-button type="success" @click="submitForm('CONFIRMED')"
|
||||
v-if="(form.status == 'APPROVED'||form.status == 'NOTPASS') && optType != 'view'&&is_repairman">{{tLang('common','完成维修')}}</el-button>
|
||||
|
||||
<el-button type="success" @click="submitForm('FINISHED')"
|
||||
v-if="form.status == 'CONFIRMED' && optType != 'view'&&is_inspector">{{tLang('common','完成验收')}}</el-button>
|
||||
<el-button type="danger" @click="submitForm('NOTPASS')"
|
||||
v-if="form.status == 'CONFIRMED' && optType != 'view'&&is_inspector">{{tLang('common','验收未通过')}}</el-button>
|
||||
<el-button @click="cancel">{{tLang('common','取 消')}}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-dialog>
|
||||
<RepairLog v-model="logOpen" :repairCode="logRepairCode"></RepairLog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch, toRefs, getCurrentInstance } from 'vue';
|
||||
import Repairline from './line.vue'
|
||||
import RepairLog from './log.vue'
|
||||
import { listRepair, getRepair, delRepair, addRepair, updateRepair } from "@/api/pms/repair";
|
||||
import { genCode } from "@/api/system/autocode/rule"
|
||||
import { listDevice } from "@/api/pms/device.js";
|
||||
import { selectRepairUser } from "@/api/system/repair";
|
||||
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const { pms_repair_result, pms_order_status } = proxy.useDict("pms_repair_result", "pms_order_status");
|
||||
let userStore = useUserStore();
|
||||
|
||||
let machinerySelectRef = ref(null)
|
||||
let autoGenFlag = ref(false)
|
||||
let optType = ref(undefined)
|
||||
// 遮罩层
|
||||
let loading = ref(true)
|
||||
// 选中数组
|
||||
let ids = ref([])
|
||||
// 非单个禁用
|
||||
let single = ref(true)
|
||||
// 非多个禁用
|
||||
let multiple = ref(true)
|
||||
// 显示搜索条件
|
||||
let showSearch = ref(false)
|
||||
// 总条数
|
||||
let total = ref(0)
|
||||
// 设备维修单表格数据
|
||||
let repairList = ref([])
|
||||
// 弹出层标题
|
||||
let title = ref("")
|
||||
// 是否显示弹出层
|
||||
let open = ref(false)
|
||||
//记录日志弹出层
|
||||
let logOpen = ref(false)
|
||||
//记录日志维修单编号
|
||||
let logRepairCode = ref("")
|
||||
|
||||
|
||||
// 查询参数
|
||||
let queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
repairCode: null,
|
||||
repairName: null,
|
||||
machineryId: null,
|
||||
deviceId: null,
|
||||
machineryName: null,
|
||||
machineryBrand: null,
|
||||
machinerySpec: null,
|
||||
machineryTypeId: null,
|
||||
requireDate: null,
|
||||
finishDate: null,
|
||||
confirmDate: null,
|
||||
repairResult: null,
|
||||
acceptedBy: null,
|
||||
confirmBy: null,
|
||||
status: null,
|
||||
})
|
||||
// 表单参数
|
||||
let form = ref({})
|
||||
let formRef = ref(null)
|
||||
let deviceList = ref([])
|
||||
// 表单校验
|
||||
let rules = {
|
||||
repairCode: [
|
||||
{ required: true, message: proxy.tLang('pms','维修单编号') + proxy.tLang('validate','不能为空'), trigger: "blur" }
|
||||
],
|
||||
deviceId: [
|
||||
{ required: true, message: proxy.tLang('device','设备') + proxy.tLang('validate','不能为空'), trigger: "blur" }
|
||||
],
|
||||
requireDate: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','报修日期'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }
|
||||
],
|
||||
deadline: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','最晚维修日期'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }
|
||||
],
|
||||
finishDate: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','维修完成日期'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }
|
||||
],
|
||||
confirmDate: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','验收日期'), trigger: "blur" },
|
||||
//开始时间不能大于结束时间
|
||||
{ validator: validateStarttime, trigger: 'change' }
|
||||
],
|
||||
repairResult: [
|
||||
{ required: true, message: proxy.tLang('common','请选择') + proxy.tLang('pms','维修结果'), trigger: "blur" }
|
||||
],
|
||||
// acceptedBy: [
|
||||
// { required: true, message: '维修人员不能为空', trigger: "blur" }
|
||||
// ],
|
||||
// confirmBy: [
|
||||
// { required: true, message: '验收人员不能为空', trigger: "blur" }
|
||||
// ],
|
||||
}
|
||||
|
||||
|
||||
//时间验证
|
||||
function validateStarttime(rule, value, callback) {
|
||||
let requireDate = new Date(form.value.requireDate).getTime();
|
||||
let finishDate = new Date(form.value.finishDate).getTime();
|
||||
let confirmDate = new Date(form.value.confirmDate).getTime();
|
||||
if (requireDate > 0 && finishDate > 0 && requireDate > finishDate) {
|
||||
callback(new Error('报修日期不能大于维修完成日期'));
|
||||
} else if (finishDate > 0 && confirmDate > 0 && finishDate > confirmDate) {
|
||||
callback(new Error('维修完成日期不能大于验收日期'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//查看维修记录
|
||||
function handleOpenLog(row) {
|
||||
logRepairCode.value = row.repairCode
|
||||
logOpen.value = true
|
||||
}
|
||||
|
||||
|
||||
//获取设备列表
|
||||
function getDeviceList() {
|
||||
listDevice({ pageSize: 100 }).then(response => {
|
||||
deviceList.value = response.rows.map(item => {
|
||||
return {
|
||||
value: +item.id,
|
||||
label: item.name,
|
||||
brand: item.brand,
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
//设备选择
|
||||
function changeDevice(value) {
|
||||
let device = deviceList.value.find(item => item.value === value);
|
||||
form.value.machineryId = device.value;
|
||||
form.value.machineryName = device.label;
|
||||
form.value.machineryBrand = device.brand;
|
||||
}
|
||||
|
||||
|
||||
/** 查询设备维修单列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listRepair(queryParams).then(response => {
|
||||
repairList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
let acceptedByOptions = ref([])
|
||||
let confirmByOptions = ref([])
|
||||
let reviewerByOptions = ref([])
|
||||
|
||||
//判断当前用户是否有审核权限
|
||||
let is_reviewer = ref(false)
|
||||
//判断当前用户是否有维修权限
|
||||
let is_repairman = ref(false)
|
||||
//判断当前用户是否有验收权限
|
||||
let is_inspector = ref(false)
|
||||
//获取维修人员列表
|
||||
function acceptedByChange() {
|
||||
selectRepairUser({ flow: 'repairman', pageSize: 100 }).then(response => {
|
||||
acceptedByOptions.value = response.rows.map(item => {
|
||||
return {
|
||||
value: item.userId,
|
||||
label: item.nickName,
|
||||
}
|
||||
})
|
||||
is_repairman.value = acceptedByOptions.value.some(item => item.value == userStore.id)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
//获取验收人员列表
|
||||
function confirmByChange() {
|
||||
selectRepairUser({ flow: 'Inspector', pageSize: 100 }).then(response => {
|
||||
confirmByOptions.value = response.rows.map(item => {
|
||||
return {
|
||||
value: item.userId,
|
||||
label: item.nickName,
|
||||
}
|
||||
})
|
||||
is_inspector.value = confirmByOptions.value.some(item => item.value == userStore.id)
|
||||
})
|
||||
}
|
||||
|
||||
//获取审核人员列表
|
||||
function reviewerByChange() {
|
||||
selectRepairUser({ flow: 'reviewer', pageSize: 100 }).then(response => {
|
||||
reviewerByOptions.value = response.rows.map(item => {
|
||||
return {
|
||||
value: item.userId,
|
||||
label: item.nickName,
|
||||
}
|
||||
})
|
||||
is_reviewer.value = reviewerByOptions.value.some(item => item.value == userStore.id)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
// reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
repairCode: null,
|
||||
repairName: null,
|
||||
machineryId: null,
|
||||
deviceId: null,
|
||||
machineryName: null,
|
||||
machineryBrand: null,
|
||||
machinerySpec: null,
|
||||
machineryTypeId: null,
|
||||
requireDate: null,
|
||||
finishDate: null,
|
||||
confirmDate: null,
|
||||
repairResult: "",
|
||||
acceptedBy: null,
|
||||
confirmBy: null,
|
||||
status: 'PREPARE',
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
line: [],
|
||||
reviewerRemark: null,
|
||||
repairmanRemark: null,
|
||||
inspectorRemark: null,
|
||||
deadline: null
|
||||
}
|
||||
autoGenFlag.value = false;
|
||||
proxy.resetForm("formRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryForm");
|
||||
handleQuery();
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length !== 1
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','添加') + proxy.tLang('pms','设备维修单');
|
||||
handleAutoGenChange(true)
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const repairId = row.id || ids.value
|
||||
getRepair(repairId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = proxy.tLang('common','修改') + proxy.tLang('pms','设备维修单');
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm(formStatus) {
|
||||
formRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
// form.value.status = formStatus;
|
||||
|
||||
let requestForm = JSON.parse(JSON.stringify(form.value));
|
||||
requestForm.status = formStatus;
|
||||
if (form.value.id != null) {
|
||||
updateRepair(requestForm).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addRepair(requestForm).then(response => {
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '新增成功'));
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const repairIds = row.id || ids.value;
|
||||
proxy.$modal.confirm(proxy.tLang('tip', '确定删除选中记录?') + repairIds).then(function () {
|
||||
return delRepair(repairIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(proxy.tLang('common', '删除成功'));
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('dv/repair/export', {
|
||||
...queryParams
|
||||
}, `repair_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
//设备资源选择弹出
|
||||
function handleMachineryAdd() {
|
||||
machinerySelectRef.value.showFlag = true;
|
||||
}
|
||||
//自动生成编码
|
||||
function handleAutoGenChange(autoGenFlag) {
|
||||
if (autoGenFlag) {
|
||||
genCode('REPAIR_CODE').then(response => {
|
||||
form.value.repairCode = response;
|
||||
});
|
||||
} else {
|
||||
form.value.repairCode = null;
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getDeviceList();
|
||||
acceptedByChange();
|
||||
confirmByChange();
|
||||
reviewerByChange();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
89
src/views/pms/repair/line.vue
Normal file
89
src/views/pms/repair/line.vue
Normal file
@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['pms:repair:add']"
|
||||
v-if="status == 'PREPARE'||status == 'NOTPASS'||status == 'APPROVED'|| status == 'SENDBACK'"
|
||||
>{{ tLang('common','新增') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="repairlineList">
|
||||
<el-table-column :label="tLang('pms','故障描述')" align="center" prop="malfunction" >
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.malfunction" type="textarea" :placeholder="tLang('common','请输入') + tLang('PMS','故障描述')" :disabled="status != 'PREPARE'&&status != 'APPROVING'&&status != 'SENDBACK'&&status != 'NOTPASS'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','故障描述内容')" align="center" prop="malfunctionUrl" >
|
||||
<template #default="scope">
|
||||
<el-input type="textarea" v-model="scope.row.malfunctionUrl" :placeholder="tLang('common','请输入') + tLang('PMS','故障描述内容')" :disabled="status != 'PREPARE'&&status != 'APPROVING'&&status != 'SENDBACK'&&status != 'NOTPASS'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('pms','维修情况')" align="center" prop="repairDes" >
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.repairDes" type="textarea" :placeholder="tLang('common','请输入') + tLang('pms','维修情况')" :disabled="status != 'APPROVED'&&status != 'NOTPASS'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="tLang('common','操作')" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="{row,$index}">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="delete"
|
||||
@click="handleDelete($index)"
|
||||
v-hasPermi="['pms:repair:remove']"
|
||||
v-if="status == 'PREPARE'||status == 'NOTPASS'||status == 'APPROVED'||status == 'SENDBACK'"
|
||||
>{{ tLang('common','删除') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
const prop = defineProps({
|
||||
repairlineList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
default: "PREPARE"
|
||||
}
|
||||
});
|
||||
const emit = defineEmits();
|
||||
let loading = ref(false);
|
||||
|
||||
//新增
|
||||
function handleAdd() {
|
||||
let list = prop.repairlineList || [];
|
||||
list.push({
|
||||
malfunction: "",
|
||||
malfunctionUrl: "",
|
||||
repairDes: ""
|
||||
});
|
||||
emit("update:repairlineList", list);
|
||||
}
|
||||
|
||||
//删除
|
||||
function handleDelete(i) {
|
||||
let list = prop.repairlineList || [];
|
||||
let length = list.length;
|
||||
list.splice(i, 1);
|
||||
emit("update:repairlineList", list);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
38
src/views/pms/repair/log.vue
Normal file
38
src/views/pms/repair/log.vue
Normal file
@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="操作记录" @open="handleOpen" width="1000" @close="handleClose">
|
||||
<el-table :data="repairLogList" stripe>
|
||||
<el-table-column property="repairCode" label="维修单号" width="150" />
|
||||
<el-table-column property="user" label="操作人" />
|
||||
<el-table-column property="changeContent" label="内容" />
|
||||
<el-table-column property="ts" label="时间" width="200" />
|
||||
<el-table-column property="method" label="维修单状态" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { selectRepairFLow} from "@/api/pms/repair";
|
||||
const emit = defineEmits();
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
repairCode: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
||||
let column = ref(2);
|
||||
let repairLogList = ref([]);
|
||||
function handleOpen() {
|
||||
selectRepairFLow({repairCode: props.repairCode}).then(res => {
|
||||
repairLogList.value = res.data
|
||||
});
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
emit('update:modelValue', false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
@ -11,7 +11,15 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="tplWebType">
|
||||
<template #label>前端类型</template>
|
||||
<el-select v-model="info.tplWebType">
|
||||
<el-option label="Vue2 Element UI 模版" value="element-ui" />
|
||||
<el-option label="Vue3 Element Plus 模版" value="element-plus" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="packageName">
|
||||
<template #label>
|
||||
|
@ -31,8 +31,8 @@ export default defineConfig(({ mode, command }) => {
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
target: 'http://192.168.10.65:9015',
|
||||
// target: 'http://8.141.87.86:9015',
|
||||
target: 'http://192.168.10.88:8086',
|
||||
// target: 'http://8.141.87.86:8086',
|
||||
// target: 'http://192.168.110.90:10393/mock/5ce74738-f63f-4d21-af85-b1d132c6f6fd',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
|
Loading…
Reference in New Issue
Block a user