projects/mesxc-lb #287

Merged
juzi merged 5 commits from projects/mesxc-lb into projects/mesxc-test 2024-03-27 16:58:28 +08:00
18 changed files with 327 additions and 384 deletions
Showing only changes of commit e0fac4556d - Show all commits

View File

@ -1,21 +0,0 @@
<template>
<div>
<svg-icon icon-class="question" @click="goto"/>
</div>
</template>
<script>
export default {
name: 'YudaoDoc',
data() {
return {
url: 'https://doc.iocoder.cn/'
}
},
methods: {
goto() {
window.open(this.url)
}
}
}
</script>

View File

@ -1,21 +0,0 @@
<template>
<div>
<svg-icon icon-class="github" @click="goto"/>
</div>
</template>
<script>
export default {
name: 'YudaoGit',
data() {
return {
url: 'https://github.com/YunaiV/ruoyi-vue-pro'
}
},
methods: {
goto() {
window.open(this.url)
}
}
}
</script>

View File

@ -0,0 +1,60 @@
/**
* 本文件保存一些 BaseTable 会用到的组件
*/
// 操作按钮
export const TableBtn = {
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.entryText}
</el-button>
);
},
};
// 余量
export const RemainBox = {
name: 'RemainBox',
props: ['injectData'],
data() {
return {};
},
computed: {
value() {
return this.injectData[this.injectData.prop] || null;
},
color() {
if (this.value) {
const v = +this.value;
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F';
}
return 'unset';
},
},
render: function (h) {
return (
<div
style={`background: ${
this.color
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${'#fff'}`}>
{this.injectData[this.injectData.prop]?.toFixed(0) || ''}
</div>
);
},
};

View File

@ -0,0 +1,18 @@
export default {
data() {
return {
tableH: this.tableHeight(260),
};
},
created() {
window.addEventListener('resize', this._setTableHeight);
},
destroyed() {
window.removeEventListener('resize', this._setTableHeight);
},
methods: {
_setTableHeight() {
this.tableH = this.tableHeight(260);
},
},
};

View File

@ -19,6 +19,7 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
:max-height="tableH"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -115,6 +116,7 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import EquipmentDrawer from '../components/firefightingDrawer'; import EquipmentDrawer from '../components/firefightingDrawer';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue'; import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
@ -135,7 +137,7 @@ export default {
EquipmentDrawer, EquipmentDrawer,
BaseDialog: BaseDialogWrapper, BaseDialog: BaseDialogWrapper,
}, },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
searchBarKeys: ['name', 'code'], searchBarKeys: ['name', 'code'],
@ -160,17 +162,28 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '设备名称' }, { prop: 'name', label: '设备名称', showOverflowtooltip: true },
{ width: 256, prop: 'code', label: '设备编码' }, {
{ prop: 'location', label: '位置' }, width: 200,
{ prop: 'responsiblePeopleName', label: '负责人' }, prop: 'code',
label: '设备编码',
showOverflowtooltip: true,
},
{ prop: 'location', label: '位置', showOverflowtooltip: true },
{
prop: 'responsiblePeopleName',
label: '负责人',
showOverflowtooltip: true,
},
{ {
prop: 'dueDate', prop: 'dueDate',
width: 200,
label: '有效期至', label: '有效期至',
howOverflowTooltip: true,
filter: (val) => filter: (val) =>
val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '--', val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '--',
}, },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注', showOverflowtooltip: true },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -285,7 +298,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
code: '', code: '',
name: '', name: '',
}, },

View File

