Blame view

src/views/fee/carCreateFeeList.vue 6.79 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
2e0fd29c   wuxw   开发报修
2
3
    <div class="car-create-fee-container">
      <el-card class="box-card">
d767b5e6   wuxw   v1.9 合同费用bug 修复
4
5
        <div slot="header" class="flex justify-between">
          <div>{{ $t('carCreateFee.queryCondition') }}</div>
2e0fd29c   wuxw   开发报修
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
        </div>
        <el-row :gutter="20">
          <el-col :span="4">
            <el-input v-model.trim="queryParams.allNum" :placeholder="$t('carCreateFee.parkingSpacePlaceholder')"
              @keyup.enter.native="handleQuery" />
          </el-col>
          <el-col :span="4">
            <el-input v-model.trim="queryParams.carNumLike" :placeholder="$t('carCreateFee.carNumPlaceholder')"
              @keyup.enter.native="handleQuery" />
          </el-col>
          <el-col :span="4">
            <el-input v-model.trim="queryParams.ownerName" :placeholder="$t('carCreateFee.ownerNamePlaceholder')"
              @keyup.enter.native="handleQuery" />
          </el-col>
          <el-col :span="4">
963f5a4f   wuxw   车辆功能测试完成
21
22
            <el-select v-model="queryParams.state" :placeholder="$t('carCreateFee.parkingSpaceStatus')"
              style="width:100%">
2e0fd29c   wuxw   开发报修
23
24
25
26
              <el-option v-for="item in states" :key="item.statusCd" :label="item.name" :value="item.statusCd" />
            </el-select>
          </el-col>
          <el-col :span="4" style="text-align:right">
d767b5e6   wuxw   v1.9 合同费用bug 修复
27
            <el-button type="primary" size="small" @click="handleQuery">
2e0fd29c   wuxw   开发报修
28
29
30
              <i class="el-icon-search"></i>
              {{ $t('carCreateFee.query') }}
            </el-button>
d767b5e6   wuxw   v1.9 合同费用bug 修复
31
            <el-button size="small" @click="handleReset" style="margin-left:10px">
2e0fd29c   wuxw   开发报修
32
33
34
35
36
37
38
39
              <i class="el-icon-refresh"></i>
              {{ $t('carCreateFee.reset') }}
            </el-button>
          </el-col>
        </el-row>
      </el-card>
  
      <el-card class="box-card" style="margin-top:20px">
d767b5e6   wuxw   v1.9 合同费用bug 修复
40
41
42
43
        <div slot="header" class="flex justify-between">
          <div>{{ $t('carCreateFee.vehicleCharging') }}</div>
          <div>
            <el-button size="small" @click="handleOpenFeeImportExcel">
2e0fd29c   wuxw   开发报修
44
45
46
              <i class="el-icon-plus"></i>
              {{ $t('carCreateFee.customTemplate') }}
            </el-button>
d767b5e6   wuxw   v1.9 合同费用bug 修复
47
            <el-button size="small" @click="handleOpenDoCreateRoomFee" style="margin-left:10px">
2e0fd29c   wuxw   开发报修
48
49
50
              <i class="el-icon-plus"></i>
              {{ $t('carCreateFee.customCreate') }}
            </el-button>
d767b5e6   wuxw   v1.9 合同费用bug 修复
51
            <el-button type="primary" size="small" @click="handleBatchCreate" style="margin-left:10px">
2e0fd29c   wuxw   开发报修
52
53
              {{ $t('carCreateFee.batchCreate') }}
            </el-button>
d767b5e6   wuxw   v1.9 合同费用bug 修复
54
            <el-button type="primary" size="small" @click="handleBuyMonthlyCard" style="margin-left:10px">
