Blame view

src/components/owner/ownerDetailCar.vue 5.09 KB
c85e0853   wuxw   业主详情开发完成
1
2
  <template>
    <div class="margin-top">
f741902e   wuxw   v1.9 优化产权登记图片不能放大的问题
3
      <el-row class="">
c85e0853   wuxw   业主详情开发完成
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
        <el-col :span="4" class="padding-right-xs padding-left-xl">
          <el-input
            v-model="ownerDetailCarInfo.carNum"
            :placeholder="$t('ownerDetailCar.pleaseEnterCarNumber')"
          />
        </el-col>
        <el-col :span="4" class="padding-right-xs padding-right-xl">
          <el-button
            type="primary"
            size="small"
            style="margin-left:10px"
            @click="_qureyOwnerDetailCar"
          >
            <i class="el-icon-search"></i>{{ $t('common.query') }}
          </el-button>
        </el-col>
        <el-col :span="16" class="text-right">
          <el-button
            type="primary"
            size="small"
            style="margin-left:10px"
            v-if="hasPrivilege('502023032813991677')"
            @click="_addOwnerCar"
          >
            {{ $t('ownerDetailCar.addCar') }}
          </el-button>
        </el-col>
      </el-row>
      <div class="margin-top">
        <el-table
          :data="ownerDetailCarInfo.cars"
          style="width: 100%"
          border
          stripe
        >
          <el-table-column
            prop="carNum"
            :label="$t('ownerDetailCar.carNumber')"
            align="center"
          />
          <el-table-column
            :label="$t('ownerDetailCar.licenseType')"
            align="center"
          >
            <template slot-scope="scope">
              {{ scope.row.leaseType === 'T' ? $t('ownerDetailCar.temporaryCar') : scope.row.leaseTypeName }}
            </template>
          </el-table-column>
          <el-table-column
            prop="carTypeName"
            :label="$t('ownerDetailCar.carType')"
            align="center"
          />
          <el-table-column
            prop="carColor"
            :label="$t('ownerDetailCar.color')"
            align="center"
          />
          <el-table-column
            :label="$t('ownerDetailCar.owner')"
            align="center"
          >
            <template slot-scope="scope">
              {{ scope.row.ownerName }}({{ scope.row.link }})
            </template>
          </el-table-column>
          <el-table-column
            :label="$t('ownerDetailCar.parkingSpace')"
            align="center"
          >
            <template slot-scope="scope">
              <span v-if="scope.row.areaNum && scope.row.state === '1001'">
                {{ scope.row.areaNum }}-{{ scope.row.num }}
              </span>
              <span v-else>
                {{ $t('ownerDetailCar.parkingSpaceReleased') }}
              </span>
            </template>
          </el-table-column>
          <el-table-column
            :label="$t('ownerDetailCar.validityPeriod')"
            align="center"
          >
            <template slot-scope="scope">
              <div v-if="scope.row.leaseType === 'H'">
                {{ scope.row.startTime }}<br>~{{ scope.row.endTime }}
              </div>
              <div v-else>-</div>
            </template>
          </el-table-column>
        </el-table>
        <el-row>
          <el-col :span="12" :offset="12">
            <el-pagination
              @current-change="handlePageChange"
              :current-page="pagination.currentPage"
              :page-size="pagination.pageSize"
              :total="pagination.total"
              layout="total, prev, pager, next, jumper"
              class="text-right"
            />
          </el-col>
        </el-row>
      </div>
    </div>
  </template>
  
  <script>
  import { queryOwnerCars } from '@/api/owner/ownerDetailCarApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'OwnerDetailCar',
    data() {
      return {
        ownerDetailCarInfo: {
          cars: [],
          ownerId: '',
          ownerName: '',
          carNum: ''
        },
        pagination: {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    methods: {
      open(ownerId, ownerName) {
        this.ownerDetailCarInfo.ownerId = ownerId
        this.ownerDetailCarInfo.ownerName = ownerName
        this._loadOwnerDetailCarData(1, 10)
      },
      _loadOwnerDetailCarData(page, row) {
        const params = {
          communityId: getCommunityId(),
          ownerId: this.ownerDetailCarInfo.ownerId,
          carNum: this.ownerDetailCarInfo.carNum,
          page,
          row
        }
  
        queryOwnerCars(params).then(res => {
          this.ownerDetailCarInfo.cars = res.data
          this.pagination = {
            currentPage: page,
            pageSize: row,
f9f29297   wuxw   v1.9 分页 record 传给...
152
            total: res.total
c85e0853   wuxw   业主详情开发完成
153
154
155
156
157
158
159
160
161
162
          }
        }).catch(error => {
          console.error('请求失败:', error)
        })
      },
      _qureyOwnerDetailCar() {
        this._loadOwnerDetailCarData(1, 10)
      },
      _addOwnerCar() {
        this.$router.push({
946eab95   wuxw   v1.9 优化客户周反馈bug
163
          path: '/views/car/hireParkingSpace',
c85e0853   wuxw   业主详情开发完成
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
          query: {
            ownerId: this.ownerDetailCarInfo.ownerId,
            ownerName: this.ownerDetailCarInfo.ownerName
          }
        })
      },
      handlePageChange(currentPage) {
        this._loadOwnerDetailCarData(currentPage, this.pagination.pageSize)
      },
    }
  }
  </script>
  
  <style scoped>
  .margin-top {
    margin-top: 20px;
  }
  .margin-top-lg {
    margin-top: 30px;
  }
  .padding-right-xs {
    padding-right: 5px;
  }
  .padding-left-xl {
    padding-left: 20px;
  }
  .padding-right-xl {
    padding-right: 20px;
  }
  .text-right {
    text-align: right;
  }
  </style>