Blame view

src/components/simplify/simplifyOwnerRepair.vue 3.66 KB
0a41b92e   wuxw   开发完成业务受理页面
1
2
  <template>
    <div>
92c405db   wuxw   优化业务受理中部分选项打不开bug
3
4
5
      <div class="flex justify-between">
        <div></div>
        <div v-if="simplifyOwnerRepairInfo.roomId != ''">
0a41b92e   wuxw   开发完成业务受理页面
6
7
8
          <el-button type="primary" size="small" @click="_openAddOwnerRepairModal">
            <i class="el-icon-plus"></i>{{ $t('simplifyOwnerRepair.phoneRepair') }}
          </el-button>
92c405db   wuxw   优化业务受理中部分选项打不开bug
9
10
        </div>
      </div>
0a41b92e   wuxw   开发完成业务受理页面
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
  
      <el-table
        :data="simplifyOwnerRepairInfo.repairs"
        style="width: 100%; margin-top: 10px"
        border>
        <el-table-column prop="repairId" :label="$t('simplifyOwnerRepair.workOrderCode')" align="center"></el-table-column>
        <el-table-column prop="repairObjName" :label="$t('simplifyOwnerRepair.location')" align="center"></el-table-column>
        <el-table-column prop="repairTypeName" :label="$t('simplifyOwnerRepair.repairType')" align="center"></el-table-column>
        <el-table-column prop="repairName" :label="$t('simplifyOwnerRepair.reporter')" align="center"></el-table-column>
        <el-table-column prop="tel" :label="$t('simplifyOwnerRepair.contact')" align="center"></el-table-column>
        <el-table-column prop="appointmentTime" :label="$t('simplifyOwnerRepair.appointmentTime')" align="center"></el-table-column>
        <el-table-column prop="stateName" :label="$t('simplifyOwnerRepair.status')" align="center"></el-table-column>
        <el-table-column :label="$t('simplifyOwnerRepair.operation')" align="center">
          <template #default="{row}">
            <el-button type="text" @click="_openRepairDetail(row)">
              {{ $t('simplifyOwnerRepair.details') }}
            </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>
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { listOwnerRepairs } from '@/api/simplify/simplifyOwnerRepairApi'
  
  export default {
    name: 'SimplifyOwnerRepair',
    data() {
      return {
        simplifyOwnerRepairInfo: {
          repairs: [],
          ownerId: '',
          roomId: '',
          total: 0,
          records: 1,
          roomName: ''
        },
        currentPage: 1,
        pageSize: 10,
        total: 0
      }
    },
    created() {
      this.communityId = getCommunityId()
0a41b92e   wuxw   开发完成业务受理页面
65
66
    },
    methods: {
92c405db   wuxw   优化业务受理中部分选项打不开bug
67
68
      open(param) {
        this.handleSwitch(param)
0a41b92e   wuxw   开发完成业务受理页面
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
      },
      handleSwitch(param) {
        if (param.roomId == '') return
        this.clearSimplifyOwnerRepairInfo()
        Object.assign(this.simplifyOwnerRepairInfo, param)
        this.listSimplifyOwnerRepair(this.currentPage, this.pageSize)
      },
      handleCurrentChange(val) {
        this.currentPage = val
        this.listSimplifyOwnerRepair(val, this.pageSize)
      },
      listSimplifyOwnerRepair(page, row) {
        const params = {
          page,
          row,
          communityId: this.communityId,
          repairObjId: this.simplifyOwnerRepairInfo.roomId
        }
        
        listOwnerRepairs(params).then(res => {
          this.simplifyOwnerRepairInfo.repairs = res.data
          this.total = res.records
        })
      },
      _openRepairDetail(repairPool) {
92c405db   wuxw   优化业务受理中部分选项打不开bug
94
        this.$router.push(`/views/work/repairDetail?repairId=${repairPool.repairId}`)
0a41b92e   wuxw   开发完成业务受理页面
95
96
97
98
99
100
101
102
103
104
105
106
      },
      clearSimplifyOwnerRepairInfo() {
        this.simplifyOwnerRepairInfo = {
          repairs: [],
          ownerId: '',
          roomId: '',
          total: 0,
          records: 1,
          roomName: ''
        }
      },
      _openAddOwnerRepairModal() {
92c405db   wuxw   优化业务受理中部分选项打不开bug
107
        this.$router.push(`/views/work/addRoomRepair?roomId=${this.simplifyOwnerRepairInfo.roomId}&roomName=${this.simplifyOwnerRepairInfo.roomName}`)
0a41b92e   wuxw   开发完成业务受理页面
108
109
110
111
112
113
114
115
116
117
      }
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 10px;
  }
  </style>