修试平衡表

This commit is contained in:
bb_pan 2025-03-26 14:48:20 +08:00
parent 1a9253c6a4
commit 541bd8c192
3 changed files with 57 additions and 14 deletions

View File

@ -0,0 +1,19 @@
import request from '@/utils/request';
// 总计数量
export const getRepairHomeTotalListApi = params => {
return request({
url: '/material/repair_audit_details/getRepairHomeTotalList',
method: 'get',
params
});
};
// 列表
export const getRepairHomeListApi = params => {
return request({
url: '/material/repair_audit_details/getRepairHomeList',
method: 'get',
params
});
};

View File

@ -8,7 +8,7 @@
<div class="f-14">
<span v-if="state.isReduce">
较上月降低
<span style="color: #f56c6c">{{ state.num || 0 }}</span>
<span style="color: red">{{ state.num || 0 }}</span>
%
</span>
<span v-else>较上月增长 {{ state.num || 0 }} %</span>

View File

@ -63,6 +63,7 @@
:key="index"
:label="column.label"
:prop="column.prop"
:width="column.width"
align="center"
></el-table-column>
</el-table>
@ -79,6 +80,7 @@
</template>
<script>
import { getRepairHomeTotalListApi, getRepairHomeListApi } from '@/api/home/maintain-balance'
import CardModel from './components/card-model' //
export default {
components: {
@ -146,25 +148,27 @@ export default {
return time.getTime() > Date.now()
}
},
tableList: [{ name: 'name' }],
tableList: [],
tableColumns: [
{ label: '类型名称', prop: 'typeName' },
{ label: '规格型号', prop: '' },
{ label: '维修单号', prop: 'code' },
{ label: '规格型号', prop: 'typeModelName' },
{ label: '维修单号', prop: 'repairCode', width: '150' },
{ label: '单位', prop: 'unitName' },
{ label: '总接收数量', prop: 'preNum' },
{ label: '已修数量', prop: 'num' },
{ label: '在修数量', prop: '' },
{ label: '报废数量', prop: '' },
{ label: '试验数量', prop: '' },
{ label: '更换配件量', prop: '' },
{ label: '收费配件金额(元)', prop: '' },
{ label: '不收费配件金额(元)', prop: '' }
{ label: '总接收数量', prop: 'backNum' },
{ label: '已修数量', prop: 'repairedNum' },
{ label: '在修数量', prop: 'repairingNum' },
{ label: '报废数量', prop: 'scrapNum' },
{ label: '试验数量', prop: 'testNum' },
{ label: '更换配件量', prop: 'changePartNum' },
{ label: '收费配件金额(元)', prop: 'amountPartPrice' },
{ label: '不收费配件金额(元)', prop: 'noAmountPartPrice' }
]
}
},
created() {
this.queryDate = this.getDefaultDateRange()
this.getAllNum()
this.getList()
},
methods: {
async getList() {
@ -175,23 +179,43 @@ export default {
this.queryParams.startTime = ''
this.queryParams.endTime = ''
}
console.log('🚀 ~ getList ~ this.queryParams:', this.queryParams)
// console.log('🚀 ~ getList ~ this.queryParams:', this.queryParams)
try {
// const res = await (this.queryParams)
const res = await getRepairHomeListApi(this.queryParams)
// console.log('🚀 ~ getList ~ res:', res)
this.tableList = res.data.rows
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
}
},
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() {
this.queryParams.pageNum = 1
this.getList()
this.getAllNum()
},
//
onHandleReset() {
this.queryDate = this.getDefaultDateRange()
this.$refs.queryFormRef.resetFields()
this.getList()
this.getAllNum()
},
//
getDefaultDateRange() {