projects/mesxc-dy #206

Merged
juzi merged 3 commits from projects/mesxc-dy into projects/mesxc-test 2024-02-26 10:44:08 +08:00
19 changed files with 2454 additions and 509 deletions
Showing only changes of commit 35da704bb4 - Show all commits

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-02-21 18:47:20
# @LastEditTime: 2024-02-23 17:11:13
# @LastEditors: DY
# @Description:
###
@ -14,7 +14,6 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
@ -23,10 +22,9 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# VUE_APP_BASE_API = 'http://192.168.0.30:8888'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# socket地址
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-16 20:15:02
* @LastEditTime: 2024-02-24 18:51:54
* @LastEditors: DY
* @Description:
*/
@ -68,3 +68,38 @@ export function deleteEqCheckLog(id) {
method: 'delete'
})
}
// 获得设备巡检单详情分页
export function getCheckOrderDetPage(query) {
return request({
url: '/base/equipment-check-order-det/page',
method: 'get',
params: query
})
}
// 创建设备巡检单详情
export function createCheckOrderDet(data) {
return request({
url: '/base/equipment-check-order-det/create',
method: 'post',
data: data
})
}
// 更新设备巡检单详情
export function updateCheckOrderDet(data) {
return request({
url: '/base/equipment-check-order-det/update',
method: 'put',
data: data
})
}
// 删除设备巡检单详情
export function deleteCheckOrderDet(id) {
return request({
url: '/base/equipment-check-order-det/delete?id=' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,104 @@
/*
* @Author: Do not edit
* @Date: 2024-02-22 15:14:19
* @LastEditTime: 2024-02-23 19:18:22
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得设备保养计划配置分页
export function getPlanPage(query) {
return request({
url: '/base/equipment-maintain-plan/page',
method: 'get',
params: query
})
}
// 创建设备保养计划
export function createPlan(data) {
return request({
url: '/base/equipment-maintain-plan/create',
method: 'post',
data: data
})
}
// 更新设备保养计划
export function updatePlan(data) {
return request({
url: '/base/equipment-maintain-plan/update',
method: 'put',
data: data
})
}
// 获得计划code
export function getCode() {
return request({
url: '/base/equipment-maintain-plan/getCode',
method: 'get'
})
}
// 获得计划
export function getPlan(query) {
return request({
url: '/base/equipment-maintain-plan/get',
method: 'get',
params: query
})
}
// 获得设备保养计划配置详情分页
export function getPlanDetPage(query) {
return request({
url: '/base/equipment-maintain-plan-det/page',
method: 'get',
params: query
})
}
// 创建设备保养计划详情
export function createPlanDet(data) {
return request({
url: '/base/equipment-maintain-plan-det/create',
method: 'post',
data: data
})
}
// 更新设备保养计划详情
export function updatePlanDet(data) {
return request({
url: '/base/equipment-maintain-plan-det/update',
method: 'put',
data: data
})
}
// 获得计划详情
export function getPlanDet(query) {
return request({
url: '/base/equipment-maintain-plan-det/get',
method: 'get',
params: query
})
}
// 删除设备保养计划
export function deletePlan(id) {
return request({
url: '/base/equipment-maintain-plan/delete?id=' + id,
method: 'delete'
})
}
// 删除设备保养计划详情
export function deletePlanDet(id) {
return request({
url: '/base/equipment-maintain-plan-det/delete?id=' + id,
method: 'delete'
})
}

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-23 19:10:07
* @LastEditTime: 2024-02-24 16:53:33
* @LastEditors: DY
* @Description:
*/
@ -42,3 +42,29 @@ export function exportMaintainLogExcel(query) {
responseType: 'blob'
})
}
// 获得保养记录
export function getLog(query) {
return request({
url: '/base/equipment-maintain-log/get',
method: 'get',
params: query
})
}
// 获得设备保养记录详情分页
export function getLogDetPage(query) {
return request({
url: '/base/equipment-maintain-log-det/page',
method: 'get',
params: query
})
}
// 删除设备保养记录详情
export function deleteLogDet(id) {
return request({
url: '/base/equipment-maintain-log-det/delete?id=' + id,
method: 'delete'
})
}

View File

@ -2,7 +2,7 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: DY
* @LastEditTime: 2023-09-12 11:13:34
* @LastEditTime: 2024-02-23 14:50:22
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
@ -62,6 +62,17 @@ export function parseTime(time, pattern) {
})
return time_str
}
export function toDay(time) {
if (time < 24) {
return time + '小时'
} else {
const day = ~~(time / 24)
const hour = time % 24
return day + '天' + hour + '小时'
}
}
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]

View File

