zhangherong
2025-06-02 c82ac973f3ebf35a9c595259706090cf73610283
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
<template>
  <a-card :bordered="false">
 
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper" v-if="isDisplayOperation">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="工单编号">
              <a-input placeholder="请输入工单编号" v-model="queryParam.repairCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <!--<a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>-->
              <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="维修状态">
              <a-select placeholder="请选择维修状态" v-model="queryParam.repairStatus" allow-clear>
                <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
 
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <!--<a @click="handleToggleSearch" style="margin-left: 8px">-->
              <!--{{ toggleSearchStatus ? '收起' : '展开' }}-->
              <!--<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
              <!--</a>-->
            </span>
          </a-col>
 
        </a-row>
      </a-form>
    </div>
 
    <!-- 操作按钮区域 -->
    <div class="table-operator" v-if="isDisplayOperation">
      <a-button @click="handleOpenReceiveFaultModal" type="primary" icon="plus" v-if="isShowAuth('eam:repair:collect')">领取</a-button>
      <!--<a-button type="primary" icon="download" @click="handleExportXls('维修工单')">导出</a-button>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
            <a-icon type="delete"/>
            删除
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
    </div>
 
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;" v-if="isDisplayOperation">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
        style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
 
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange"
        :scroll="{x:'max-content'}"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
 
    <receive-fault-modal ref="receiveFaultModalRef" @ok="loadData"/>
 
    <repair-order-approval-modal ref="repairOrderApprovalModal" :selectShenpiData="selectRepairOrderData"/>
  </a-card>
</template>
 
<script>
  import '@/assets/less/TableExpand.less'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ReceiveFaultModal from './modules/EamRepairOrderList/ReceiveFaultModal'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect'
  import RepairOrderApprovalModal from '../../flowable/workflow/repairOrder/RepairOrderApprovalModal'
 
  export default {
    name: 'EamRepairOrderList',
    mixins: [JeecgListMixin],
    components: {
      RepairOrderApprovalModal,
      LxSearchEquipmentSelect,
      ReceiveFaultModal
    },
    props: {
      isDisplayOperation: {
        type: Boolean,
        default: true
      }
    },
    data() {
      return {
        description: '维修工单管理页面',
        disableMixinCreated: true,
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            },
          },
          {
            title: '工单编号',
            align: 'center',
            dataIndex: 'repairCode',
          },
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentCode',
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName',
          },
          {
            title: '安装位置',
            align: 'center',
            dataIndex: 'installationPosition',
          },
          {
            title: '维修状态',
            align: 'center',
            dataIndex: 'repairStatus_dictText',
          },
          {
            title: '维修负责人',
            align: 'center',
            dataIndex: 'repairer',
          },
          {
            title: '维修开始时间',
            align: 'center',
            dataIndex: 'actualStartTime',
          },
          {
            title: '维修结束时间',
            align: 'center',
            dataIndex: 'actualEndTime',
          },
          {
            title: '故障原因',
            align: 'center',
            dataIndex: 'faultReason'
          },
          {
            title: '维修结果描述',
            align: 'center',
            dataIndex: 'repairDescription'
            // width: 300
          }
        ],
        report_repair_status_list: [],
        selectRepairOrderData: {},
        url: {
          list: '/eam/eamRepairOrder/list',
          delete: '/eam/eamRepairOrder/delete',
          deleteBatch: '/eam/eamRepairOrder/deleteBatch',
          exportXlsUrl: 'eam/eamRepairOrder/exportXls'
        }
      }
    },
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    created() {
      if (!this.isDisplayOperation) {
        return
      }
      this.initDictData('report_repair_status')
      const operationColumn = {
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        width: 100,
        fixed: 'right',
        scopedSlots: { customRender: 'action' }
      }
      this.columns = [...this.columns, operationColumn]
      this.loadData(1)
    },
    methods: {
      /**
       * 获取数据字典值
       * @param dictCode 数据字典对应记录编码
       */
      initDictData(dictCode) {
        // //优先从缓存中读取字典配置
        if (getDictItemsFromCache(dictCode)) {
          this[dictCode + '_list'] = getDictItemsFromCache(dictCode)
          return
        }
        //根据字典Code, 初始化字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            this[dictCode + '_list'] = res.result
            return
          }
        })
      },
 
      // 开启领取故障保修单弹窗
      handleOpenReceiveFaultModal() {
        this.$refs.receiveFaultModalRef.visible = true
      },
 
      /**
       * 点击详情触发
       * @param record 表格行信息
       */
      handleDetail(record) {
        this.selectRepairOrderData = Object.assign({}, record)
        this.$refs.repairOrderApprovalModal.visible = true
        this.$refs.repairOrderApprovalModal.title = '详情'
        this.$refs.repairOrderApprovalModal.disableSubmit = true
        this.$refs.repairOrderApprovalModal.getAllApproveData(record)
        this.$refs.repairOrderApprovalModal.getBasicInformation({ ...record, dataId: record.id })
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>