zhaowei
2025-05-26 a20bf71a183e02d3f01826152df9061855bc39e8
设备管理新增生产设备自主维护点检表页面
已添加1个文件
266 ■■■■■ 文件已修改
src/views/eam/SelfMaintenanceAndInspectionList.vue 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/SelfMaintenanceAndInspectionList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,266 @@
<template>
  <a-card :border="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="4" :sm="4">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.num" :allow-clear="false"/>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
            <a-form-item label="月份">
              <a-month-picker style="width: 100%" value-format="YYYY-MM" placeholder="请选择月份"
                              v-model="queryParam.dataTime" :allow-clear="false"/>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="6">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button @click="searchReset" icon="reload">重置</a-button>
              <a-button type="primary" icon="download" @click="exportExcel">导出</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <a-spin :spinning="loading">
      <table id="dataTable" v-if="dataSource.list1&&dataSource.list1.length>0">
        <thead>
        <tr style="height: 48px">
          <th colspan="42">生产设备自主维护点检表</th>
        </tr>
        <tr style="height: 48px">
          <th colspan="6">设备名称:{{dataSource.equipentName}}</th>
          <th colspan="3"></th>
          <th colspan="6">设备型号:{{dataSource.equipmentModel}}</th>
          <th colspan="3"></th>
          <th colspan="6">统一编号:{{dataSource.equipentNum}}</th>
          <th colspan="3"></th>
          <th colspan="6">{{queryParam.dataTime.split('-')[0]}}&nbsp;å¹´&nbsp;{{queryParam.dataTime.split('-')[1]}}&nbsp;月</th>
          <th colspan="6">单位:{{dataSource.workCenterName}}</th>
          <th colspan="3"></th>
        </tr>
        </thead>
        <tbody>
        <tr>
          <td rowspan="2">序号</td>
          <td rowspan="2" colspan="5">点检项目</td>
          <td rowspan="2" colspan="5">完成数据/要求</td>
          <td colspan="31">日期</td>
        </tr>
        <tr>
          <td v-for="item in 31">{{item}}</td>
        </tr>
        <tr v-for="(item,index) in dataSource.list1">
          <td>{{index+1}}</td>
          <td colspan="5">{{item.name}}</td>
          <td colspan="5">{{item.detectionStandard}}</td>
          <td v-for="childItem in 31">
            {{item.dataList&&item.dataList.find(item=>+item.dayTime===childItem)?item.dataList.find(item=>+item.dayTime===childItem).insResult:''}}
          </td>
        </tr>
        <tr>
          <td colspan="11">维护责任人签字</td>
          <td v-for="childItem in 31">
            {{dataSource.list2&&dataSource.list2[0].dataList&&dataSource.list2[0].dataList.find(item=>+item.dayTime===childItem)?dataSource.list2[0].dataList.find(item=>+item.dayTime===childItem).inspectionUserName:''}}
          </td>
        </tr>
        <tr>
          <td colspan="11">检查责任人签字</td>
          <td v-for="childItem in 31">
            {{dataSource.list3&&dataSource.list3[0].dataList&&dataSource.list3[0].dataList.find(item=>+item.dayTime===childItem)?dataSource.list3[0].dataList.find(item=>+item.dayTime===childItem).repairConfirmPerson:''}}
          </td>
        </tr>
        <tr style="height: 48px">
          <td>序号</td>
          <td colspan="5">周保养项目</td>
          <td colspan="5">检查标准</td>
          <td colspan="31">周报执行记录</td>
        </tr>
        <tr v-for="(item,index) in dataSource.list4">
          <td>{{index+1}}</td>
          <td colspan="5">{{item.name}}</td>
          <td colspan="5">{{item.detectionStandard}}</td>
          <td v-for="childItem in 4" colspan="6">
            {{item.dataList&&item.dataList[childItem-1]?item.dataList[childItem-1].insResult:''}}
          </td>
          <td colspan="7">
            {{item.dataList&&item.dataList[4]?item.dataList[4].insResult:''}}
          </td>
        </tr>
        <tr>
          <td colspan="11">周保养操作者执行(操作者签字)</td>
          <td v-for="childItem in 4" colspan="6">
            {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList[childItem-1]?dataSource.list5[0].dataList[childItem-1].inspectionUserName:''}}
          </td>
          <td colspan="7">
            {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList[4]?dataSource.list5[0].dataList[4].inspectionUserName:''}}
          </td>
        </tr>
        <tr>
          <td colspan="11">间保养检查人确认(维修人员签字)</td>
          <td v-for="childItem in 4" colspan="6">
            {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList[childItem-1]?dataSource.list6[0].dataList[childItem-1].repairConfirmPerson:''}}
          </td>
          <td colspan="7">
            {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList[4]?dataSource.list6[0].dataList[4].repairConfirmPerson:''}}
          </td>
        </tr>
        <tr>
          <td colspan="42" style="text-align: left">
            å¡«å†™è¦æ±‚:正常=/,异常=x,故障停机=△,没开机=T:设备日常点检记录由操作人员执行并记录。执行情况检查由维修人员负责执行并记录,对发现问题记录至点检表背面各注栏,对发现问题进行全程闭环记录。
          </td>
        </tr>
        <!--<tr>-->
        <!--<td colspan="42" style="text-align: left">备注:</td>-->
        <!--</tr>-->
        <!--<tr>-->
        <!--<th colspan="7">发生时间:</th>-->
        <!--<th colspan="7">问题描述:</th>-->
        <!--<th colspan="7">整改 / æ”¹å–„情况:</th>-->
        <!--<th colspan="7">整改完成时间</th>-->
        <!--<th colspan="7">整改责任人:</th>-->
        <!--<th colspan="7">维修检查人:</th>-->
        <!--</tr>-->
        </tbody>
      </table>
    </a-spin>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction } from '@/api/manage'
  import $ from 'jquery'
  import '@/components/table2excel/table2excel'
  export default {
    name: 'SelfMaintenanceAndInspectionList',
    mixins: [JeecgListMixin],
    data() {
      return {
        disableMixinCreated: true,
        dataSource: {},
        tableElement: null,
        url: {
          list: '/eam/inspectionOrder/findInspectionForms'
        }
      }
    },
    methods: {
      searchQuery() {
        const { num, dataTime } = this.queryParam
        if (!num || !dataTime) {
          this.$message.warning('请选择设备编号及月份!')
          return
        }
        this.loadData()
      },
      loadData() {
        this.dataSource = {}
        this.loading = true
        const { dataTime, num } = this.queryParam
        const that = this
        getAction(this.url.list, this.queryParam)
          .then(res => {
            if (res.success) {
              if (res.result.list1.length === 0) {
                that.$message.warning(`${dataTime.split('-')[0]}å¹´${dataTime.split('-')[1]}月  è®¾å¤‡ç¼–号为${num}设备 æ— ç‚¹æ£€è®°å½•`)
                return
              }
              that.dataSource = res.result
              for (let index = 4; index <= 6; index++) {
                that.dataSource[`list${index}`] = that.dataSource[`list${index}`].map(item => {
                  return {
                    ...item,
                    dataList: item.dataList.sort((x, y) => x.dayTime - y.dayTime)
                  }
                })
              }
              this.$nextTick(() => this.tableElement = document.getElementById('dataTable'))
            }
            else that.$message.warning(res.message)
          })
          .finally(() => {
            that.loading = false
          })
      },
      exportExcel() {
        if (!this.tableElement) this.$message.warning('请查询后再进行导出')
        $('#dataTable').table2excel({
          exclude: '.noExl',
          name: 'Excel Document Name',
          filename: '生产设备自主维护点检表',
          exclude_img: true,
          fileext: '.xls',
          exclude_links: true,
          exclude_inputs: false
        })
      },
      searchReset() {
        this.queryParam = this.dataSource = {}
        this.tableElement = null
      }
    }
  }
</script>
<style scoped lang="less">
  table {
    width: 100%;
    text-align: center;
    table-layout: fixed;
    td, th {
      border: 1px solid #000;
    }
    tr:first-child th {
      border-bottom: 0;
    }
    tr:nth-child(2) th {
      border-top: 0;
    }
    tr:nth-child(2) th {
      border-left: 0;
      border-right: 0;
    }
    tr:nth-child(2) th:first-child {
      border-left: 1px solid #000;
    }
    tr:nth-child(2) th:last-child {
      border-right: 1px solid #000;
    }
  }
</style>