Blame view

src/views/oa/complaintDetailList.vue 6.9 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
e5d43009   wuxw   测试投诉待办
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
    <div class="complaint-detail-container">
      <el-card class="box-card">
        <div class="flex justify-between">
          <div class="text-title">{{ $t('complaintDetail.title') }}</div>
          <div>
            <el-button type="primary" size="small" style="margin-left:10px" @click="goBack">
              {{ $t('common.back') }}
            </el-button>
          </div>
        </div>
  
        <!-- 业主信息 -->
        <div class="margin-top">
          <el-row :gutter="20"  class="text-left">
            <el-col :span="24">
              <el-row :gutter="20">
                <el-col :span="6">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.orderNo') }}
                    </label>
                    <label class="">{{complaintDetailInfo.complaintId}}</label>
                  </div>
                </el-col>
                <el-col :span="6">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.type') }}
                    </label>
                    <label class="">{{complaintDetailInfo.typeName}}</label>
                  </div>
                </el-col>
                <el-col :span="6">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.house') }}
                    </label>
                    <label class="">
                      {{complaintDetailInfo.roomName}}
                    </label>
                  </div>
                </el-col>
                <el-col :span="6">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.contact') }}
                    </label>
                    <label class="">{{complaintDetailInfo.complaintName}}</label>
                  </div>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="6">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.phone') }}
                    </label>
                    <label class="">{{complaintDetailInfo.tel}}</label>
                  </div>
                </el-col>
                <el-col :span="6">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.status') }}
                    </label>
                    <label class="">{{complaintDetailInfo.stateName}}</label>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.createTime') }}
                    </label>
                    <label class="">{{complaintDetailInfo.createTime}}</label>
                  </div>
                </el-col>
                <el-col :span="24">
                  <div class="form-group">
                    <label class="col-form-label">
                      {{ $t('complaintDetailInfo.content') }}
                    </label>
                    <label class="">{{complaintDetailInfo.context}}</label>
                  </div>
                </el-col>
              </el-row>
            </el-col>
          </el-row>
        </div>
  
        <divider></divider>
  
        <div class="margin-top-sm">
          <el-tabs v-model="complaintDetailInfo._currentTab" @tab-click="changeTab(complaintDetailInfo._currentTab)">
            <el-tab-pane :label="$t('complaintDetail.workflow')" name="complaintDetailEvent">
              <complaint-detail-event v-if="complaintDetailInfo._currentTab === 'complaintDetailEvent'" 
                ref="complaintDetailEvent" />
            </el-tab-pane>
            <el-tab-pane :label="$t('complaintDetail.evaluation')" name="complaintDetailAppraise">
              <complaint-detail-appraise v-if="complaintDetailInfo._currentTab === 'complaintDetailAppraise'" 
                ref="complaintDetailAppraise" />
            </el-tab-pane>
            <el-tab-pane :label="$t('complaintDetail.type')" name="complaintDetailType">
              <complaint-detail-type v-if="complaintDetailInfo._currentTab === 'complaintDetailType'" 
                ref="complaintDetailType" />
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-card>
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import ComplaintDetailEvent from '@/components/oa/ComplaintDetailEvent'
  import ComplaintDetailAppraise from '@/components/oa/ComplaintDetailAppraise'
  import ComplaintDetailType from '@/components/oa/ComplaintDetailType'
  import { getComplaintDetail } from '@/api/oa/complaintDetailApi'
  import divider from '@/components/system/divider'
  
  export default {
    name: 'ComplaintDetailList',
    components: {
      ComplaintDetailEvent,
      ComplaintDetailAppraise,
      ComplaintDetailType,
      divider
    },
    data() {
      return {
        complaintDetailInfo: {
          viewComplaintFlag: '',
          complaintId: "",
          typeName: '',
          typeCd: '',
          roomName: "",
          complaintName: "",
          tel: "",
          stateName: "",
          createTime: "",
          context: '',
          _currentTab: 'complaintDetailEvent',
        },
        communityId: ''
      }
    },
    created() {
      this.communityId = getCommunityId()
      this.complaintDetailInfo.complaintId = this.$route.query.complaintId
      if (!this.complaintDetailInfo.complaintId) {
        return
      }
      const currentTab = this.$route.query.currentTab
      if (currentTab) {
        this.complaintDetailInfo._currentTab = currentTab
      }
      this.loadComplaintInfo()
    },
    methods: {
      async loadComplaintInfo() {
        try {
          const params = {
            complaintId: this.complaintDetailInfo.complaintId,
            page: 1,
            row: 1,
            communityId: this.communityId,
            ownerTypeCd: '1001'
          }
          const { data } = await getComplaintDetail(params)
          if (data && data.length > 0) {
            Object.assign(this.complaintDetailInfo, data[0])
          }
        } catch (error) {
          console.error('获取投诉详情失败:', error)
        }
      },
      changeTab(tab) {
        this.complaintDetailInfo._currentTab = tab
        setTimeout(() => {
          if (this.$refs[tab]) {
            this.$refs[tab].initData({
              complaintId: this.complaintDetailInfo.complaintId,
              typeCd: this.complaintDetailInfo.typeCd
            })
          }
        }, 500)
      },
      goBack() {
        this.$router.go(-1)
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .complaint-detail-container {
    padding: 20px;
  
    .box-card {
      padding: 20px;
    }
  
    .text-title {
      font-size: 18px;
      font-weight: bold;
      color: #333;
    }
  
    .margin-top {
      margin-top: 20px;
    }
  
    .margin-top-sm {
      margin-top: 10px;
    }
  
    .form-group {
      margin-bottom: 15px;
  
      .col-form-label {
        margin-bottom: 5px;
        color: #606266;
      }
    }
  }
  </style>