|
|
@@ -38,16 +38,23 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="openEdit('edit', row)"
|
|
|
v-if="$hasPermission('eam:planconfig:update')"
|
|
|
-
|
|
|
>
|
|
|
修改
|
|
|
</el-link>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="copy(row)"
|
|
|
+ v-if="$hasPermission('eam:planconfig:update')"
|
|
|
+ >
|
|
|
+ 复制
|
|
|
+ </el-link>
|
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
|
title="确定要删除此保养配置吗?"
|
|
|
@confirm="remove(row)"
|
|
|
v-if="$hasPermission('eam:planconfig:delete')"
|
|
|
-
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
@@ -77,196 +84,207 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
|
|
|
-// import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
|
|
|
-import ProgramRulesDialog from '../components/programRulesDialog';
|
|
|
-import MaintainSearch from './components/maintain-search.vue';
|
|
|
-import { planConfigPage, removeRule } from '@/api/ruleManagement/plan';
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
-export default {
|
|
|
- mixins: [dictMixins, tabMixins],
|
|
|
- components: {
|
|
|
- MaintainSearch,
|
|
|
- // AddPatrolConfigDialog,
|
|
|
- ProgramRulesDialog
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- addProgramRulesDialog: false,
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '计划配置单号',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- slot: 'code'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '计划配置名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'groupName',
|
|
|
- label: '执行部门',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'categoryName',
|
|
|
- label: '设备分类',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'ruleName',
|
|
|
- label: '规则名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'autoOrder',
|
|
|
- label: '自动派单',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- let autoOrder =
|
|
|
- _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
|
|
|
- return autoOrder;
|
|
|
- }
|
|
|
- },
|
|
|
- {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.getDictValue('规则状态', _row.status);
|
|
|
+ // import AddPatrolConfigDialog from '@/components/addPatrolConfigDialog';
|
|
|
+ import ProgramRulesDialog from '../components/programRulesDialog';
|
|
|
+ import MaintainSearch from './components/maintain-search.vue';
|
|
|
+ import {
|
|
|
+ planConfigPage,
|
|
|
+ removeRule,
|
|
|
+ planconfigCopy
|
|
|
+ } from '@/api/ruleManagement/plan';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ export default {
|
|
|
+ mixins: [dictMixins, tabMixins],
|
|
|
+ components: {
|
|
|
+ MaintainSearch,
|
|
|
+ // AddPatrolConfigDialog,
|
|
|
+ ProgramRulesDialog
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ addProgramRulesDialog: false,
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '计划配置单号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'code'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '计划配置名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'groupName',
|
|
|
+ label: '执行部门',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryName',
|
|
|
+ label: '设备分类',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'ruleName',
|
|
|
+ label: '规则名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
},
|
|
|
- filters: [
|
|
|
- { value: 1, text: '生效'},
|
|
|
- { value: 0, text: '失效'}
|
|
|
- ],
|
|
|
- filterMultiple: false,
|
|
|
- columnKey: 'status'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createUserName',
|
|
|
- label: '创建人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.$util.toDateString(cellValue);
|
|
|
+ {
|
|
|
+ prop: 'autoOrder',
|
|
|
+ label: '自动派单',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ let autoOrder =
|
|
|
+ _row.autoOrder == 1 ? '是' : _row.autoOrder == 0 ? '否' : '-';
|
|
|
+ return autoOrder;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.getDictValue('规则状态', _row.status);
|
|
|
+ },
|
|
|
+ filters: [
|
|
|
+ { value: 1, text: '生效' },
|
|
|
+ { value: 0, text: '失效' }
|
|
|
+ ],
|
|
|
+ filterMultiple: false,
|
|
|
+ columnKey: 'status'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createUserName',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 200,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true
|
|
|
- }
|
|
|
- ],
|
|
|
- // 加载状态
|
|
|
- loading: false,
|
|
|
- pageType: 'add',
|
|
|
- dialogTitle: '',
|
|
|
- isBindPlan: false,
|
|
|
- pageSize: this.$store.state.tablePageSize,
|
|
|
- cacheKeyUrl: 'c5e8e922-rulesManagement-planRules-anmac'
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {},
|
|
|
- created() {
|
|
|
- this.requestDict('规则状态');
|
|
|
- },
|
|
|
- methods: {
|
|
|
- selectType(value) {
|
|
|
- let where = {}
|
|
|
- if (value.status.length > 0) {
|
|
|
- where['status'] = value.status[0]
|
|
|
- }
|
|
|
- this.reload(where)
|
|
|
+ ],
|
|
|
+ // 加载状态
|
|
|
+ loading: false,
|
|
|
+ pageType: 'add',
|
|
|
+ dialogTitle: '',
|
|
|
+ isBindPlan: false,
|
|
|
+ pageSize: this.$store.state.tablePageSize,
|
|
|
+ cacheKeyUrl: 'c5e8e922-rulesManagement-planRules-anmac'
|
|
|
+ };
|
|
|
},
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return planConfigPage({
|
|
|
- pageNum: page,
|
|
|
- size: limit,
|
|
|
- ...where,
|
|
|
- groupId: where.groupId == null ? '' : where.groupId,
|
|
|
- categoryLevelId:
|
|
|
- where.categoryLevelId == null ? '' : where.categoryLevelId,
|
|
|
- ruleType: 2
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.addProgramRulesDialog = false;
|
|
|
- this.$refs.table.reload({ page: 1, where, ruleType: 2 });
|
|
|
+ computed: {},
|
|
|
+ created() {
|
|
|
+ this.requestDict('规则状态');
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ copy(row) {
|
|
|
+ planconfigCopy(row.id).then((res) => {
|
|
|
+ this.$message.success('复制成功');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectType(value) {
|
|
|
+ let where = {};
|
|
|
+ if (value.status.length > 0) {
|
|
|
+ where['status'] = value.status[0];
|
|
|
+ }
|
|
|
+ this.reload(where);
|
|
|
+ },
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where, order }) {
|
|
|
+ return planConfigPage({
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ ...where,
|
|
|
+ groupId: where.groupId == null ? '' : where.groupId,
|
|
|
+ categoryLevelId:
|
|
|
+ where.categoryLevelId == null ? '' : where.categoryLevelId,
|
|
|
+ ruleType: 2
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- openEdit(type,row) {
|
|
|
- this.isBindPlan = false;
|
|
|
- this.addProgramRulesDialog = true;
|
|
|
- if (row) {
|
|
|
- this.dialogTitle = '编辑保养计划配置';
|
|
|
- } else {
|
|
|
- this.dialogTitle = '新增保养计划配置';
|
|
|
- }
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.programRulesDialog.init(type, row, '保养');
|
|
|
- });
|
|
|
- },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.addProgramRulesDialog = false;
|
|
|
+ this.$refs.table.reload({ page: 1, where, ruleType: 2 });
|
|
|
+ },
|
|
|
|
|
|
- goDetail({ id }) {
|
|
|
- this.$router.push({
|
|
|
- path: '/rulesManagement/maintenance/detail',
|
|
|
- query: {
|
|
|
- id,
|
|
|
- date: new Date().valueOf()
|
|
|
+ openEdit(type, row) {
|
|
|
+ this.isBindPlan = false;
|
|
|
+ this.addProgramRulesDialog = true;
|
|
|
+ if (row) {
|
|
|
+ this.dialogTitle = '编辑保养计划配置';
|
|
|
+ } else {
|
|
|
+ this.dialogTitle = '新增保养计划配置';
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.programRulesDialog.init(type, row, '保养');
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- remove(row) {
|
|
|
- removeRule([row.id]).then((res) => {
|
|
|
- this.$message.success('删除成功!');
|
|
|
- this.reload();
|
|
|
- });
|
|
|
+ goDetail({ id }) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/rulesManagement/maintenance/detail',
|
|
|
+ query: {
|
|
|
+ id,
|
|
|
+ date: new Date().valueOf()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ remove(row) {
|
|
|
+ removeRule([row.id]).then((res) => {
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|