Blame view

src/components/simplify/simplifyOwnerComplaint.vue 5.1 KB
0a41b92e   wuxw   开发完成业务受理页面
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
  <template>
    <div>
      <el-row class="margin-top">
        <el-col :span="20"></el-col>
        <el-col :span="4" v-if="simplifyOwnerComplaintInfo.roomId != ''">
          <el-button type="primary" size="small" @click="_openAddComplaintModal">
            <i class="el-icon-plus"></i>{{ $t('simplifyOwnerComplaint.complaint') }}
          </el-button>
        </el-col>
      </el-row>
  
      <el-table :data="simplifyOwnerComplaintInfo.complaints" style="width: 100%; margin-top: 10px" border>
        <el-table-column prop="typeCdName" :label="$t('simplifyOwnerComplaint.complaintType')"
          align="center"></el-table-column>
        <el-table-column :label="$t('simplifyOwnerComplaint.house')" align="center">
          <template #default="{ row }">
            {{ row.floorNum }}{{ $t('simplifyOwnerComplaint.building') }}{{ row.unitNum }}{{ $t('simplifyOwnerComplaint.unit') }}{{ row.roomNum }}{{ $t('simplifyOwnerComplaint.room') }}
          </template>
        </el-table-column>
        <el-table-column prop="complaintName" :label="$t('simplifyOwnerComplaint.complainant')"
          align="center"></el-table-column>
        <el-table-column prop="tel" :label="$t('simplifyOwnerComplaint.complainantPhone')"
          align="center"></el-table-column>
        <el-table-column prop="stateName" :label="$t('simplifyOwnerComplaint.complaintStatus')"
          align="center"></el-table-column>
        <el-table-column prop="currentUserName" :label="$t('simplifyOwnerComplaint.handler')" align="center">
          <template #default="{ row }">
            {{ row.currentUserName == '' ? $t('simplifyOwnerComplaint.none') : row.currentUserName }}
          </template>
        </el-table-column>
        <el-table-column prop="currentUserTel" :label="$t('simplifyOwnerComplaint.handlerPhone')" align="center">
          <template #default="{ row }">
            {{ row.currentUserTel == '' ? $t('simplifyOwnerComplaint.none') : row.currentUserTel }}
          </template>
        </el-table-column>
        <el-table-column :label="$t('simplifyOwnerComplaint.operation')" align="center">
          <template #default="{ row }">
            <el-button type="text" @click="_openComplaintDetailModel(row)">
              {{ $t('simplifyOwnerComplaint.details') }}
            </el-button>
            <el-button type="text" @click="_openRunWorkflowImage(row)">
              {{ $t('simplifyOwnerComplaint.flowChart') }}
            </el-button>
          </template>
        </el-table-column>
      </el-table>
  
      <el-pagination @current-change="handleCurrentChange" :current-page="currentPage" :page-size="pageSize"
        layout="total, prev, pager, next" :total="total">
      </el-pagination>
  
      <complaint-detail ref="complaintDetail"></complaint-detail>
      <view-image ref="viewImage"></view-image>
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { listComplaints, listRunWorkflowImage } from '@/api/simplify/simplifyOwnerComplaintApi'
  import ComplaintDetail from '@/components/oa/complaintDetail'
  import ViewImage from '@/components/system/viewImage'
  
  export default {
    name: 'SimplifyOwnerComplaint',
    components: {
      ComplaintDetail,
      ViewImage
    },
    data() {
      return {
        simplifyOwnerComplaintInfo: {
          complaints: [],
          ownerId: '',
          roomId: '',
          roomName: '',
          total: 0,
          records: 1
        },
        currentPage: 1,
        pageSize: 10,
        total: 0
      }
    },
    created() {
      this.communityId = getCommunityId()
      this.initEvents()
    },
    methods: {
      initEvents() {
        this.$on('switch', this.handleSwitch)
      },
      handleSwitch(param) {
        if (param.roomId == '') return
        this.clearSimplifyOwnerComplaintInfo()
        Object.assign(this.simplifyOwnerComplaintInfo, param)
        this.listSimplifyOwnerComplaint(this.currentPage, this.pageSize)
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this.listSimplifyOwnerComplaint(val, this.pageSize)
      },
      listSimplifyOwnerComplaint(page, row) {
        const params = {
          page,
          row,
          communityId: this.communityId,
          roomId: this.simplifyOwnerComplaintInfo.roomId
        }
  
        listComplaints(params).then(res => {
          this.simplifyOwnerComplaintInfo.complaints = res.complaints
          this.total = res.records
        })
      },
      _openComplaintDetailModel(complaint) {
        this.$refs.complaintDetail.open(complaint)
      },
      _openRunWorkflowImage(complaint) {
        const params = {
          communityId: this.communityId,
          businessKey: complaint.complaintId
        }
  
        listRunWorkflowImage(params).then(res => {
          if (res.code == 0) {
            this.$refs.viewImage.show({
              url: `data:image/png;base64,${res.data}`
            })
          } else {
            this.$message.error(res.msg)
          }
        })
      },
      clearSimplifyOwnerComplaintInfo() {
        this.simplifyOwnerComplaintInfo = {
          complaints: [],
          ownerId: '',
          roomId: '',
          roomName: ''
        }
      },
      _openAddComplaintModal() {
        this.$router.push(`/pages/common/addRoomComplaint?roomId=${this.simplifyOwnerComplaintInfo.roomId}`)
      }
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 10px;
  }
  </style>