@ -19,6 +19,7 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
:max-height="tableH"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -115,6 +116,7 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import EquipmentDrawer from '../components/manageDrawer'; import EquipmentDrawer from '../components/manageDrawer';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue'; import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
@ -133,9 +135,9 @@ export default {
components: { components: {
Editor, Editor,
EquipmentDrawer, EquipmentDrawer,
BaseDialog: BaseDialogWrapper BaseDialog: BaseDialogWrapper,
}, },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
searchBarKeys: ['name', 'code'], searchBarKeys: ['name', 'code'],
@ -167,11 +169,20 @@ export default {
// width: 180, // width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// }, // },
{ prop: 'name', label: '设备名称' }, { prop: 'name', label: '设备名称', showOverflowtooltip: true },
{ width: 256, prop: 'code', label: '设备编码' }, {
{ prop: 'location', label: '位置' }, width: 256,
{ prop: 'responsiblePeopleName', label: '负责人' }, prop: 'code',
{ prop: 'remark', label: '备注' }, label: '设备编码',
showOverflowtooltip: true,
},
{ prop: 'location', label: '位置', showOverflowtooltip: true },
{
prop: 'responsiblePeopleName',
label: '负责人',
showOverflowtooltip: true,
},
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -277,7 +288,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
code: '', code: '',
name: '', name: '',
}, },
@ -407,15 +418,15 @@ export default {
// this.title = ''; // this.title = '';
// }); // });
}, },
handleDetail(row, mode='detail') { handleDetail(row, mode = 'detail') {
const {id} = row; const { id } = row;
this.form.id = id; this.form.id = id;
// //
this.editMode = mode; this.editMode = mode;
this.editVisible = true; this.editVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['drawer'].init(); this.$refs['drawer'].init();
}) });
// this.reset(); // this.reset();
// this.showUploadComponents = false; // this.showUploadComponents = false;
// const id = row.id; // const id = row.id;

View File

@ -19,6 +19,7 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
:max-height="tableH"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -115,6 +116,7 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import EquipmentDrawer from '../components/safetyDrawer'; import EquipmentDrawer from '../components/safetyDrawer';
import { import {
createEquipment, createEquipment,
@ -134,7 +136,7 @@ export default {
EquipmentDrawer, EquipmentDrawer,
BaseDialog: BaseDialogWrapper, BaseDialog: BaseDialogWrapper,
}, },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
searchBarKeys: ['name', 'code'], searchBarKeys: ['name', 'code'],
@ -166,11 +168,20 @@ export default {
// width: 180, // width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// }, // },
{ prop: 'name', label: '设备名称' }, { prop: 'name', label: '设备名称', showOverflowtooltip: true },
{ width: 256, prop: 'code', label: '设备编码' }, {
{ prop: 'location', label: '位置' }, width: 200,
{ prop: 'responsiblePeopleName', label: '负责人' }, prop: 'code',
{ prop: 'remark', label: '备注' }, label: '设备编码',
showOverflowtooltip: true,
},
{ prop: 'location', label: '位置', showOverflowtooltip: true },
{
prop: 'responsiblePeopleName',
label: '负责人',
showOverflowtooltip: true,
},
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -275,7 +286,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
code: '', code: '',
name: '', name: '',
}, },

View File

