部分bug
This commit is contained in:
@@ -52,6 +52,7 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
const remainBox = {
|
||||
name: 'RemainBox',
|
||||
@@ -99,7 +100,7 @@ const btn = {
|
||||
render: function (h) {
|
||||
return (
|
||||
<el-button type="text" onClick={this.handleClick}>
|
||||
{this.injectData.label}
|
||||
{this.injectData.name}
|
||||
</el-button>
|
||||
);
|
||||
},
|
||||
@@ -113,16 +114,16 @@ export default {
|
||||
return {
|
||||
searchBarKeys: ['planId', 'equipmentId'],
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'name', label: '保养计划' },
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'sectionName', label: '工段名' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率' },
|
||||
@@ -134,16 +135,16 @@ export default {
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次保养时间',
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间' },
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离保养时间(天)',
|
||||
subcomponent: remainBox,
|
||||
},
|
||||
{ prop: 'opt1', label: '设备保养', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', subcomponent: btn },
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@@ -243,15 +244,16 @@ export default {
|
||||
switch (action) {
|
||||
// 查看详情
|
||||
case '设备保养':
|
||||
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: {
|
||||
equipmentId: value.equipmentId,
|
||||
equipmentName: value.equipmentName
|
||||
this.$router.push({ path: '/equipment/base/maintain/record',query: {
|
||||
addRecord: 1,
|
||||
row: value
|
||||
} })
|
||||
break;
|
||||
case '保养记录':
|
||||
const queryData = {
|
||||
equipmentId: value.equipmentId,
|
||||
maintainPlanId: value.id
|
||||
maintainPlanId: value.id,
|
||||
relatePlan: value.lastMaintainTime ? 1 : 2
|
||||
}
|
||||
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
|
||||
break;
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
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',
|
||||
@@ -95,7 +96,7 @@ export default {
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
|
||||
{ prop: 'maintainType', label: '保养类型' },
|
||||
{ prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -224,6 +225,17 @@ export default {
|
||||
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
switch: true,
|
||||
label: '启用状态',
|
||||
prop: 'enabled',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
},
|
||||
}
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
@@ -300,7 +312,8 @@ export default {
|
||||
const queryData = {
|
||||
equipmentId: row.equipmentId,
|
||||
maintainPlanId: row.id,
|
||||
relatePlan: row.enabled
|
||||
isAdd: 1
|
||||
// relatePlan: row.enabled
|
||||
}
|
||||
if (this.queryParams.createTime) {
|
||||
queryData.createTime = this.queryParams.createTime
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import Editor from '@/components/Editor';
|
||||
import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record';
|
||||
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -311,13 +311,16 @@ export default {
|
||||
this.searchBarFormConfig[0].defaultSelect =
|
||||
this.$route.query.equipmentId ?? undefined;
|
||||
this.searchBarFormConfig[1].defaultSelect =
|
||||
Number(this.$route.query.maintainPlanId) ?? undefined;
|
||||
this.$route.query.maintainPlanId ?? undefined;
|
||||
this.searchBarFormConfig[2].defaultSelect =
|
||||
this.$route.query?.createTime ?? undefined;
|
||||
this.searchBarFormConfig[3].defaultSelect =
|
||||
Number(this.$route.query.relatePlan) ?? undefined;
|
||||
}
|
||||
this.getList();
|
||||
if (this.$route.query.addRecord) {
|
||||
this.handleAdd()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
@@ -398,6 +401,19 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
if (this.$route.query.addRecord) {
|
||||
// 赋值
|
||||
const tempRow = this.$route.query.row
|
||||
this.form.equipmentId = tempRow.equipmentId
|
||||
this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2
|
||||
this.form.startTime = tempRow.nextMaintainTime
|
||||
this.form.maintainPlanId = tempRow.id
|
||||
}
|
||||
if (this.$route.query.isAdd) {
|
||||
// 赋值
|
||||
this.form.equipmentId = this.$route.query.equipmentId
|
||||
this.form.maintainPlanId = this.$route.query.maintainPlanId
|
||||
}
|
||||
this.open = true;
|
||||
this.title = '添加保养记录';
|
||||
},
|
||||
@@ -440,7 +456,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否删除设备名称为"' + row.equipmentName + '"的数据项?')
|
||||
.confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEqMaintainLog(id);
|
||||
})
|
||||
@@ -456,7 +472,7 @@ export default {
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改保养记录';
|
||||
this.title = '查看保养记录详情';
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@@ -469,10 +485,10 @@ export default {
|
||||
.confirm('是否确认导出所有保养记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
return exportMaintainLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '保养记录.xls');
|
||||
this.$download.excel(response, '设备保养记录.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
Reference in New Issue
Block a user