Blame view

src/views/oa/complaintList.vue 8.69 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
0a06b2d1   wuxw   开发完成投诉建议
2
3
4
    <div class="complaint-container animated fadeInRight">
      <el-row :gutter="20">
        <el-col :span="4">
2e81c59f   wuxw   完成办公功能测试
5
6
7
          <div class="list-group-border-radius">
            <div class=" treeview">
              <ul class="list-group text-center ">
0a06b2d1   wuxw   开发完成投诉建议
8
9
10
11
12
13
14
                <li v-for="(item, index) in complaintInfo.states" :key="index" @click="swatchComplaintState(item)"
                  :class="{ 'vc-node-selected': complaintInfo.conditions.state == item.statusCd }"
                  class="list-group-item node-orgTree">
                  {{ item.name }}
                </li>
              </ul>
            </div>
2e81c59f   wuxw   完成办公功能测试
15
          </div>
0a06b2d1   wuxw   开发完成投诉建议
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
        </el-col>
        <el-col :span="20">
          <el-card>
            <div slot="header" class="flex justify-between">
              <span>{{ $t('complaint.search.title') }}</span>
            </div>
            <el-row :gutter="20">
              <el-col :span="4">
                <el-select v-model="complaintInfo.conditions.typeCd" :placeholder="$t('complaint.search.type')"
                  style="width:100%">
                  <el-option v-for="item in complaintInfo.complaintTypes" :key="item.typeCd" :label="item.typeName"
                    :value="item.typeCd" />
                </el-select>
              </el-col>
              <el-col :span="4">
                <el-input v-model="complaintInfo.conditions.roomName" :placeholder="$t('complaint.search.room')" />
              </el-col>
              <el-col :span="4">
                <el-input v-model="complaintInfo.conditions.complaintName" :placeholder="$t('complaint.search.contact')" />
              </el-col>
              <el-col :span="4">
                <el-input v-model="complaintInfo.conditions.tel" :placeholder="$t('complaint.search.phone')" />
              </el-col>
              <el-col :span="4">
                <el-input v-model="complaintInfo.conditions.complaintId" :placeholder="$t('complaint.search.id')" />
              </el-col>
              <el-col :span="4">
                <el-button type="primary" @click="_queryComplaintMethod()">
                  {{ $t('common.search') }}
                </el-button>
              </el-col>
            </el-row>
            <el-row :gutter="20" style="margin-top:15px">
              <el-col :span="4">
b25b036d   wuxw   v1.9 优化日期
50
                <el-date-picker v-model="complaintInfo.conditions.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"                :placeholder="$t('complaint.search.startTime')" style="width:100%"  />
0a06b2d1   wuxw   开发完成投诉建议
51
52
              </el-col>
              <el-col :span="4">
b25b036d   wuxw   v1.9 优化日期
53
                <el-date-picker v-model="complaintInfo.conditions.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"                :placeholder="$t('complaint.search.endTime')" style="width:100%"  />
