| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <notes-search @search="reload"> </notes-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- cache-key="systemRoleTable"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-plus"
- class="ele-btn-icon"
- @click="openEdit()"
- >
- 新建
- </el-button>
- <el-button
- size="small"
- type="primary"
- class="ele-btn-icon"
- @click="goDetail({ id: 12 })"
- >
- 详情
- </el-button>
- </template>
- <!-- <template v-slot:enable="{ row }">
- <el-switch
- v-model="row.enable"
- active-color="#13ce66"
- inactive-color="#ff4949"
- :active-value="1"
- :inactive-value="0"
- @change="changeEnable(row)"
- >
- </el-switch>
- </template> -->
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="openEdit(row)"
- >
- 撤回
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- <!-- 新建或编辑弹窗 -->
- <AddDialog
- ref="addDialogRef"
- :dialogTitle="addDialogTitle"
- :deviceInfo="deviceInfo"
- :infoData="infoData"
- @refresh="reload"
- />
- <DetailsDialog
- ref="detailsDialogRef"
- :dialogTitle="detailsDialogTitle"
- :infoData="infoData"
- :repairInfoLogs="repairInfoLogs"
- />
- </div>
- </template>
- <script>
- import { getPage } from '@/api/maintenance/repair';
- // import AddPatrolPlanDialog from '@/components/addPatrolPlanDialog'
- import NotesSearch from './components/notes-search.vue';
- import AddDialog from './components/addDialog.vue';
- import DetailsDialog from '../components/RepairDetailsDialog.vue';
- export default {
- components: {
- NotesSearch,
- AddDialog,
- DetailsDialog
- // AddPatrolPlanDialog
- },
- data () {
- return {
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '报修记录编码',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'deviceId',
- label: '设备编码',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'enable',
- label: '设备名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'sourceType',
- label: '报修类型',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'from',
- label: '来源',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'sourceCode',
- label: '来源编码',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'requestUserId',
- 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: 230,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true
- }
- ],
- // 加载状态
- loading: false,
- infoData: {},
- repairInfoLogs: [],
- addDialogTitle: '新增报修记录',
- detailsDialogTitle: '报修记录详情',
- deviceInfo: {} //设备信息
- };
- },
- computed: {},
- methods: {
- /* 表格数据源 */
- datasource ({ page, limit, where, order }) {
- return getPage({ pageNum: page, size: limit, ...where });
- },
- async changeEnable (row) {
- const res = await putRoles(row);
- if (res.code == 0) {
- this.$message({
- type: 'success',
- message: '修改成功',
- customClass: 'ele-message-border'
- });
- this.reload();
- }
- },
- /* 刷新表格 */
- reload (where) {
- this.$refs.table.reload({ page: 1, where });
- },
- openEdit (row) {
- this.addDialogTitle = '新增报修记录';
- this.$refs.addDialogRef.addRepairNotesDialog = true;
- },
- goDetail (row) {
- row.tabLabel = '维修信息';
- row.title = '报修记录详情';
- row.workOrderCode = row.id;
- this.$refs.detailsDialogRef.init(row);
- // this.$router.push({
- // path: '/maintenance/patrol/plan/details',
- // // query: {
- // // id
- // // }
- // })
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|