Blame view

src/components/owner/ownerDetailVisit.vue 6.18 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
c85e0853   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
    <div class="margin-top">
      <el-table :data="ownerDetailVisitInfo.visits" style="width: 100%">
        <el-table-column prop="vId" :label="$t('visitManage.table.visitId')" align="center"></el-table-column>
        <el-table-column :label="$t('visitManage.table.photo')" align="center">
          <template slot-scope="scope">
            <div style="position: relative; display: inline-block;" 
                 @click="showVisitImg(scope.row.url?scope.row.url:'/img/noPhoto.jpg')">
              <img width="50" height="50" :src="scope.row.url?scope.row.url:'/img/noPhoto.jpg'"
                   onerror="this.src='/img/noPhoto.jpg';">
              <img src="/img/icon-bigimg.png" style="position: absolute;right: 0;bottom: 0;" width="50"
                   height="50" alt="">
            </div>
          </template>
        </el-table-column>
        <el-table-column :label="$t('visitManage.table.name')" align="center">
          <template slot-scope="scope">
            {{scope.row.vName}}({{scope.row.phoneNumber}})/{{scope.row.visitGender=='0'?$t('common.male'):$t('common.female')}}
          </template>
        </el-table-column>
        <el-table-column prop="ownerName" :label="$t('visitManage.table.ownerName')" align="center"></el-table-column>
        <el-table-column :label="$t('visitManage.table.visitCase')" align="center">
          <template slot-scope="scope">
            {{scope.row.visitCase}}({{scope.row.reasonTypeName}})
          </template>
        </el-table-column>
        <el-table-column :label="$t('visitManage.table.carNum')" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row.carState == '1' && scope.row.psId != null && scope.row.psId != '' && scope.row.psId != undefined">
              {{scope.row.carNum}}<br />({{scope.row.parkAreaNum}}{{$t('visitManage.table.parkingLot')}}-{{scope.row.parkingSpaceNum}}{{$t('visitManage.table.parkingSpace')}})
            </span>
            <span v-else>{{scope.row.carNum}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="entourage" :label="$t('visitManage.table.entourage')" align="center"></el-table-column>
        <el-table-column prop="createTime" :label="$t('visitManage.table.createTime')" align="center"></el-table-column>
        <el-table-column :label="$t('visitManage.table.visitTime')" align="center">
          <template slot-scope="scope">
            {{scope.row.visitTime}}<br />{{scope.row.departureTime}}
          </template>
        </el-table-column>
        <el-table-column prop="stateName" :label="$t('visitManage.table.state')" align="center"></el-table-column>
        <el-table-column prop="carStateName" :label="$t('visitManage.table.carStatus')" align="center"></el-table-column>
        <el-table-column :label="$t('common.operation')" align="center" width="300">
          <template slot-scope="scope">
            <el-button-group>
              <el-button size="mini" @click="_openVisitDetail(scope.row)">
                {{ $t('common.detail') }}
              </el-button>
              <el-button size="mini" v-if="scope.row.state != '1' && scope.row.state != '2'" 
                         @click="_openEditVisitModel(scope.row)">
                {{ $t('common.edit') }}
              </el-button>
              <el-button size="mini" v-if="scope.row.carNum != '' && scope.row.carState == '0'" 
                         @click="_openExamineVisitCarModel(scope.row)">
                {{ $t('common.audit') }}
              </el-button>
              <el-button size="mini" @click="_openDeleteVisitModel(scope.row)">
                {{ $t('common.delete') }}
              </el-button>
            </el-button-group>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        @current-change="handleCurrentChange"
        :current-page="pagination.currentPage"
        :page-size="pagination.pageSize"
        :total="pagination.total"
        layout="total, prev, pager, next, jumper">
      </el-pagination>
  
      <edit-visit ref="editVisit" @refresh="_loadOwnerDetailVisitData"></edit-visit>
      <examine-visit-car ref="examineVisitCar" @refresh="_loadOwnerDetailVisitData"></examine-visit-car>
      <delete-visit ref="deleteVisit" @refresh="_loadOwnerDetailVisitData"></delete-visit>
      <view-image ref="viewImage"></view-image>
    </div>
  </template>
  
  <script>
  //import EditVisit from '@/components/oa/editVisit'
  //import ExamineVisitCar from '@/components/oa/examineVisitCar'
  //import DeleteVisit from '@/components/oa/deleteVisit'
  import ViewImage from '@/components/system/viewImage'
  import { listVisits } from '@/api/owner/ownerDetailVisitApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'OwnerDetailVisit',
    components: {
      //EditVisit,
      //ExamineVisitCar,
      //DeleteVisit,
      ViewImage
    },
    data() {
      return {
        ownerDetailVisitInfo: {
          visits: [],
          ownerId: '',
          link: '',
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    methods: {
      _loadOwnerDetailVisitData(page, row) {
        const params = {
          page: page,
          row: row,
          communityId: getCommunityId(),
          ownerTel: this.ownerDetailVisitInfo.link,
          channel: 'PC'
        }
  
        listVisits(params).then(response => {
          this.ownerDetailVisitInfo.visits = response.visits
f9f29297   wuxw   v1.9 分页 record 传给...
122
          this.pagination.total = response.total
c85e0853   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
        }).catch(error => {
          console.error('请求失败处理', error)
        })
      },
      showVisitImg(url) {
        this.$refs.viewImage.open(url || '/img/noPhoto.jpg')
      },
      _openVisitDetail(item) {
        const flowId = item.flowId || ''
        this.$router.push(`/property/visitDetail?vId=${item.vId}&flowId=${flowId}`)
      },
      _openEditVisitModel(visit) {
        this.$refs.editVisit.open(visit)
      },
      _openExamineVisitCarModel(visit) {
        this.$refs.examineVisitCar.open(visit)
      },
      _openDeleteVisitModel(visit) {
        this.$refs.deleteVisit.open(visit)
      },
      handleCurrentChange(val) {
        this._loadOwnerDetailVisitData(val, this.pagination.pageSize)
      }
    },
    created() {
      this.$on('switch', (data) => {
        this.ownerDetailVisitInfo.ownerId = data.ownerId
        this.ownerDetailVisitInfo.link = data.link
        this._loadOwnerDetailVisitData(1, this.pagination.pageSize)
      })
    }
  }
  </script>