zhaowei
8 天以前 3db6d5c4d17ab9942a5c89a167c1f06ca485f355
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
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
 
          <a-col :span="4">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="4">
            <a-form-item label="消息状态">
              <j-dict-select-tag dictCode="mdcMsgStatus" v-model='queryParam.msgStatus' placeholder="请选择消息状态"/>
            </a-form-item>
          </a-col>
 
          <a-col :span="4">
            <a-form-item label="异常类型">
              <j-dict-select-tag dictCode="mdcMsgType" v-model='queryParam.msgType' placeholder="请选择异常类型"/>
            </a-form-item>
          </a-col>
 
          <a-col :span="4">
            <a-form-item label="消息来源">
              <a-select v-model="queryParam.msgSource" placeholder="请选择消息来源">
                <a-select-option key="手动上报">手动上报</a-select-option>
                <a-select-option key="系统生成">系统生成</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
 
          <a-col :span="6">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
 
        </a-row>
      </a-form>
    </div>
 
    <!-- 操作按钮区域· -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>
 
    <a-table
      ref="table"
      size="default"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange">
      <span slot="action" slot-scope="text, record">
        <a @click="showModal(record,1)">查看</a>
        <a-divider type="vertical" v-if="record.hasProcess||record.hasConfirm"></a-divider>
        <a @click="showModal(record,2)" v-if="record.hasProcess">上报</a>
        <a @click="showModal(record,3)" v-if="record.hasConfirm">确认</a>
        <!--<a @click="showModal(record,0)">查看</a>-->
        <!--<a-divider type="vertical"></a-divider>-->
        <!--<a @click="showModal(record,1)">上报</a>-->
        <!--<a-divider type="vertical"></a-divider>-->
        <!--<a @click="showModal(record,2)">确认</a>-->
      </span>
    </a-table>
    <mdc-message-approval-modal ref="modalForm" :title="modalTitle" :visible="modalVisible" :buttonId="buttonId"
                                :disableSubmit="disableSubmit"
                                @closeModal="modalVisible = false" @formHasSubmitted="loadData"/>
  </a-card>
</template>
 
<script>
  import { getAction, putAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import MdcMessageApprovalModal from './modules/MdcMessageApproval/MdcMessageApprovalModal'
 
  export default {
    name: 'MdcMessageApproval',
    mixins: [JeecgListMixin],
    components: { MdcMessageApprovalModal },
    data() {
      return {
        description: 'mdc消息确认页面',
        queryParam: {},
        columns: [
          {
            title: '消息来源',
            align: 'center',
            dataIndex: 'msgSource',
            width: 150
          },
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentId',
            width: 150
          },
          {
            title: '异常类型',
            align: 'center',
            dataIndex: 'msgType',
            width: 150
          },
          {
            title: '标题',
            align: 'center',
            dataIndex: 'titile'
          },
          {
            title: '内容',
            align: 'center',
            dataIndex: 'msgContent'
          },
          {
            title: '原因',
            align: 'center',
            dataIndex: 'reportContent'
          },
          {
            title: '反馈人',
            align: 'center',
            dataIndex: 'senderNames',
            width: 120
          },
          {
            title: '确认人',
            align: 'center',
            dataIndex: 'approverNames',
            width: 120
          },
          {
            title: '状态',
            align: 'center',
            dataIndex: 'msgStatus_dictText',
            width: 120,
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: '/mdc/mdcMessageApproval/list'
        },
        loading: false,
        msgStatusOptionList: [],
        modalTitle: '',
        modalVisible: false,
        disableSubmit: false,
        buttonId: null
      }
    },
    methods: {
      handleAdd() {
        this.modalTitle = '新增'
        this.buttonId = null
        this.disableSubmit = false
        this.$refs.modalForm.formParams = {}
        this.modalVisible = true
      },
 
      /**
       * 点击按钮展示弹窗
       * @param record 点击行信息
       * @param buttonId 按钮Id(查看:0,上报:1,确认:2)
       */
      showModal(record, buttonId) {
        this.buttonId = buttonId
        this.disableSubmit = true
        switch (buttonId) {
          case 1:
            this.modalTitle = '消息内容'
            break
          case 2:
            this.modalTitle = '上报原因'
            break
          case 3:
            this.modalTitle = '确认消息'
            break
          default:
            this.modalTitle = '消息内容'
        }
        this.$refs.modalForm.formParams = Object.assign({}, record)
        this.modalVisible = true
      }
    }
  }
</script>