问题修复

This commit is contained in:
hongchao 2025-08-06 17:49:47 +08:00
parent 1c8528768f
commit 722e5b2109
3 changed files with 88 additions and 11 deletions

View File

@ -576,6 +576,23 @@ export const getSafetyListApi = data => {
})
}
// 安全工器具预警数量展示
export const getSafeNumListApi = data => {
return request({
url: '/material/material_maMachine/getSafeNumList',
method: 'get',
params: data
})
}
// 安全工器具
export const getAgreementIdApi = data => {
return request({
url: '/material/material_maMachine/getAgreementId',
method: 'get',
params: data
})
}
// 班组库存日志-列表
export const getTeamNumListApi = data => {
return request({

View File

@ -178,8 +178,9 @@
<!-- <el-table-column label="租赁价(元)" align="center" prop="buyPrice" :show-overflow-tooltip="true" /> -->
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="操作人" align="center" prop="creator" :show-overflow-tooltip="true" />
<el-table-column label="出库时间" align="center" prop="outTime" :show-overflow-tooltip="true" />
<el-table-column label="出库时间" align="center" prop="outTime" :show-overflow-tooltip="true" width="180" />
<el-table-column label="班组" align="center" prop="teamName" :show-overflow-tooltip="true" />
<el-table-column label="工程名称" align="center" prop="proName" :show-overflow-tooltip="true" width="180"/>
</el-table>
<pagination

View File

@ -35,6 +35,19 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 添加统计行 -->
<el-row type="flex" justify="end" :gutter="3" class="mb8 stat-row">
<el-col :span="3">
<div class="stat-item">已过期数量: <span class="status-expired">{{ expiredCount }}</span></div>
</el-col>
<el-col :span="3">
<div class="stat-item">临期1个月数量: <span class="status-one-month">{{ oneMonthCount }}</span></div>
</el-col>
<el-col :span="3">
<div class="stat-item">临期3个月数量: <span class="status-three-months">{{ threeMonthCount }}</span></div>
</el-col>
</el-row>
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
<el-table-column
type="index"
@ -73,11 +86,10 @@
<script>
import TreeSelect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import QRCodeView from '@/components/QRCodeView'
import { getMachineInfoApi,getSafetyListApi, getLevelListApi } from '@/api/materialsStation'
import {getSafetyListApi,getSafeNumListApi,getAgreementIdApi } from '@/api/materialsStation'
export default {
components: { TreeSelect, QRCodeView },
components: { TreeSelect },
data() {
return {
showSearch: true,
@ -89,11 +101,16 @@ export default {
},
total: 0, //
//
tableList: []
tableList: [],
//
expiredCount: 0,
oneMonthCount: 0,
threeMonthCount: 0
}
},
created() {
this.getList()
this.getSafetyNum()
},
methods: {
getStatusText(status) {
@ -127,25 +144,30 @@ export default {
},
//
handleQuery() {
async handleQuery() {
this.queryParams.pageNum = 1
this.getList()
await this.getList()
await this.getSafetyNum()
},
//
handleReset() {
async handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.$refs.queryForm.resetFields()
this.queryParams.keyWord = ''
this.queryParams.status = ''
this.getList()
await this.getList()
await this.getSafetyNum()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
const loading = this.$loading({ text: '加载中...' })
try {
const params = { ...this.queryParams }
const resTemp = await getAgreementIdApi()
console.log("xxxxxhhhhhhhhhh",resTemp)
const params = { ...this.queryParams,agreementIdList:resTemp.data}
const res = await getSafetyListApi(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows
@ -158,7 +180,23 @@ export default {
loading.close()
}
},
//
async getSafetyNum() {
try {
const resTemp = await getAgreementIdApi()
const params = { ...this.queryParams,agreementIdList:resTemp.data}
const res = await getSafeNumListApi(params)
console.log("yyyyyyy",res.data)
this.expiredCount = res.data.expiredNum
this.oneMonthCount = res.data.oneMonthNum
this.threeMonthCount = res.data.threeMonthNum
console.log("xxxxxxxx",res.data.expiredNum,this.expiredCount)
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
}
},
}
}
</script>
@ -177,4 +215,25 @@ export default {
.status-expired {
color: #909399; //
}
// .stat-item {
// padding: 8px 16px;
// background-color: #f5f7fa;
// border-radius: 4px;
// display: inline-block;
// margin-right: 10px;
// }
.stat-row {
margin-bottom: 10px;
.stat-item {
background: #f5f7fa;
padding: 8px 16px;
border-radius: 4px;
text-align: center;
font-size: 16px;
white-space: nowrap;
}
}
</style>