2e0fd29c   wuxw   开发报修
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
              {{ $t('carCreateFee.buyMonthlyCard') }}
            </el-button>
          </div>
        </div>
  
        <el-table :data="cars" border style="width:100%">
          <el-table-column prop="carNum" :label="$t('carCreateFee.licensePlate')" align="center" />
          <el-table-column prop="areaNum" :label="$t('carCreateFee.parkingLot')" align="center" />
          <el-table-column prop="num" :label="$t('carCreateFee.parkingSpace')" align="center" />
          <el-table-column prop="ownerName" :label="$t('carCreateFee.ownerName')" align="center" />
          <el-table-column prop="link" :label="$t('carCreateFee.contact')" align="center" />
          <el-table-column prop="stateName" :label="$t('carCreateFee.status')" align="center" />
          <el-table-column :label="$t('carCreateFee.operation')" align="center" width="150">
            <template slot-scope="scope">
              <el-button size="mini" @click="handleViewCharges(scope.row)">
                {{ $t('carCreateFee.viewCharges') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
  
        <el-pagination style="margin-top:20px" :current-page.sync="pagination.current" :page-sizes="[10, 20, 30, 50]"
          :page-size="pagination.size" :total="pagination.total" layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </el-card>
  
      <!-- 子组件 -->
      <car-create-fee-add ref="carCreateFeeAdd" @success="handleSuccess" />
      <export-car-fee-import-excel ref="exportCarFeeImportExcel" />
      <do-import-create-fee ref="doImportCreateFee" />
    </div>
  </template>
  
  <script>
  import { listCarCreateFees } from '@/api/fee/carCreateFeeApi'
  import { getDict } from '@/api/community/communityApi'
  
  export default {
    name: 'CarCreateFeeList',
    components: {
      'car-create-fee-add': () => import('@/components/fee/carCreateFeeAdd'),
      'export-car-fee-import-excel': () => import('@/components/fee/exportCarFeeImportExcel'),
      'do-import-create-fee': () => import('@/components/fee/doImportCreateFee')
    },
    data() {
      return {
        queryParams: {
          allNum: '',
          carNumLike: '',
          ownerName: '',
          state: '',
          carTypeCd: '1001',
          page: 1,
          row: 10
        },
        pagination: {
          current: 1,
          size: 10,
          total: 0
        },
        cars: [],
        states: []
      }
    },
    created() {
      this.getDictData()
      this.fetchData()
    },
    methods: {
      async getDictData() {
        try {
          this.states = await getDict('owner_car', 'state')
        } catch (error) {
          console.error('获取字典数据失败:', error)
        }
      },
      async fetchData() {
        try {
          const res = await listCarCreateFees(this.queryParams)
          this.cars = res.data || []
          this.pagination.total = res.total || 0
        } catch (error) {
          this.$message.error(this.$t('common.fetchError'))
        }
      },
      handleQuery() {
        this.queryParams.page = 1
        this.fetchData()
      },
      handleReset() {
        this.queryParams = {
          allNum: '',
          carNumLike: '',
          ownerName: '',
          state: '',
          carTypeCd: '1001',
          page: 1,
          row: this.queryParams.row
        }
        this.fetchData()
      },
      handleSizeChange(size) {
        this.queryParams.row = size
        this.fetchData()
      },
      handleCurrentChange(current) {
        this.queryParams.page = current
        this.fetchData()
      },
      handleBatchCreate() {
        this.$refs.carCreateFeeAdd.open({ isMore: true })
      },
      handleOpenFeeImportExcel() {
        this.$refs.exportCarFeeImportExcel.open()
      },
      handleOpenDoCreateRoomFee() {
        this.$refs.doImportCreateFee.open()
      },
      handleBuyMonthlyCard() {
        this.$router.push({ path: '/views/fee/buyCarMonthCard' })
      },
      handleViewCharges(row) {
        this.$router.push({
          path: '/views/fee/listCarFee',
          query: {
            carId: row.carId,
            carNum: row.carNum,
            areaNum: row.areaNum,
            num: row.num
          }
        })
      },
      handleSuccess() {
        this.fetchData()
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .car-create-fee-container {
    padding: 20px;
  
    .box-card {
      margin-bottom: 20px;
    }
  
    .clearfix {
      display: flex;
      justify-content: space-between;
      align-items: center;
  
      h5 {
        margin: 0;
        font-size: 16px;
      }
    }
  }
  </style>