修试平衡表

This commit is contained in:
bb_pan 2025-03-26 16:04:04 +08:00
parent 541bd8c192
commit 2ecbe09cfd
2 changed files with 44 additions and 45 deletions

View File

@ -6,14 +6,14 @@
</div> </div>
<div class="f-count">{{ state.count }}</div> <div class="f-count">{{ state.count }}</div>
<div class="f-14"> <div class="f-14">
<span v-if="state.isReduce"> <span v-if="!state.isIncrease">
较上月降低 较上月降低
<span style="color: red">{{ state.num || 0 }}</span> <span style="color: red">{{ state.increase || 0 }}</span>
% %
</span> </span>
<span v-else>较上月增长 {{ state.num || 0 }} %</span> <span v-else>较上月增长 {{ state.increase || 0 }} %</span>
<svg-icon v-if="state.isReduce" icon-class="down_arrow" /> <svg-icon v-if="!state.isIncrease" icon-class="down_arrow" />
<svg-icon v-else icon-class="up_arrow" /> <svg-icon v-else icon-class="up_arrow" />
</div> </div>
</div> </div>

View File

@ -82,6 +82,7 @@
<script> <script>
import { getRepairHomeTotalListApi, getRepairHomeListApi } from '@/api/home/maintain-balance' import { getRepairHomeTotalListApi, getRepairHomeListApi } from '@/api/home/maintain-balance'
import CardModel from './components/card-model' // import CardModel from './components/card-model' //
export default { export default {
components: { components: {
CardModel CardModel
@ -105,41 +106,41 @@ export default {
title: '总接收量', title: '总接收量',
theme: '#5ad55a', theme: '#5ad55a',
icon: 'In_the_library', icon: 'In_the_library',
isReduce: false, isIncrease: true,
num: '19.5', increase: 0,
count: 185483 count: 0
}, },
{ {
title: '已修数量', title: '已修数量',
theme: '#0099ff', theme: '#0099ff',
icon: 'In_use', icon: 'In_use',
isReduce: true, isIncrease: true,
num: '15.5', increase: 0,
count: 473892 count: 0
}, },
{ {
title: '在修数量', title: '在修数量',
theme: '#8167f5', theme: '#8167f5',
icon: 'In_repair', icon: 'In_repair',
isReduce: false, isIncrease: true,
num: '10.5', increase: 0,
count: 293874 count: 0
}, },
{ {
title: '报废数量', title: '报废数量',
theme: '#bfbf00', theme: '#bfbf00',
icon: 'scrapped', icon: 'scrapped',
isReduce: true, isIncrease: true,
num: '16.5', increase: 0,
count: 842390 count: 0
}, },
{ {
title: '试验数量', title: '试验数量',
theme: '#b8741a', theme: '#b8741a',
icon: 'repair_store', icon: 'repair_store',
isReduce: true, isIncrease: true,
num: '10.5', increase: 0,
count: 184324 count: 0
} }
], ],
pickerOptions: { pickerOptions: {
@ -167,7 +168,6 @@ export default {
}, },
created() { created() {
this.queryDate = this.getDefaultDateRange() this.queryDate = this.getDefaultDateRange()
this.getAllNum()
this.getList() this.getList()
}, },
methods: { methods: {
@ -179,43 +179,47 @@ export default {
this.queryParams.startTime = '' this.queryParams.startTime = ''
this.queryParams.endTime = '' this.queryParams.endTime = ''
} }
const loading = this.$loading({ text: '加载中...' })
// console.log('🚀 ~ getList ~ this.queryParams:', this.queryParams) // console.log('🚀 ~ getList ~ this.queryParams:', this.queryParams)
try { try {
const res = await getRepairHomeListApi(this.queryParams) const res = await getRepairHomeListApi(this.queryParams)
// console.log('🚀 ~ getList ~ res:', res) // console.log('🚀 ~ getList ~ res:', res)
this.tableList = res.data.rows this.tableList = res.data.rows
this.total = res.data.total this.total = res.data.total
const res2 = await getRepairHomeTotalListApi(this.queryParams)
if (res2.code === 200 && res2.data) {
res2.data.forEach((item, index) => {
this.cardList_2[index].increase = item.increase
this.cardList_2[index].isIncrease = item.isIncrease
if (index === 0) {
this.cardList_2[0].count = item.backNum
} else if (index === 1) {
this.cardList_2[1].count = item.repairedNum
} else if (index === 2) {
this.cardList_2[2].count = item.repairingNum
} else if (index === 3) {
this.cardList_2[3].count = item.scrapNum
} else if (index === 4) {
this.cardList_2[4].count = item.testNum
}
})
}
loading.close()
} catch (error) { } catch (error) {
console.log('🚀 ~ getList ~ error:', error) console.log('🚀 ~ getList ~ error:', error)
} loading.close()
},
async getAllNum() {
if (this.queryDate) {
this.queryParams.startTime = this.queryDate[0]
this.queryParams.endTime = this.queryDate[1]
} else {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
try {
const res = await getRepairHomeTotalListApi(this.queryParams)
// console.log('🚀 ~ getAllNum ~ res:', res)
} catch (error) {
console.log('🚀 ~ getAllNum ~ error:', error)
} }
}, },
// //
onHandleSearch() { onHandleSearch() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
this.getAllNum()
}, },
// //
onHandleReset() { onHandleReset() {
this.queryDate = this.getDefaultDateRange() this.queryDate = this.getDefaultDateRange()
this.$refs.queryFormRef.resetFields() this.$refs.queryFormRef.resetFields()
this.getList() this.getList()
this.getAllNum()
}, },
// //
getDefaultDateRange() { getDefaultDateRange() {
@ -243,11 +247,6 @@ export default {
}, },
// //
handleExport() { handleExport() {
//
this.$message({
type: 'warning',
message: '导出功能尚开发中,敬请期待!'
})
if (this.queryDate) { if (this.queryDate) {
this.queryParams.startTime = this.queryDate[0] this.queryParams.startTime = this.queryDate[0]
this.queryParams.endTime = this.queryDate[1] this.queryParams.endTime = this.queryDate[1]
@ -256,11 +255,11 @@ export default {
this.queryParams.endTime = '' this.queryParams.endTime = ''
} }
try { try {
let fileName = `数据_${new Date().getTime()}.xLsx` let fileName = `修试平衡表_${new Date().getTime()}.xLsx`
let url = '' let url = '/material/repair_audit_details/exportRepairHomeList'
const params = { ...this.queryParams } const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params) console.log('🚀 ~ 导出 ~ params:', params)
// this.download(url, params, fileName) this.download(url, params, fileName)
} catch (error) { } catch (error) {
console.log('导出数据失败', error) console.log('导出数据失败', error)
} }