zhaowei
2025-06-11 51a85778763739b2d217896f76ba830522788fad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<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-search :readOnly="true" v-model="queryParam.num" @search="handleOpenEamEquipmentListModal"
                              enter-button placeholder='请选择设备编号'/>
            </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;position: relative">
          <th colspan="42">
            生产设备自主维护点检表
            <span style="position: absolute;right: 22.5%">{{dataSource.regulations}}</span>
          </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.find(item=>item.weekOfMonth===childItem)?item.dataList.find(item=>item.weekOfMonth===childItem).insResult:''}}
          </td>
          <td colspan="7">
            {{item.dataList&&item.dataList.find(item=>item.weekOfMonth===5)?item.dataList.find(item=>item.weekOfMonth===5).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.find(item=>item.weekOfMonth===childItem)?dataSource.list5[0].dataList.find(item=>item.weekOfMonth===childItem).inspectionUserName:''}}
          </td>
          <td colspan="7">
            {{dataSource.list5&&dataSource.list5[0]&&dataSource.list5[0].dataList&&dataSource.list5[0].dataList.find(item=>item.weekOfMonth===5)?dataSource.list5[0].dataList.find(item=>item.weekOfMonth===5).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.find(item=>item.weekOfMonth===childItem)?dataSource.list6[0].dataList.find(item=>item.weekOfMonth===childItem).repairConfirmPerson:''}}
          </td>
          <td colspan="7">
            {{dataSource.list6&&dataSource.list6[0]&&dataSource.list6[0].dataList&&dataSource.list6[0].dataList.find(item=>item.weekOfMonth===5)?dataSource.list6[0].dataList.find(item=>item.weekOfMonth===5).repairConfirmPerson:''}}
          </td>
        </tr>
 
        <tr>
          <td colspan="42" style="text-align: left">
            填写要求:正常=√,异常=×,故障停机=△,没开机=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>
 
    <eam-equipment-list-modal ref="eamEquipmentListModal" @sendSelectionRows="setSelectedEquipmentId"/>
  </a-card>
</template>
 
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { getAction } from '@/api/manage'
  import $ from 'jquery'
  import '@/components/table2excel/table2excel'
  import EamEquipmentListModal from './modules/SelfMaintenanceAndInspectionList/EamEquipmentListModal'
  import moment from 'moment'
 
  export default {
    name: 'SelfMaintenanceAndInspectionList',
    components: { EamEquipmentListModal },
    mixins: [JeecgListMixin],
    data() {
      return {
        disableMixinCreated: true,
        dataSource: {},
        tableElement: null,
        url: {
          list: '/eam/inspectionOrder/findInspectionForms'
        }
      }
    },
    created() {
      this.$set(this.queryParam, 'dataTime', moment().format('YYYY-MM'))
    },
    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
              this.$nextTick(() => this.tableElement = document.getElementById('dataTable'))
            }
            else that.$message.warning(res.message)
          })
          .finally(() => {
            that.loading = false
          })
      },
 
      // 控制选择设备弹窗弹出
      handleOpenEamEquipmentListModal() {
        this.$refs.eamEquipmentListModal.visible = true
        this.$refs.eamEquipmentListModal.openPage()
      },
 
      setSelectedEquipmentId(record) {
        this.$set(this.queryParam, 'num', record.num)
      },
 
      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 = {
          dataTime: moment().format('YYYY-MM')
        }
        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>