0a06b2d1   wuxw   开发完成投诉建议
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
              </el-col>
            </el-row>
          </el-card>
  
          <el-card style="margin-top:20px">
            <div slot="header" class="flex justify-between">
              <span>{{ $t('complaint.list.title') }}</span>
              <el-button type="primary" size="small" style="float:right" @click="_openAddComplaintModal()">
                <i class="el-icon-plus"></i>{{ $t('complaint.list.add') }}
              </el-button>
            </div>
            <el-table :data="complaintInfo.complaints" border style="width:100%" v-loading="loading">
              <el-table-column prop="complaintId" :label="$t('complaint.table.id')" align="center" />
              <el-table-column prop="typeName" :label="$t('complaint.table.type')" align="center" />
              <el-table-column prop="roomName" :label="$t('complaint.table.room')" align="center" />
              <el-table-column prop="complaintName" :label="$t('complaint.table.contact')" align="center" />
              <el-table-column prop="tel" :label="$t('complaint.table.phone')" align="center" />
              <el-table-column prop="stateName" :label="$t('complaint.table.status')" align="center" />
              <el-table-column :label="$t('complaint.table.handler')" align="center">
                <template slot-scope="scope">
                  <span v-for="(item, index) in scope.row.staffs" :key="index">{{ item.staffName }}<br /></span>
                </template>
              </el-table-column>
              <el-table-column prop="createTime" :label="$t('complaint.table.createTime')" align="center" />
              <el-table-column :label="$t('common.operation')" align="center" width="220">
                <template slot-scope="scope">
                  <el-button-group>
                    <el-button size="mini" @click="_openComplaintDetailModel(scope.row)">
                      {{ $t('common.detail') }}
                    </el-button>
                    <el-button size="mini" @click="_openEditComplaintModel(scope.row)">
                      {{ $t('common.edit') }}
                    </el-button>
                    <el-button size="mini" type="danger" @click="_openDeleteComplaintModel(scope.row)">
                      {{ $t('common.delete') }}
                    </el-button>
                  </el-button-group>
                </template>
              </el-table-column>
            </el-table>
            <el-pagination style="margin-top:15px" @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
              layout="total, sizes, prev, pager, next, jumper" :total="page.total" />
          </el-card>
        </el-col>
      </el-row>
  
      <view-image ref="viewImage" />
      <edit-complaint ref="editComplaint" @success="handleSuccess" />
      <delete-complaint ref="deleteComplaint" @success="handleSuccess" />
      <complaint-detail ref="complaintDetail" />
    </div>
  </template>
  
  <script>
  import { listComplaints, listComplaintTypes } from '@/api/oa/complaintApi'
  import { getCommunityId } from '@/api/community/communityApi'
  import ViewImage from '@/components/system/viewImage'
  import EditComplaint from '@/components/oa/editComplaint'
  import DeleteComplaint from '@/components/oa/deleteComplaint'
  import ComplaintDetail from '@/components/oa/complaintDetail'
  
  export default {
    name: 'ComplaintList',
    components: {
      ViewImage,
      EditComplaint,
      DeleteComplaint,
2ca25ccd   wuxw   优化完成投诉建议功能
122
      ComplaintDetail,
0a06b2d1   wuxw   开发完成投诉建议
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
    },
    data() {
      return {
        loading: false,
        page: {
          current: 1,
          size: 10,
          total: 0
        },
        complaintInfo: {
          complaints: [],
          states: [
            { statusCd: '', name: this.$t('complaint.status.all') },
            { statusCd: 'W', name: this.$t('complaint.status.processing') },
            { statusCd: 'C', name: this.$t('complaint.status.completed') }
          ],
          complaintTypes: [],
          conditions: {
            complaintId: '',
            typeCd: '',
            complaintName: '',
            tel: '',
            roomName: '',
            state: '',
            startTime: '',
            endTime: '',
            communityId: ''
          }
        }
      }
    },
    created() {
      this.communityId = getCommunityId()
      this.complaintInfo.conditions.communityId = this.communityId
      this._listComplaintTypes()
      this._listComplaints()
    },
    methods: {
      async _listComplaints() {
        try {
          this.loading = true
          const params = {
            ...this.complaintInfo.conditions,
            page: this.page.current,
            row: this.page.size
          }
          const { data, total } = await listComplaints(params)
          this.complaintInfo.complaints = data
          this.page.total = total
        } catch (error) {
          this.$message.error(this.$t('complaint.fetchError'))
        } finally {
          this.loading = false
        }
      },
      async _listComplaintTypes() {
        try {
          const params = {
            page: 1,
            row: 100,
            communityId: this.communityId
          }
          const { data } = await listComplaintTypes(params)
          this.complaintInfo.complaintTypes = data
        } catch (error) {
          console.error('获取投诉类型失败:', error)
        }
      },
      swatchComplaintState(item) {
        this.complaintInfo.conditions.state = item.statusCd
        this._listComplaints()
      },
      _openAddComplaintModal() {
        this.$router.push('/views/oa/addComplaint')
      },
      _openEditComplaintModel(row) {
        this.$refs.editComplaint.open(row)
      },
      _openDeleteComplaintModel(row) {
        this.$refs.deleteComplaint.open(row)
      },
      _openComplaintDetailModel(row) {
e5d43009   wuxw   测试投诉待办
205
        this.$router.push(`/pages/complaint/complaintDetail?complaintId=${row.complaintId}`)
0a06b2d1   wuxw   开发完成投诉建议
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
      },
      _queryComplaintMethod() {
        this.page.current = 1
        this._listComplaints()
      },
      handleSizeChange(val) {
        this.page.size = val
        this._listComplaints()
      },
      handleCurrentChange(val) {
        this.page.current = val
        this._listComplaints()
      },
      handleSuccess() {
        this._listComplaints()
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .complaint-container {
    padding: 20px;
  
    .border-radius {
      border-radius: 4px;
    }
  
2e81c59f   wuxw   完成办公功能测试
234
    
0a06b2d1   wuxw   开发完成投诉建议
235
236
  }
  </style>