@ -41,7 +41,7 @@
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="700px"
width="30%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-21 18:31:44
* @LastEditTime: 2024-02-22 10:08:13
* @Description:
-->
<template>
@ -18,6 +18,7 @@
v-model="dataForm.equipmentId"
:options="plLineList"
:props="{value: 'id', label: 'name', children: 'children'}"
style="width: 100%"
filterable />
</el-form-item>
<el-form-item label="关联表名" prop="plcId">
@ -110,11 +111,9 @@ export default {
}
})
})
console.log('你好', this.plLineList)
},
//
dataFormSubmit() {
console.log('11', this.dataForm.equipmentId)
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;

View File

@ -0,0 +1,312 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-24 19:02:14
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ '设备巡检记录详情' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">巡检单名称</div>
<div class="lightTip">{{ dataForm.planMaintainWorker }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">部门</div>
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">班次</div>
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">巡检人</div>
<div class="lightTip">{{ dataForm.responsible }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">巡检时间</div>
<div class="lightTip">{{ parseTime(dataForm.actualTime) }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">确认人</div>
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
</el-col>
</el-row>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
巡检内容
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="planList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
<!-- <attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:plan-id="dataForm.id"
@refreshDataList="getList" /> -->
</el-drawer>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { getEqCheckLog, deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
// import { listData } from "@/api/system/dict/data";
import SmallTitle from '../../maintain/PlanConfig/SmallTitle.vue';
import { parseTime } from '../../../../core/mixins/code-filter';
// import attrAdd from './attr-add';
// import { getDictDatas } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'equipmentName',
label: '设备名称',
},
{
prop: 'program',
label: '巡检项目',
},
{
prop: 'checkResult',
label: '巡检结果',
}
];
export default {
mixins: [basicAdd],
components: { SmallTitle },
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: false,
infoURL: getEqCheckLog
},
listQuery: {
pageSize: 99,
pageNo: 1,
total: 0
},
dataForm: {},
planList: [],
visible: false,
isdetail: false,
idAttrShow: false
};
},
mounted() {},
methods: {
initData() {
this.planList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`是否确认删除保养项目名为"${raw.data.program}"的数据项?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCheckOrderDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getCheckOrderDetPage({
...this.listQuery,
orderId: this.dataForm.id,
}).then((response) => {
this.planList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
});
//
this.getList();
}
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 18vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: -40px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
/* height: 16px; */
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
</style>

View File

@ -50,6 +50,11 @@
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
<add-content
v-if="addContent"
ref="addContent"
@refreshDataList="addContent = false" />
</div>
</template>
@ -57,60 +62,84 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addRecord from './addRecord.vue';
import AddContent from './addContent.vue';
import { exportCheckLogExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
import { parseTime } from '../../../../core/mixins/code-filter';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = {
name: 'tableBtn',
props: ['injectData'],
data() {
return {};
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
},
},
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.name}
</el-button>
);
},
};
export default {
name: 'EquipmentRepair',
components: { addRecord },
name: 'EquipmentInspectionRecord',
components: { addRecord, AddContent },
mixins: [basicPageMixin],
data() {
return {
addOrUpdateVisible: false,
searchBarKeys: ['equipmentId', 'actualTime'],
tableBtn: [
this.$auth.hasPermi('equipment:check-record:detail')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('equipment:check-record:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:check-record:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
// this.$auth.hasPermi('equipment:check-record:detail')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:check-record:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:check-record:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
tableProps: [
{ prop: 'configName', label: '配置名称' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', 'PDA'][val] },
{ prop: 'configName', label: '巡检单名称' },
{ prop: 'equipmentName', label: '部门' },
{ prop: 'actualTime1', label: '巡检时间', filter: parseTime },
{ prop: 'actualTime', label: '班次' },
{ prop: 'opt', label: '巡检内容', name: '详情', subcomponent: btn },
{ prop: 'remark', label: '备注' }
// { prop: 'origin', label: '', filter: (val) => ['', '', 'PDA'][val] },
// { prop: 'sectionName', label: '' },
{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
// { prop: 'maintenanceDetail', label: '' },
{ prop: 'responsible', label: '巡检人' },
// { prop: 'responsible', label: '' },
],
searchBarFormConfig: [
{
type: 'select',
label: '设备',
placeholder: '请选择设备',
label: '巡检单名称',
placeholder: '请选择巡检单',
param: 'equipmentId',
filterable: true
},
//
{
type: 'datePicker',
label: '时间',
label: '巡检时间',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -138,16 +167,16 @@ export default {
name: 'export',
plain: true,
color: 'primary',
},
{
type: this.$auth.hasPermi('equipment:check-record:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
}
// {
// type: this.$auth.hasPermi('equipment:check-record:create')
// ? 'button'
// : '',
// btnName: '',
// name: 'add',
// plain: true,
// color: 'success',
// },
],
rows: [
[
@ -231,6 +260,17 @@ export default {
this.getList();
},
methods: {
handleEmitFun({action, value}) {
switch (action) {
//
case '巡检内容':
this.addContent = true;
this.$nextTick(() => {
this.$refs.addContent.init(value.id, true);
});
break;
}
},
initSearchBar() {
this.http('/base/core-equipment/page', 'get', {
special: false,

View File

@ -31,7 +31,7 @@
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
<!-- <base-dialog
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
@ -43,7 +43,11 @@
v-model="form"
:has-files="false"
:rows="rows" />
</base-dialog>
</base-dialog> -->
<add-content
v-if="addContent"
ref="addContent"
@refreshDataList="addContent = false" />
</div>
</template>
@ -53,6 +57,7 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
import { parseTime } from '@/utils/ruoyi'
import AddContent from '../PlanConfig/addContent.vue';
const remainBox = {
name: 'RemainBox',
@ -107,11 +112,12 @@ const btn = {
};
export default {
name: 'PlanConfig',
components: {},
name: 'Monitor',
components: { AddContent },
mixins: [basicPageMixin],
data() {
return {
addContent: false,
searchBarKeys: ['planId', 'equipmentId'],
tableProps: [
// {
@ -121,46 +127,53 @@ export default {
// width: 180,
// filter: parseTime(createTime),
// },
{ prop: 'name', label: '保养计划' },
{ prop: 'code', label: '保养计划单号' },
{ prop: 'name', label: '保养计划名称' },
{ prop: 'departmentName', label: '部门' },
{ prop: 'lineName', label: '产线名' },
{ prop: 'sectionName', label: '工段名' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'maintenancePeriod', label: '保养频率' },
{
prop: 'maintainType',
label: '保养类型',
filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
prop: 'lastPlanMaintainTime',
label: '上次计划保养时间',
filter: parseTime,
},
{
prop: 'lastMaintainTime',
label: '上次保养时间',
label: '上次实际保养时间',
filter: parseTime,
},
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
{ prop: 'nextMaintainTime', label: '下次计划保养时间', filter: parseTime },
{ prop: 'maintainer', label: '计划保养人员' },
// { prop: 'equipmentName', label: '' },
// { prop: 'equipmentCode', label: '' },
// { prop: 'maintenancePeriod', label: '' },
// {
// prop: 'maintainType',
// label: '',
// filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
// },
// { prop: 'opt1', label: '', name: '', subcomponent: btn },
{ prop: 'opt2', label: '保养内容', name: '详情', subcomponent: btn },
{
prop: 'remainDays',
label: '距离保养时间(天)',
label: '距离下次保养剩余时间(天)',
subcomponent: remainBox,
},
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
}
],
searchBarFormConfig: [
{
type: 'select',
label: '保养计划',
label: '保养计划名称',
placeholder: '请选择保养计划',
param: 'planId',
filterable: true,
},
{
type: 'select',
label: '设备名',
placeholder: '请选择设备',
param: 'equipmentId',
filterable: true,
},
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'equipmentId',
// filterable: true,
// },
{
type: 'button',
btnName: '查询',
@ -255,13 +268,18 @@ export default {
row: value
} })
break;
case '保养记录':
const queryData = {
equipmentId: value.equipmentId,
maintainPlanId: value.id,
relatePlan: value.lastMaintainTime ? 1 : 2
}
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
case '保养内容':
//
this.addContent = true;
this.$nextTick(() => {
this.$refs.addContent.init(value.id, true);
});
// const queryData = {
// equipmentId: value.equipmentId,
// maintainPlanId: value.id,
// relatePlan: value.lastMaintainTime ? 1 : 2
// }
// this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
break;
}
},

View File

@ -0,0 +1,65 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 15:27:31
* @LastEditors: zwq
* @LastEditTime: 2023-08-01 16:25:54
* @Description:
-->
<template>
<div :class="[className, { 'p-0': noPadding }]">
<slot />
</div>
</template>
<script>
export default {
props: {
size: {
// : xl lg md sm
type: String,
default: 'de',
validator: function (val) {
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
},
},
noPadding: {
type: Boolean,
default: false,
},
},
computed: {
className: function () {
return `${this.size}-title`;
},
},
};
</script>
<style lang="scss" scoped>
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px;
@each $size, $height in $pxls {
.#{$size}-title {
font-size: 18px;
line-height: $height;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
&::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: $height + 2px;
border-radius: 1px;
margin-right: $mgr;
background-color: #0b58ff;
}
}
}
.p-0 {
padding: 0;
}
</style>

View File

@ -0,0 +1,283 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-23 15:28:46
* @Description:
-->
<template>
<!-- <el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title> -->
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="保养计划名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入保养计划名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养计划编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
:disabled="isdetail"
placeholder="请输入保养计划编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="departmentId">
<treeselect v-model="dataForm.departmentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择部门"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产线名" prop="lineId">
<el-select
v-model="dataForm.lineId"
filterable
placeholder="请选择产线"
style="width: 100%">
<el-option
v-for="dict in proLineList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养频率" prop="maintenancePeriod">
<el-input-number v-model="dataForm.maintenancePeriod" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入保养频率" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="确认时限" prop="confirmTimeLimit">
<el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="保养时长" prop="maintainDuration">
<el-input-number v-model="dataForm.maintainDuration" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入保养时长" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="首次保养时间" prop="firstMaintenanceTime">
<el-date-picker
v-model="dataForm.firstMaintenanceTime"
type="date"
format='yyyy-MM-dd'
:disabled="isedit"
value-format='timestamp'
placeholder="选择首次保养时间"
style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer">
<el-input v-model="dataForm.maintainer" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入计划保养人员" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { createPlan, updatePlan, getCode, getPlan } from '@/api/equipment/base/maintain/planconfig';
import { getCorePLList } from '@/api/base/coreProductionLine';
import { parseTime } from '../../../../core/mixins/code-filter';
import attrAdd from './attr-add';
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
mixins: [basicAdd],
components: { attrAdd, Treeselect },
data() {
return {
addOrUpdateVisible: false,
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createPlan,
updateURL: updatePlan,
infoURL: getPlan
},
dataForm: {
id: undefined,
code: undefined,
name: '',
departmentId: undefined,
lineId: undefined,
maintenancePeriod: undefined,
confirmTimeLimit: undefined,
maintainDuration: undefined,
remark: undefined,
firstMaintenanceTime: undefined,
maintainer: undefined
},
menuOptions: [],
proLineList: [],
visible: false,
isdetail: false,
isedit: false,
dataRule: {
code: [{ required: true, message: "保养计划编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "保养计划名称不能为空", trigger: "blur" }],
departmentId: [{ required: true, message: "部门不能为空", trigger: "change" }],
lineId: [{ required: true, message: "产线不能为空", trigger: "change" }],
maintenancePeriod: [{ required: true, message: "保养频率不能为空", trigger: "blur" }],
confirmTimeLimit: [{ required: true, message: "确认时限不能为空", trigger: "blur" }],
maintainDuration: [{ required: true, message: "保养时长不能为空", trigger: "blur" }],
firstMaintenanceTime: [{ required: true, message: "首次保养时间不能为空", trigger: "blur" }],
maintainer: [{ required: true, message: "计划保养人员不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
//
this.menuOptions = []
const res = await getCoreDepartmentList();
this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0
return item
});
// const menu = { id: 0, name: '', children: [] };
// menu.children = this.handleTree(this.departmentlList, "id")
this.menuOptions = this.handleTree(this.departmentlList, "id")
// 线
const resline = await getCorePLList();
this.proLineList = resline.data;
},
getList() {
//
// getCoreProductAttrPage({
// ...this.listQuery,
// productId: this.dataForm.id,
// }).then((response) => {
// this.productAttrList = response.data.list;
// this.listQuery.total = response.data.total;
// });
},
init(id, isdetail) {
// this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.isedit = id ? true : false;
console.log('你好22', id)
this.visible = true;
// if (id) {
// this.idAttrShow = true
// } else {
// this.idAttrShow = false
// }
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL({ id: this.dataForm.id }).then(response => {
this.dataForm = response.data
// if (this.dataForm.materialType !== undefined) {
// this.dataForm.materialType = String(this.dataForm.materialType)
// }
// if (this.dataForm.productType !== undefined) {
// this.dataForm.productType = String(this.dataForm.productType)
// }
});
//
// this.getList();
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
this.initData();
},
goEdit() {
this.isdetail = false;
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.name,
children: node.children
};
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
// this.idAttrShow = true
this.dataForm.id = response.data
// this.visible = false;
this.$emit("refreshDataList");
});
});
}
}
};
</script>
<style scoped>
</style>

View File

@ -0,0 +1,308 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-23 19:48:12
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ '添加内容' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">保养计划名称</div>
<div class="lightTip">{{ dataForm.name }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">部门</div>
<div class="lightTip">{{ dataForm.departmentName }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">产线名</div>
<div class="lightTip">{{ dataForm.lineName }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">保养频率</div>
<div class="lightTip">{{ dataForm.maintenancePeriod }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">保养时长</div>
<div class="lightTip">{{ dataForm.maintainDuration }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">计划保养人员</div>
<div class="lightTip">{{ dataForm.maintainer }}</div>
</el-col>
</el-row>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
保养内容
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="planList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:plan-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { getPlan, deletePlanDet, getPlanDetPage } from '@/api/equipment/base/maintain/planconfig';
// import { listData } from "@/api/system/dict/data";
import SmallTitle from './SmallTitle';
// import { parseTime } from '../../../../core/mixins/code-filter';
import attrAdd from './attr-add';
// import { getDictDatas } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'equipmentName',
label: '设备名称',
},
{
prop: 'program',
label: '保养项目',
},
];
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: false,
infoURL: getPlan
},
listQuery: {
pageSize: 99,
pageNo: 1,
total: 0
},
dataForm: {},
planList: [],
visible: false,
isdetail: false,
idAttrShow: false
};
},
mounted() {},
methods: {
initData() {
this.planList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`是否确认删除保养项目名为"${raw.data.program}"的数据项?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deletePlanDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getPlanDetPage({
...this.listQuery,
planId: this.dataForm.id,
}).then((response) => {
this.planList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
if (this.dataForm.id) {
//
this.urlOptions.infoURL({ id: id}).then(response => {
this.dataForm = response.data;
});
//
this.getList();
}
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 18vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: -40px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
/* height: 16px; */
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
</style>

View File

@ -0,0 +1,167 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="设备名称" prop="equipmentId">
<el-select
v-model="dataForm.equipmentId"
filterable
style="width: 100%"
placeholder="请选择设备">
<el-option
v-for="dict in eqList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="保养项目" prop="program">
<el-input
v-model="dataForm.program"
placeholder="请输入保养项目"
clearable />
</el-form-item>
<el-form-item label="保养描述" prop="maintenanceDes">
<el-input
v-model="dataForm.maintenanceDes"
placeholder="请输入保养描述"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig';
import { getEquipmentPage } from '@/api/base/equipment'
export default {
props: {
planId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
eqList: [],
dataForm: {
id: undefined,
equipmentId: '',
program: '',
maintenanceDes: ''
},
dataRule: {
equipmentId: [{ required: true, message: '设备不能为空', trigger: 'change' }],
program: [{ required: true, message: '保养项目不能为空', trigger: 'blur' }],
maintenanceDes: [{ required: true, message: '保养描述不能为空', trigger: 'blur' }]
},
};
},
created() {
this.getDict()
},
methods: {
async getDict() {
const res = await getEquipmentPage({
pageNo: 1,
pageSize: 100,
special: false
})
this.eqList = res.data.list
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getPlanDet({
id: this.dataForm.id
}).then((res) => {
const { equipmentId, program, maintenanceDes } = res.data;
this.dataForm.equipmentId = equipmentId;
this.dataForm.program = program;
this.dataForm.maintenanceDes = maintenanceDes;
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updatePlanDet({
...this.dataForm,
planId: this.planId,
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createPlanDet({
...this.dataForm,
planId: this.planId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -1,143 +1,150 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
@clickBtn="handleClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- <add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" /> -->
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm
v-if="open"
ref="form"
v-model="form"
:has-files="false"
:rows="rows" />
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="55%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
<add-content
v-if="addContent"
ref="addContent"
@refreshDataList="addContent = false" />
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'
import AddOrUpdate from './add-or-updata';
import AddContent from './addContent';
import basicPage from '../../../../core/mixins/basic-page';
import { parseTime, toDay } from '../../../../core/mixins/code-filter';
import { publicFormatter } from '@/utils/dict';
import { getPlanPage } from '@/api/equipment/base/maintain/planconfig';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record';
const tableProps = [
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'name',
label: '保养计划名称'
},
{
prop: 'departmentName',
label: '部门'
},
{
prop: 'lineName',
label: '产线名'
},
{
prop: 'maintenancePeriod',
label: '保养频率(天/次)'
},
{
prop: 'firstMaintenanceTime',
label: '首次保养时间',
filter: parseTime
},
{
prop: 'maintainDuration',
label: '保养时长'
},
{
prop: 'maintainer',
label: '计划保养人员'
},
{
prop: 'confirmTimeLimit',
label: '确认时限',
filter: toDay
},
{
prop: 'remark',
label: '备注'
}
];
export default {
name: 'PlanConfig',
components: {},
mixins: [basicPageMixin],
mixins: [basicPage],
data() {
const t = new Date();
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
return {
searchBarKeys: ['equipmentName', 'createTime'],
tableBtn: [
{
type: 'detail',
btnName: '保养记录',
urlOptions: {
getDataListURL: getPlanPage,
deleteURL: deleteEqMaintainPlan
},
this.$auth.hasPermi('equipment:plan-config:update')
tableProps,
addContent: false,
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
special: false,
planName: undefined
},
tableBtn: [
this.$auth.hasPermi(`equipment:plan-config:add`)
? {
type: 'edit',
btnName: '修改',
type: 'add',
btnName: '添加内容',
}
: undefined,
this.$auth.hasPermi('equipment:plan-config:delete')
this.$auth.hasPermi(`equipment:plan-config:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`equipment:plan-config:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v)=>v),
tableProps: [
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'name', label: '计划名称' },
{ prop: 'code', label: '计划编号' },
{ prop: 'enabled', label: '启用状态', filter: (val) => ['停用', '启用'][val] },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
{ prop: 'remark', label: '备注' },
],
searchBarFormConfig: [
tableData: [],
formConfig: [
{
type: 'input',
label: '设备名',
placeholder: '请输入设备名称',
param: 'equipmentName',
label: '保养计划名称',
placeholder: '保养计划名称',
param: 'planName'
},
//
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
// // valueFormat: 'timestamp',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// defaultTime: ['00:00:00', '23:59:59'],
// param: 'createTime',
// // defaultSelect: [
// // new Date(y, m, d)
// // .toLocaleString()
// // .split('/')
// // .map((item, index) => {
// // if (index == 1 || index == 2) return item.padStart(2, '0');
// // return item;
// // })
// // .join('-'),
// // new Date(y, m, d, 23, 59, 59)
// // .toLocaleString()
// // .split('/')
// // .map((item, index) => {
// // if (index == 1 || index == 2) return item.padStart(2, '0');
// // return item;
// // })
// // .join('-'),
// // ],
// },
{
type: 'button',
btnName: '查询',
@ -148,228 +155,81 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:plan-config:create')
? 'button'
: '',
type: this.$auth.hasPermi('equipment:plan-config:create') ? 'button' : '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
rows: [
[
{
input: true,
label: '计划名称',
prop: 'name',
rules: [{ required: true, message: '计划名称不能为空', trigger: 'blur' }],
},
{
input: true,
label: '计划编号',
prop: 'code',
url: '/base/equipment-maintain-plan/getCode',
rules: [{ required: true, message: '计划编号不能为空', trigger: 'blur' }],
plain: true
},
],
[
{
select: true,
label: '设备名称',
prop: 'equipmentId',
// url: '/base/core-equipment/listAll?special=false',
url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
},
{
select: true,
label: '保养类型',
prop: 'maintainType',
options: this.getDictDatas(this.DICT_TYPE.MAINTAIN_TYPE),
},
],
[
{
input: true,
label: '保养时长(h)',
prop: 'maintainDuration',
rules: [
{
type: 'number',
trigger: 'blur',
message: '请输入正确的数字',
transform: (val) => Number(val),
},
],
},
{
input: true,
label: '保养频率(天/次)',
prop: 'maintenancePeriod',
rules: [
{
type: 'number',
trigger: 'blur',
message: '请输入正确的数字',
transform: (val) => Number(val),
},
],
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
},
],
[
{
switch: true,
label: '启用状态',
prop: 'enabled',
bind: {
'active-value': 1,
'inactive-value': 0,
},
}
],
[{ input: true, label: '备注', prop: 'remark' }],
],
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
special: false,
equipmentName: null,
createTime: null,
},
//
form: {},
basePath: '/base/equipment-maintain-plan',
};
},
created() {
if (this.$route.query) {
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentName ?? undefined
}
this.getList();
components: {
AddOrUpdate,
AddContent
},
created() {},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
this.recv(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
code: null,
name: null,
equipmentId: null,
enabled: null,
maintenancePeriod: null,
maintainDuration: null,
maintainType: null,
remark: null,
enabled: 1
};
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加保养计划';
},
handleDetail(row){
// alert(' ')
// console.log(row)
const queryData = {
equipmentId: row.equipmentId,
maintainPlanId: row.id,
isAdd: 1
// relatePlan: row.enabled
}
if (this.queryParams.createTime) {
queryData.createTime = this.queryParams.createTime
}
console.log('你好', queryData)
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
// this.$router.push({ path: '/equipment/base/maintain/record', query: { orderNo: row.orderNo }})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改保养计划';
});
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
this.put(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
return;
}
//
this.post(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除计划名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteEqMaintainPlan(id);
//
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除产品名称为"${name}"的数据项`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
//
otherMethods(val) {
if (val.type === 'add') {
this.addContent = true;
// this.addOrEditTitle = '';
this.$nextTick(() => {
this.$refs.addContent.init(val.data.id);
});
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
this.listQuery.planName = val.planName ? val.planName : undefined;
this.listQuery.code = val.code ? val.code : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};

View File

@ -0,0 +1,376 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm
v-if="open"
ref="form"
v-model="form"
:has-files="false"
:rows="rows" />
</base-dialog>
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'
import { publicFormatter } from '@/utils/dict';
export default {
name: 'PlanConfig',
components: {},
mixins: [basicPageMixin],
data() {
const t = new Date();
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
return {
searchBarKeys: ['equipmentName', 'createTime'],
tableBtn: [
{
type: 'detail',
btnName: '保养记录',
},
this.$auth.hasPermi('equipment:plan-config:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:plan-config:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableProps: [
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'name', label: '计划名称' },
{ prop: 'code', label: '计划编号' },
{ prop: 'enabled', label: '启用状态', filter: (val) => ['停用', '启用'][val] },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
{ prop: 'remark', label: '备注' },
],
searchBarFormConfig: [
{
type: 'input',
label: '设备名',
placeholder: '请输入设备名称',
param: 'equipmentName',
},
//
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
// // valueFormat: 'timestamp',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// defaultTime: ['00:00:00', '23:59:59'],
// param: 'createTime',
// // defaultSelect: [
// // new Date(y, m, d)
// // .toLocaleString()
// // .split('/')
// // .map((item, index) => {
// // if (index == 1 || index == 2) return item.padStart(2, '0');
// // return item;
// // })
// // .join('-'),
// // new Date(y, m, d, 23, 59, 59)
// // .toLocaleString()
// // .split('/')
// // .map((item, index) => {
// // if (index == 1 || index == 2) return item.padStart(2, '0');
// // return item;
// // })
// // .join('-'),
// // ],
// },
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:plan-config:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
rows: [
[
{
input: true,
label: '计划名称',
prop: 'name',
rules: [{ required: true, message: '计划名称不能为空', trigger: 'blur' }],
},
{
input: true,
label: '计划编号',
prop: 'code',
url: '/base/equipment-maintain-plan/getCode',
rules: [{ required: true, message: '计划编号不能为空', trigger: 'blur' }],
},
],
[
{
select: true,
label: '设备名称',
prop: 'equipmentId',
// url: '/base/core-equipment/listAll?special=false',
url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
},
{
select: true,
label: '保养类型',
prop: 'maintainType',
options: this.getDictDatas(this.DICT_TYPE.MAINTAIN_TYPE),
},
],
[
{
input: true,
label: '保养时长(h)',
prop: 'maintainDuration',
rules: [
{
type: 'number',
trigger: 'blur',
message: '请输入正确的数字',
transform: (val) => Number(val),
},
],
},
{
input: true,
label: '保养频率(天/次)',
prop: 'maintenancePeriod',
rules: [
{
type: 'number',
trigger: 'blur',
message: '请输入正确的数字',
transform: (val) => Number(val),
},
],
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
},
],
[
{
switch: true,
label: '启用状态',
prop: 'enabled',
bind: {
'active-value': 1,
'inactive-value': 0,
},
}
],
[{ input: true, label: '备注', prop: 'remark' }],
],
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
special: false,
equipmentName: null,
createTime: null,
},
//
form: {},
basePath: '/base/equipment-maintain-plan',
};
},
created() {
if (this.$route.query) {
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentName ?? undefined
}
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
this.recv(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
code: null,
name: null,
equipmentId: null,
enabled: null,
maintenancePeriod: null,
maintainDuration: null,
maintainType: null,
remark: null,
enabled: 1
};
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加保养计划';
},
handleDetail(row){
// alert(' ')
// console.log(row)
const queryData = {
equipmentId: row.equipmentId,
maintainPlanId: row.id,
isAdd: 1
// relatePlan: row.enabled
}
if (this.queryParams.createTime) {
queryData.createTime = this.queryParams.createTime
}
console.log('你好', queryData)
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
// this.$router.push({ path: '/equipment/base/maintain/record', query: { orderNo: row.orderNo }})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改保养计划';
});
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
this.put(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
return;
}
//
this.post(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除计划名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteEqMaintainPlan(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
},
};
</script>

View File

@ -0,0 +1,294 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-24 16:59:05
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ '设备保养记录详情' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">计划保养人员</div>
<div class="lightTip">{{ dataForm.planMaintainWorker }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">实际保养人员</div>
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
</el-col>
</el-row>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
保养内容
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="planList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
<!-- <attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:plan-id="dataForm.id"
@refreshDataList="getList" /> -->
</el-drawer>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { getLog, deleteLogDet, getLogDetPage } from '@/api/equipment/base/maintain/record';
// import { listData } from "@/api/system/dict/data";
import SmallTitle from '../PlanConfig/SmallTitle';
// import { parseTime } from '../../../../core/mixins/code-filter';
// import attrAdd from './attr-add';
// import { getDictDatas } from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'equipmentName',
label: '设备名称',
},
{
prop: 'program',
label: '保养项目',
},
{
prop: 'maintenanceDes',
label: '保养描述',
}
];
export default {
mixins: [basicAdd],
components: { SmallTitle },
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
urlOptions: {
isGetCode: false,
infoURL: getLog
},
listQuery: {
pageSize: 99,
pageNo: 1,
total: 0
},
dataForm: {},
planList: [],
visible: false,
isdetail: false,
idAttrShow: false
};
},
mounted() {},
methods: {
initData() {
this.planList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`是否确认删除保养项目名为"${raw.data.program}"的数据项?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteLogDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getLogDetPage({
...this.listQuery,
logId: this.dataForm.id,
}).then((response) => {
this.planList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
if (id) {
this.idAttrShow = true
} else {
this.idAttrShow = false
}
this.$nextTick(() => {
if (this.dataForm.id) {
//
this.urlOptions.infoURL({ id: id}).then(response => {
this.dataForm = response.data;
});
//
this.getList();
}
});
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
}
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 10vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: -40px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
/* height: 16px; */
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
</style>

View File

@ -51,6 +51,10 @@
</el-col>
</el-row>
</base-dialog>
<add-content
v-if="addContent"
ref="addContent"
@refreshDataList="addContent = false" />
</div>
</template>
@ -59,15 +63,37 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import Editor from '@/components/Editor';
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
import AddContent from './addContent.vue';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = {
name: 'tableBtn',
props: ['injectData'],
data() {
return {};
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
},
},
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.name}
</el-button>
);
},
};
export default {
name: 'EquipmentMaintainRecord',
components: {},
components: { AddContent },
mixins: [basicPageMixin],
data() {
return {
addContent: false,
searchBarKeys: [
'maintainPlanId',
'startTime',
@ -75,65 +101,70 @@ export default {
'equipmentId',
],
tableBtn: [
this.$auth.hasPermi('equipment:maintain-record:update')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('equipment:maintain-record:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:maintain-record:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
// this.$auth.hasPermi('equipment:maintain-record:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:maintain-record:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:maintain-record:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
tableProps: [
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
filter: timeFilter,
},
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: timeFilter,
// },
{ prop: 'maintainOrderNumber', label: '设备保养单号' },
{ prop: 'startTime', label: '开始时间', filter: timeFilter },
{ prop: 'endTime', label: '结束时间', filter: timeFilter },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainWorker', label: '保养人员' },
{ prop: 'planName', label: '保养计划名称' },
{ prop: 'departmentName', label: '部门' },
{ prop: 'lineName', label: '产线名' },
{ prop: 'planStartTime', label: '计划开始时间', filter: timeFilter },
{ prop: 'planEndTime', label: '计划结束时间', filter: timeFilter },
{ prop: 'startTime', label: '实际开始时间', filter: timeFilter },
{ prop: 'endTime', label: '实际结束时间', filter: timeFilter },
// { prop: 'equipmentName', label: '' },
// { prop: 'maintainWorker', label: '' },
{
prop: 'relatePlan',
label: '是否计划保养',
filter: (v) => (v != null ? ['', '是', '否'][v] : ''),
label: '保养计划类型',
filter: (v) => (v != null ? ['', '计划型', '非计划型'][v] : ''),
},
{ prop: 'planName', label: '保养计划名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'timeUsed', label: '实际保养用时(h)' },
{ prop: 'remark', label: '备注' },
{ prop: 'opt', label: '详情', name: '详情', subcomponent: btn }
// { prop: 'maintainDuration', label: '(h)' },
// { prop: 'timeUsed', label: '(h)' },
// { prop: 'remark', label: '' },
],
searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'equipmentId',
// },
{
type: 'select',
label: '设备',
placeholder: '请选择设备',
param: 'equipmentId',
},
{
type: 'select',
label: '计划名称',
label: '保养计划名称',
placeholder: '请选择计划名称',
param: 'maintainPlanId',
},
//
{
type: 'datePicker',
label: '保养开始时间',
label: '实际开始时间',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -144,15 +175,15 @@ export default {
param: 'startTime',
// width: 350,
},
{
type: 'select',
label: '是否计划保养',
selectOptions: [
{ name: '是', id: 1 },
{ name: '否', id: 2 },
],
param: 'relatePlan',
},
// {
// type: 'select',
// label: '',
// selectOptions: [
// { name: '', id: 1 },
// { name: '', id: 2 },
// ],
// param: 'relatePlan',
// },
{
type: 'button',
btnName: '查询',
@ -170,24 +201,24 @@ export default {
name: 'export',
plain: true,
color: 'primary',
},
{
type: this.$auth.hasPermi('equipment:maintain-record:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
}
// {
// type: this.$auth.hasPermi('equipment:maintain-record:create')
// ? 'button'
// : '',
// btnName: '',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: this.$auth.hasPermi('equipment:maintain-record:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
rows: [
[
@ -339,6 +370,18 @@ export default {
}
},
methods: {
handleEmitFun({action, value}) {
switch (action) {
//
case '详情':
// this.handleDetail({ id: value.id })
this.addContent = true;
this.$nextTick(() => {
this.$refs.addContent.init(value.id, true);
});
break;
}
},
initSearchBar() {
this.http('/base/core-equipment/page', 'get', {
special: false,

View File

@ -68,7 +68,7 @@ export default {
data() {
return {
addOrUpdateVisible: false,
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
searchBarKeys: ['maintenanceResult', 'createTime', 'equipmentId'],
tableBtn: [
this.$auth.hasPermi('equipment:repair:update')
? {
@ -76,18 +76,18 @@ export default {
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('equipment:repair:finish')
? {
type: 'finish',
btnName: '完成',
}
: undefined,
this.$auth.hasPermi('equipment:repair:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
// this.$auth.hasPermi('equipment:repair:finish')
// ? {
// type: 'finish',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:repair:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:repair:delete')
? {
type: 'delete',
@ -96,33 +96,40 @@ export default {
: undefined,
].filter((v) => v),
tableProps: [
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: parseTime,
// },
{ prop: 'repairOrderNumber', label: '维修单号' },
{ prop: 'lineName', label: '产线名' },
{ prop: 'sectionName', label: '工段名' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'faultDetail', label: '故障明细' },
// { prop: 'maintenanceDetail', label: '', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
prop: 'maintenanceStartTime',
label: '维修开始时间',
filter: parseTime,
},
{ prop: 'repairOrderNumber', label: '设备维修单号' },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
{
prop: 'maintenanceFinishTime',
label: '结束时间',
label: '维修结束时间',
filter: parseTime,
},
// { prop: 'maintenanceStartTime', label: '', filter: parseTime },
{
prop: 'maintenanceStatus',
label: '维修状态',
filter: (v) => (v != null ? ['未完成', '完成', '进行中'][v] : ''),
prop: 'maintenanceResult',
label: '维修结果',
filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
},
{ prop: 'maintenanceDuration', label: '维修时长(h)' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true },
// { prop: 'maintenanceDuration', label: '(h)' },
{ prop: 'remark', label: '维修描述' }, //
// { prop: 'repairman', label: '', minWidth: 100, showOverflowtooltip: true },
// { prop: 'repairmanPhone', label: '', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true }
],
searchBarFormConfig: [
{
@ -134,13 +141,12 @@ export default {
},
{
type: 'select',
label: '状态',
label: '维修结果',
placeholder: '请选择状态',
param: 'maintenanceStatus',
param: 'maintenanceResult',
selectOptions: [
{ name: '未完成', id: '0' },
{ name: '完成', id: '1' },
{ name: '进行中', id: '2' },
{ name: '成功', id: '0' },
{ name: '失败', id: '1' }
],
},
//
@ -253,7 +259,7 @@ export default {
pageNo: 1,
pageSize: 10,
special: false,
maintenanceStatus: null,
maintenanceResult: null,
createTime: null,
equipmentId: null,
},