@ -9,6 +9,7 @@
<el-table <el-table
:data="tableDataWithIndex" :data="tableDataWithIndex"
:border="true" :border="true"
:max-height="tableH"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
style="width: 100%" style="width: 100%"
:header-cell-style="{ :header-cell-style="{
@ -20,25 +21,40 @@
type="selection" type="selection"
:width="50" :width="50"
:selectable="checkSelectable" /> :selectable="checkSelectable" />
<el-table-column prop="_pageIndex" width="80" align="center"> <el-table-column
prop="_pageIndex"
width="80"
align="center">
<template slot="header"> <template slot="header">
<el-popover placement="bottom-start" width="300" trigger="click"> <el-popover
<div class="setting-box" style="max-height: 400px; overflow-y: auto"> placement="bottom-start"
width="300"
trigger="click">
<div
class="setting-box"
style="max-height: 400px; overflow-y: auto">
<el-checkbox <el-checkbox
v-for="(item, index) in tablePropsLabelList" v-for="(item, index) in tablePropsLabelList"
:key="'cb' + index" :key="'cb' + index"
v-model="selectedBox[index]" v-model="selectedBox[index]"
:label="item.label" /> :label="item.label" />
</div> </div>
<i slot="reference" class="el-icon-s-tools" /> <i
slot="reference"
class="el-icon-s-tools" />
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[0]" v-if="selectedBox[0]"
label="巡检单名称" label="巡检单名称"
:show-overflow-tooltip="true"
prop="name"></el-table-column> prop="name"></el-table-column>
<el-table-column v-if="selectedBox[1]" label="部门" prop="planName"> <el-table-column
v-if="selectedBox[1]"
label="部门"
:show-overflow-tooltip="true"
prop="planName">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.department || '---' }} {{ scope.row.department || '---' }}
</template> </template>
@ -46,12 +62,18 @@
<el-table-column <el-table-column
v-if="selectedBox[2]" v-if="selectedBox[2]"
label="巡检时间" label="巡检时间"
width="160"
:show-overflow-tooltip="true"
prop="planCheckTime"> prop="planCheckTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.planCheckTime | timeFilter }} {{ scope.row.planCheckTime | timeFilter }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="selectedBox[3]" label="班次" prop="groupClass"> <el-table-column
v-if="selectedBox[3]"
label="班次"
:show-overflow-tooltip="true"
prop="groupClass">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.groupClass || '---' }} {{ scope.row.groupClass || '---' }}
</template> </template>
@ -59,6 +81,8 @@
<el-table-column <el-table-column
v-if="selectedBox[4]" v-if="selectedBox[4]"
label="确认截止时间" label="确认截止时间"
width="160"
:show-overflow-tooltip="true"
prop="confirmDueTime"> prop="confirmDueTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.confirmDueTime | timeFilter }} {{ scope.row.confirmDueTime | timeFilter }}
@ -66,17 +90,21 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[5]" v-if="selectedBox[5]"
width="150"
label="备注" label="备注"
:show-overflow-tooltip="true"
prop="remark"> prop="remark">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.remark }} {{ scope.row.remark }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="188" label="操作"> <el-table-column
width="188"
label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip content="确认" placement="top"> <el-tooltip
content="确认"
placement="top">
<el-button <el-button
type="text" type="text"
style="margin: 5px 0; padding: 0" style="margin: 5px 0; padding: 0"
@ -87,7 +115,9 @@
</el-tooltip> </el-tooltip>
<!-- line --> <!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> <span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<el-tooltip content="查看详情" placement="top"> <el-tooltip
content="查看详情"
placement="top">
<el-button <el-button
type="text" type="text"
style="margin: 5px 0; padding: 0" style="margin: 5px 0; padding: 0"
@ -97,7 +127,9 @@
</el-tooltip> </el-tooltip>
<!-- line --> <!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> <span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<el-tooltip content="编辑" placement="top"> <el-tooltip
content="编辑"
placement="top">
<el-button <el-button
type="text" type="text"
style="margin: 5px 0; padding: 0" style="margin: 5px 0; padding: 0"
@ -107,7 +139,9 @@
</el-tooltip> </el-tooltip>
<!-- line --> <!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span> <span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<el-tooltip content="删除" placement="top"> <el-tooltip
content="删除"
placement="top">
<el-button <el-button
type="text" type="text"
style="margin: 5px 0; padding: 0" style="margin: 5px 0; padding: 0"
@ -122,10 +156,12 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'CheckOrderListTable', name: 'CheckOrderListTable',
components: {}, components: {},
mixins: [tableHeightMixin],
props: ['tableData', 'page', 'limit', 'permissionGuard'], props: ['tableData', 'page', 'limit', 'permissionGuard'],
filters: { filters: {
timeFilter: (val) => timeFilter: (val) =>

View File

@ -20,6 +20,7 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
:max-height="tableH"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -62,11 +63,12 @@ import addOrUpdata from './add-or-updata.vue';
import add from './add.vue'; import add from './add.vue';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue'; import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'SpecialEquipmentCheckConfig', name: 'SpecialEquipmentCheckConfig',
components: { addOrUpdata, add, BaseDialog: BaseDialogWrapperVue }, components: { addOrUpdata, add, BaseDialog: BaseDialogWrapperVue },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
@ -103,28 +105,30 @@ export default {
{ {
prop: 'name', prop: 'name',
label: '巡检单名称', label: '巡检单名称',
width: 100, minWidth: 100,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'code', prop: 'code',
width: 180,
label: '巡检单编码', label: '巡检单编码',
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'department', prop: 'department',
label: '部门', label: '部门',
width: 100,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'planCheckTime', prop: 'planCheckTime',
label: '计划巡检时间', label: '计划巡检时间',
width: 160,
showOverflowtooltip: true, showOverflowtooltip: true,
filter: parseTime, filter: parseTime,
}, },
{ {
prop: 'checkPeriod', prop: 'checkPeriod',
width: 130,
label: '巡检频率(天/次)', label: '巡检频率(天/次)',
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
@ -142,6 +146,7 @@ export default {
{ prop: 'creator', label: '创建人', showOverflowtooltip: true }, { prop: 'creator', label: '创建人', showOverflowtooltip: true },
{ {
prop: 'createTime', prop: 'createTime',
width: 160,
label: '创建时间', label: '创建时间',
showOverflowtooltip: true, showOverflowtooltip: true,
filter: parseTime, filter: parseTime,
@ -187,7 +192,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
name: null, name: null,
status: 0, status: 0,
special: true, special: true,

View File

@ -131,6 +131,7 @@ export default {
{ {
prop: 'confirmDueTime', prop: 'confirmDueTime',
label: '确认截止时间', label: '确认截止时间',
width: 150,
showOverflowtooltip: true, showOverflowtooltip: true,
filter: parseTime, filter: parseTime,
// filter: (val) => // filter: (val) =>
@ -185,7 +186,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
name: null, name: null,
status: 1, status: 1,
special: true, special: true,

View File

@ -18,6 +18,7 @@
:table-props="tableProps" :table-props="tableProps"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:max-height="tableH"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
@ -50,11 +51,12 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import RecordDetail from './Record-detail.vue'; import RecordDetail from './Record-detail.vue';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'SpecialEquipmentCheckRecord', name: 'SpecialEquipmentCheckRecord',
components: { RecordDetail }, components: { RecordDetail },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
const today = new Date(); const today = new Date();
const twoDaysAgo = new Date(today.getTime() - 2 * 24 * 60 * 60 * 1000); const twoDaysAgo = new Date(today.getTime() - 2 * 24 * 60 * 60 * 1000);
@ -89,10 +91,16 @@ export default {
// : undefined, // : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '巡检单名称' }, { prop: 'name', label: '巡检单名称', showOverflowtooltip: true },
{ prop: 'department', label: '部门' }, { prop: 'department', label: '部门', showOverflowtooltip: true },
{ prop: 'planCheckTime', label: '巡检时间', filter: parseTime }, {
{ prop: 'groupClass', label: '班次' }, prop: 'planCheckTime',
label: '巡检时间',
width: 160,
filter: parseTime,
showOverflowtooltip: true,
},
{ prop: 'groupClass', label: '班次', showOverflowtooltip: true },
// { // {
// prop: '_detail', // prop: '_detail',
// label: '', // label: '',
@ -196,7 +204,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
special: true, special: true,
status: 2, status: 2,
actualCheckTime: t, actualCheckTime: t,

View File

@ -19,16 +19,9 @@
:table-props="tableProps" :table-props="tableProps"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:max-height="tableH"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun"></base-table>
<!-- <method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> -->
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination
@ -61,74 +54,18 @@
</template> </template>
<script> <script>
// import { publicFormatter } from '@/utils/dict';
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'; import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import MonitorDetail from './Monitor--detail.vue'; import MonitorDetail from './Monitor--detail.vue';
import { RemainBox, TableBtn } from '@/components/tableInnerComponents';
const remainBox = {
name: 'RemainBox',
props: ['injectData'],
data() {
return {};
},
computed: {
value() {
return this.injectData[this.injectData.prop] || null;
},
color() {
if (this.value) {
const v = +this.value;
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F';
}
return 'unset';
},
},
render: function (h) {
return (
<div
style={`background: ${
this.color
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
// this.color == 'red' ? '#fff' : 'unset'
'#fff'
}`}>
{this.injectData[this.injectData.prop]?.toFixed(0) || ''}
</div>
);
},
};
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.entryText}
</el-button>
);
},
};
export default { export default {
name: 'SpecialEquipmentMaintainMonitor', name: 'SpecialEquipmentMaintainMonitor',
components: { MonitorDetail }, components: { MonitorDetail },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
monitorDetailVisible: false, monitorDetailVisible: false,
@ -189,13 +126,13 @@ export default {
prop: 'opt2', prop: 'opt2',
label: '保养内容', label: '保养内容',
entryText: '详情', entryText: '详情',
subcomponent: btn, subcomponent: TableBtn,
width: 100, width: 100,
}, },
{ {
prop: 'remainDays', prop: 'remainDays',
label: '距离下次保养剩余时间(天)', label: '距离下次保养剩余时间(天)',
subcomponent: remainBox, subcomponent: RemainBox,
minWidth: 210, minWidth: 210,
}, },
// { // {
@ -307,7 +244,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
planId: null, planId: null,
special: true, special: true,
}, },

View File

@ -19,6 +19,7 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
:max-height="tableH"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -62,6 +63,7 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'; import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record';
import PlanConfigAdd from './PlanConfig--add.vue'; import PlanConfigAdd from './PlanConfig--add.vue';
import PlanConfigAddContent from './PlanConfig--addContent.vue'; import PlanConfigAddContent from './PlanConfig--addContent.vue';
@ -74,7 +76,7 @@ export default {
DialogForm: PlanConfigAdd, DialogForm: PlanConfigAdd,
PlanConfigAddContent, PlanConfigAddContent,
}, },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
const t = new Date(); const t = new Date();
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()]; const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
@ -103,93 +105,57 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '保养计划名称' }, { prop: 'name', label: '保养计划名称', showOverflowtooltip: true },
{ prop: 'departmentName', label: '部门' }, { prop: 'departmentName', label: '部门', showOverflowtooltip: true },
{ width: 144, prop: 'lineName', label: '产线名' },
{ width: 132, prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ {
width: 180, prop: 'lineName',
label: '产线名',
showOverflowtooltip: true,
},
{
minWidth: 120,
prop: 'maintenancePeriod',
label: '保养频率(天/次)',
showOverflowtooltip: true,
},
{
minWidth: 160,
prop: 'firstMaintenanceTime', prop: 'firstMaintenanceTime',
label: '首次保养时间', label: '首次保养时间',
showOverflowtooltip: true,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ width: 144, prop: 'maintainDuration', label: '保养时长' },
{ prop: 'maintainer', label: '计划保养人员' },
{ {
width: 144, minWidth: 100,
prop: 'maintainDuration',
label: '保养时长',
showOverflowtooltip: true,
},
{
minWidth: 144,
prop: 'maintainer',
label: '计划保养人员',
showOverflowtooltip: true,
},
{
minWidth: 144,
prop: 'confirmTimeLimit', prop: 'confirmTimeLimit',
label: '确认时限', label: '确认时限',
showOverflowtooltip: true,
filter: (val) => filter: (val) =>
val != null && val > 24 val != null && val > 24
? `${(val - (val % 24)) / 24}${val % 24}小时` ? `${(val - (val % 24)) / 24}${val % 24}小时`
: `${val}小时`, : `${val}小时`,
}, },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注', showOverflowtooltip: true },
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
// { prop: 'code', label: '' },
// {
// prop: 'enabled',
// label: '',
// filter: (val) => ['', ''][val],
// },
// {
// prop: 'equipmentCategory',
// label: '',
// filter: (val) =>
// val != null ? ['-', '', '', ''][val] : '-',
// },
// { prop: 'equipmentName', label: '' },
// { width: 144, prop: 'maintainDuration', label: '(h)' },
// {
// prop: 'maintainType',
// label: '',
// filter: publicFormatter('maintain_type'),
// },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// selectOptions: [
// { id: 1, name: '' },
// { id: 2, name: '' },
// { id: 3, name: '' },
// ],
// placeholder: '',
// param: 'specialType',
// },
{ {
type: 'input', type: 'input',
label: '保养计划名称', label: '保养计划名称',
placeholder: '请输入保养计划名称', placeholder: '请输入保养计划名称',
param: 'planName', param: 'planName',
// selectOptions: [
// {name: 1, id: 1}
// ]
}, },
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'equipmentName',
// },
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange',
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// param: 'createTime',
// },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -208,14 +174,6 @@ export default {
plain: true, plain: true,
color: 'success', color: 'success',
}, },
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
], ],
rows: [ rows: [
[ [
@ -316,7 +274,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
// equipmentName: null, // equipmentName: null,
// createTime: null, // createTime: null,
specialType: null, specialType: null,

View File

@ -19,6 +19,7 @@
:table-props="tableProps" :table-props="tableProps"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:max-height="tableH"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<!-- <method-btn <!-- <method-btn
@ -51,9 +52,16 @@
ref="form" ref="form"
v-model="form" v-model="form"
:disabled="mode == 'detail'" /> :disabled="mode == 'detail'" />
<el-row v-if="mode === 'detail'" slot="footer" type="flex" justify="end"> <el-row
v-if="mode === 'detail'"
slot="footer"
type="flex"
justify="end">
<el-col :span="12"> <el-col :span="12">
<el-button size="small" class="btnTextStyle" @click="cancel"> <el-button
size="small"
class="btnTextStyle"
@click="cancel">
关闭 关闭
</el-button> </el-button>
</el-col> </el-col>
@ -70,6 +78,7 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import DialogForm from './Record--add.vue'; import DialogForm from './Record--add.vue';
import { import {
@ -77,36 +86,14 @@ import {
exportMaintainLogExcel, exportMaintainLogExcel,
} from '@/api/equipment/base/maintain/record'; } from '@/api/equipment/base/maintain/record';
import RecordDetail from './Record--detail.vue'; import RecordDetail from './Record--detail.vue';
import { TableBtn } from '@/components/tableInnerComponents';
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 { export default {
name: 'SpecialEquipmentMaintainRecord', name: 'SpecialEquipmentMaintainRecord',
components: { DialogForm, RecordDetail }, components: { DialogForm, RecordDetail },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
const today = new Date(); const today = new Date();
const twoDaysAgo = new Date(today.getTime() - 2 * 24 * 60 * 60 * 1000); const twoDaysAgo = new Date(today.getTime() - 2 * 24 * 60 * 60 * 1000);
@ -157,54 +144,54 @@ export default {
{ {
prop: 'maintainOrderNumber', prop: 'maintainOrderNumber',
label: '设备保养单号', label: '设备保养单号',
width: 110, minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'planName', prop: 'planName',
label: '保养计划名称', label: '保养计划名称',
width: 110, minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true,
filter: (val) => (val != null ? val : '---'), filter: (val) => (val != null ? val : '---'),
}, },
{ {
prop: 'departmentName', prop: 'departmentName',
label: '部门', label: '部门',
width: 110, minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线名', label: '产线名',
width: 110, minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'planStartTime', prop: 'planStartTime',
label: '计划开始时间', label: '计划开始时间',
filter: timeFilter, filter: timeFilter,
minWidth: 150, minWidth: 130,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'planEndTime', prop: 'planEndTime',
label: '计划结束时间', label: '计划结束时间',
filter: timeFilter, filter: timeFilter,
minWidth: 150, minWidth: 130,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'startTime', prop: 'startTime',
label: '实际开始时间', label: '实际开始时间',
filter: timeFilter, filter: timeFilter,
minWidth: 150, minWidth: 130,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '实际结束时间', label: '实际结束时间',
filter: timeFilter, filter: timeFilter,
minWidth: 150, minWidth: 130,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
@ -218,78 +205,12 @@ export default {
{ {
prop: '_detail', prop: '_detail',
label: '详情', label: '详情',
name: '详情', entryText: '详情',
minWidth: 60, minWidth: 60,
subcomponent: btn, subcomponent: TableBtn,
}, },
// {
// prop: 'equipmentCategory',
// label: '',
// minWidth: 100,
// showOverflowtooltip: true,
// filter: (val) =>
// val != null ? ['-', '', '', ''][val] : '-',
// },
// {
// prop: 'equipmentName',
// label: '',
// minWidth: 100,
// showOverflowtooltip: true,
// },
// {
// prop: 'maintainWorker',
// label: '',
// minWidth: 100,
// showOverflowtooltip: true,
// },
// {
// prop: 'relatePlan',
// label: '',
// width: 120,
// filter: (v) => (v != null ? ['', '', ''][v] : ''),
// },
// {
// prop: 'planName',
// label: '',
// minWidth: 120,
// showOverflowtooltip: true,
// },
// {
// prop: 'maintainDuration',
// label: '(h)',
// minWidth: 130,
// showOverflowtooltip: true,
// },
// { prop: 'timeUsed', label: '(h)', minWidth: 130 },
// {
// prop: 'remark',
// label: '',
// minWidth: 100,
// showOverflowtooltip: true,
// },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'specialType',
// onchange: true,
// selectOptions: [
// { id: 1, name: '' },
// { id: 2, name: '' },
// { id: 3, name: '' },
// ],
// filterable: true,
// defaultSelect: null
// },
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'equipmentId',
// defaultSelect: null
// },
{ {
type: 'select', type: 'select',
label: '保养计划名称', label: '保养计划名称',
@ -297,7 +218,7 @@ export default {
param: 'maintainPlanId', param: 'maintainPlanId',
defaultSelect: null, defaultSelect: null,
filterable: true, filterable: true,
clearable: true clearable: true,
}, },
// //
{ {
@ -314,16 +235,6 @@ export default {
defaultSelect: t, defaultSelect: t,
// width: 350, // width: 350,
}, },
// {
// type: 'select',
// label: '',
// selectOptions: [
// { name: '', id: 1 },
// { name: '', id: 2 },
// ],
// defaultSelect: null,
// param: 'relatePlan',
// },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -508,7 +419,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
maintainPlanId: null, maintainPlanId: null,
startTime: t, startTime: t,
// relatePlan: null, // relatePlan: null,

View File

@ -20,6 +20,7 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
:max-height="tableH"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -63,6 +64,7 @@
<script> <script>
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import DetailDrawer from './CustomDialogForm.vue'; import DetailDrawer from './CustomDialogForm.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { import {
deleteRepair, deleteRepair,
exportRepairLogExcel, exportRepairLogExcel,
@ -75,7 +77,7 @@ import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
export default { export default {
name: 'SpecialEquipmentRepair', name: 'SpecialEquipmentRepair',
components: { DetailDrawer, DialogForm, BaseDialog: BaseDialogWrapperVue }, components: { DetailDrawer, DialogForm, BaseDialog: BaseDialogWrapperVue },
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
@ -167,6 +169,7 @@ export default {
{ {
prop: 'maintenanceResult', prop: 'maintenanceResult',
label: '维修结果', label: '维修结果',
minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true,
filter: (v) => (v != null ? ['成功', '失败'][v] : ''), filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
}, },
@ -174,7 +177,7 @@ export default {
prop: 'maintenanceDetail', prop: 'maintenanceDetail',
label: '维修描述', label: '维修描述',
showOverflowtooltip: true, showOverflowtooltip: true,
width: 110, minWidth: 110,
subcomponent: htmls, subcomponent: htmls,
}, },
{ {
@ -289,7 +292,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
// maintenanceStatus: null, // maintenanceStatus: null,
maintenanceResult: null, maintenanceResult: null,
createTime: null, createTime: null,

View File

@ -456,7 +456,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
maintainPlanId: null, maintainPlanId: null,
startTime: null, startTime: null,
special: true, special: true,

View File

@ -10,6 +10,7 @@
:data="tableDataWithIndex" :data="tableDataWithIndex"
:border="true" :border="true"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
:max-height="tableH"
style="width: 100%" style="width: 100%"
:header-cell-style="{ :header-cell-style="{
background: '#f2f4f9', background: '#f2f4f9',
@ -46,13 +47,15 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[0]" v-if="selectedBox[0]"
width="128" min-width="144"
label="设备保养单号" label="设备保养单号"
:show-overflow-tooltip="true"
prop="maintainOrderNumber"></el-table-column> prop="maintainOrderNumber"></el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[1]" v-if="selectedBox[1]"
width="128" min-width="144"
label="保养计划名称" label="保养计划名称"
:show-overflow-tooltip="true"
prop="planName"> prop="planName">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.planName || '---' }} {{ scope.row.planName || '---' }}
@ -61,6 +64,7 @@
<el-table-column <el-table-column
v-if="selectedBox[2]" v-if="selectedBox[2]"
label="部门" label="部门"
:show-overflow-tooltip="true"
prop="departmentName"> prop="departmentName">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.departmentName || '---' }} {{ scope.row.departmentName || '---' }}
@ -69,6 +73,7 @@
<el-table-column <el-table-column
v-if="selectedBox[3]" v-if="selectedBox[3]"
label="产线名" label="产线名"
:show-overflow-tooltip="true"
prop="lineName"> prop="lineName">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.lineName || '---' }} {{ scope.row.lineName || '---' }}
@ -76,8 +81,9 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[4]" v-if="selectedBox[4]"
width="150" min-width="144"
label="计划开始时间" label="计划开始时间"
:show-overflow-tooltip="true"
prop="planStartTime"> prop="planStartTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.planStartTime | timeFilter }} {{ scope.row.planStartTime | timeFilter }}
@ -85,8 +91,9 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[5]" v-if="selectedBox[5]"
width="150" min-width="144"
label="计划结束时间" label="计划结束时间"
:show-overflow-tooltip="true"
prop="planEndTime"> prop="planEndTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.planEndTime | timeFilter }} {{ scope.row.planEndTime | timeFilter }}
@ -94,8 +101,9 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[6]" v-if="selectedBox[6]"
width="150" min-width="144"
label="实际开始时间" label="实际开始时间"
:show-overflow-tooltip="true"
prop="startTime"> prop="startTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.startTime | timeFilter }} {{ scope.row.startTime | timeFilter }}
@ -103,8 +111,9 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[7]" v-if="selectedBox[7]"
width="150" min-width="144"
label="实际结束时间" label="实际结束时间"
:show-overflow-tooltip="true"
prop="endTime"> prop="endTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.endTime | timeFilter }} {{ scope.row.endTime | timeFilter }}
@ -112,8 +121,9 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[8]" v-if="selectedBox[8]"
width="150" min-width="144"
label="确认截止时间" label="确认截止时间"
:show-overflow-tooltip="true"
prop="confirmDueTime"> prop="confirmDueTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.confirmDueTime | timeFilter }} {{ scope.row.confirmDueTime | timeFilter }}
@ -121,8 +131,9 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="selectedBox[9]" v-if="selectedBox[9]"
width="150" min-width="144"
label="保养计划类型" label="保养计划类型"
:show-overflow-tooltip="true"
prop="relatePlan"> prop="relatePlan">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.relatePlan | relatePlanFilter }} {{ scope.row.relatePlan | relatePlanFilter }}
@ -186,10 +197,12 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'WaitingListTable', name: 'WaitingListTable',
components: {}, components: {},
mixins: [tableHeightMixin],
props: ['tableData', 'page', 'limit'], props: ['tableData', 'page', 'limit'],
filters: { filters: {
timeFilter: (val) => timeFilter: (val) =>

View File

@ -6,30 +6,30 @@
* @Description: * @Description:
--> -->
<template> <template>
<div v-html="content" /> <div v-html="content" />
</template> </template>
<script> <script>
export default { export default {
props: { props: {
injectData: { injectData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
} },
}, },
data() { data() {
return { return {
content: '' content: '',
} };
}, },
mounted() { mounted() {
this.getContent() this.getContent();
}, },
methods: { methods: {
getContent() { getContent() {
this.content = this.injectData[this.injectData.prop] ?? '' this.content = this.injectData[this.injectData.prop] ?? '';
} },
} },
} };
</script> </script>