95629508
wuxw
继续开发报表功能
|
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size"
layout="total, sizes, prev, pager, next, jumper" :total="page.total" style="margin-top: 20px;" />
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { queryRepair, exportData, listMyEnteredCommunitys } from '@/api/report/reportRepairApi'
import { getDict } from '@/api/community/communityApi'
import { getCommunityId } from '@/api/community/communityApi'
export default {
name: 'ReportRepairList',
data() {
return {
loading: false,
reportRepairInfo: {
repairs: [],
communitys: [],
total: 0,
records: 1,
moreCondition: false,
states: [],
repairUsers: [],
conditions: {
staffId: '',
staffName: '',
state: '',
stateName: '',
amount: '',
beginStartTime: '',
beginEndTime: '',
finishStartTime: '',
finishEndTime: '',
dealNumber: '',
dispatchNumber: '',
transferOrderNumber: '',
chargebackNumber: '',
statementNumber: '',
returnNumber: '',
score: '',
communityId: ''
}
},
page: {
current: 1,
size: 10,
total: 0
}
}
},
created() {
this._initMethod()
},
methods: {
async _initMethod() {
this.reportRepairInfo.conditions.communityId = getCommunityId()
await this._loadStaffCommunitys()
await this._listRepairs(this.page.current, this.page.size)
try {
const states = await getDict('r_repair_user', 'state')
this.reportRepairInfo.states = states
} catch (error) {
console.error('获取字典数据失败:', error)
}
},
validateBeginTime() {
if (this.reportRepairInfo.conditions.beginStartTime && this.reportRepairInfo.conditions.beginEndTime) {
const start = new Date(this.reportRepairInfo.conditions.beginStartTime).getTime()
const end = new Date(this.reportRepairInfo.conditions.beginEndTime).getTime()
if (start > end) {
this.$message.error(this.$t('reportRepair.timeError'))
this.reportRepairInfo.conditions.beginEndTime = ''
}
}
},
validateFinishTime() {
if (this.reportRepairInfo.conditions.finishStartTime && this.reportRepairInfo.conditions.finishEndTime) {
const start = new Date(this.reportRepairInfo.conditions.finishStartTime).getTime()
const end = new Date(this.reportRepairInfo.conditions.finishEndTime).getTime()
if (start > end) {
this.$message.error(this.$t('reportRepair.timeError'))
this.reportRepairInfo.conditions.finishEndTime = ''
}
}
},
async _listRepairs(page, size) {
this.loading = true
try {
const params = {
page,
row: size,
...this.reportRepairInfo.conditions
}
const res = await queryRepair(params)
this.reportRepairInfo.repairs = res.data
this.reportRepairInfo.repairUsers = res.sumTotal
this.reportRepairInfo.conditions.dealNumber = res.rep.dealNumber
this.reportRepairInfo.conditions.dispatchNumber = res.rep.dispatchNumber
this.reportRepairInfo.conditions.transferOrderNumber = res.rep.transferOrderNumber
this.reportRepairInfo.conditions.chargebackNumber = res.rep.chargebackNumber
this.reportRepairInfo.conditions.statementNumber = res.rep.statementNumber
this.reportRepairInfo.conditions.returnNumber = res.rep.returnNumber
|
95629508
wuxw
继续开发报表功能
|
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
} catch (error) {
console.error('查询报修汇总失败:', error)
} finally {
this.loading = false
}
},
_queryMethod() {
this.page.current = 1
this._listRepairs(this.page.current, this.page.size)
},
_resetMethod() {
this.reportRepairInfo.conditions = {
...this.reportRepairInfo.conditions,
staffId: '',
staffName: '',
beginStartTime: '',
beginEndTime: '',
finishStartTime: '',
finishEndTime: '',
state: '',
stateName: ''
}
this._listRepairs(this.page.current, this.page.size)
},
_moreCondition() {
this.reportRepairInfo.moreCondition = !this.reportRepairInfo.moreCondition
},
async _exportFee() {
try {
const params = {
pagePath: 'reportRepairDetail',
...this.reportRepairInfo.conditions
}
const res = await exportData(params )
this.$message.success(res.msg)
if (res.code === 0) {
this.$router.push('/pages/property/downloadTempFile?tab=下载中心')
}
} catch (error) {
console.error('导出失败:', error)
}
},
async _loadStaffCommunitys() {
try {
const params = {
_uid: '123mlkdinkldldijdhuudjdjkkd',
page: 1,
row: 100
}
const res = await listMyEnteredCommunitys(params)
this.reportRepairInfo.communitys = res.communitys
} catch (error) {
console.error('获取小区列表失败:', error)
}
},
_changCommunity() {
this._listRepairs(this.page.current, this.page.size)
},
handleSizeChange(val) {
this.page.size = val
this._listRepairs(this.page.current, this.page.size)
},
handleCurrentChange(val) {
this.page.current = val
this._listRepairs(this.page.current, this.page.size)
}
}
}
</script>
<style lang="scss" scoped>
.report-repair-container {
padding: 20px;
.box-card {
margin-bottom: 20px;
.clearfix {
display: flex;
align-items: center;
justify-content: space-between;
}
|