保有量查询增加筛选条件

This commit is contained in:
hayu 2025-11-05 10:59:46 +08:00
parent 2c18753063
commit 30250b7570
2 changed files with 267 additions and 32 deletions

View File

@ -202,6 +202,24 @@ export function getPartUsingListApi(query) {
}) })
} }
//线路类型下拉
export function getLintTypeList(data = {}) {
return request({
url: '/material/select/getLintTypeList',
method: 'post',
data
})
}
//物资类型下拉
export function getMaterialTypeList(data = {}) {
return request({
url: '/material/select/getMaterialTypeList',
method: 'post',
data
})
}

View File

@ -9,21 +9,97 @@
style="width: 240px" style="width: 240px"
/> />
</el-form-item> </el-form-item>
<el-form-item prop="typeName"> <el-form-item label="施工类型" prop="lineTypes">
<el-input <el-select
v-model="queryParams.typeName" v-model="queryParams.lineTypes"
placeholder="请输入物资名称" placeholder="请选择施工类型"
clearable :maxlength="20" multiple
collapse-tags
style="width: 240px" style="width: 240px"
clearable
@change="handleLineTypeChange"
>
<el-option
v-for="item in lineTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item prop="typeModelName"> <el-form-item label="物资类型" prop="materialType">
<el-input <el-select
v-model="queryParams.typeModelName" v-model="queryParams.materialType"
placeholder="请输入规格型号" placeholder="请选择物资类型"
clearable :maxlength="20"
style="width: 240px" style="width: 240px"
clearable
@change="handleMaterialTypeChange"
>
<el-option
v-for="item in materialTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/> />
</el-select>
</el-form-item>
<!-- <el-form-item prop="typeName">-->
<!-- <el-input-->
<!-- v-model="queryParams.typeName"-->
<!-- placeholder="请输入物资名称"-->
<!-- clearable :maxlength="20"-->
<!-- style="width: 240px"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="物资名称" prop="typeName">
<el-select
v-model="queryParams.typeName"
placeholder="请选择物资名称"
style="width: 240px"
clearable
@change="handleTypeNameChange"
>
<el-option
v-for="item in typeNameOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item prop="typeModelName">-->
<!-- <el-input-->
<!-- v-model="queryParams.typeModelName"-->
<!-- placeholder="请输入规格型号"-->
<!-- clearable :maxlength="20"-->
<!-- style="width: 240px"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="规格型号" prop="typeModelName">
<el-select
v-model="queryParams.typeModelName"
placeholder="请选择规格型号"
style="width: 240px"
clearable
>
<el-option
v-for="item in typeModelNameOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="机具类型" prop="jiJuType">
<el-select
v-model="queryParams.jiJuType"
placeholder="请选择机具类型"
clearable
style="width: 240px"
>
<el-option label="施工机具" :value="1" />
<el-option label="安全工器具" :value="2" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
@ -178,6 +254,7 @@
<el-table-column label="管理模式" align="center" prop="manageType" :show-overflow-tooltip="true"/> <el-table-column label="管理模式" align="center" prop="manageType" :show-overflow-tooltip="true"/>
<el-table-column label="机具类型" align="center" prop="jiJuType" :show-overflow-tooltip="true"/>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
@ -580,9 +657,19 @@
// } from '@/api/stquery/deviceStatusRecord' // } from '@/api/stquery/deviceStatusRecord'
// import {getRecords} from "@/api/claimAndRefund/secondStore"; // import {getRecords} from "@/api/claimAndRefund/secondStore";
import { import {
getRetainedEquipmentListApi, getRetainedEquipmentListNoPageApi,getStorageInfoListApi,getUserRecordListApi,getRepairRecordListApi, getRetainedEquipmentListApi,
getPurchaseRecordListApi,getRepairInputListApi,getToScrapInputListApi,getAuditInputListApi, getRetainedEquipmentListNoPageApi,
getStorageInfoListApi,
getUserRecordListApi,
getRepairRecordListApi,
getPurchaseRecordListApi,
getRepairInputListApi,
getToScrapInputListApi,
getAuditInputListApi,
getLintTypeList, getMaterialTypeList,
} from '@/api/stquery/stquery'; } from '@/api/stquery/stquery';
import {getListProject} from "@/api/materialsStation";
import {getDeviceType} from "@/api/ma/device";
export default { export default {
name: 'DeviceStatusRecord', name: 'DeviceStatusRecord',
dicts: [], dicts: [],
@ -610,9 +697,15 @@ export default {
pageSize: 10, pageSize: 10,
keyWord: null, keyWord: null,
typeName: null, // typeName: null, //
typeModelName: null // typeModelName: null, //
lineTypes: [], //线
materialType: null,
jiJuType:null
}, },
lineTypeOptions: [], // 线
materialTypeOptions: [], //
typeNameOptions:[],
typeModelNameOptions:[],
// //
openRecord: false, openRecord: false,
dialogList: [], // dialogList: [], //
@ -685,6 +778,10 @@ export default {
}, },
created() { created() {
this.getList() this.getList()
//线
this.getLintTypeList()
this.getMaterialTypeList()
this.getDeviceType()
}, },
methods: { methods: {
// //
@ -692,8 +789,11 @@ export default {
this.loading = true this.loading = true
const params = { const params = {
keyWord: this.queryParams.keyWord, keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName, typeNameId: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName, typeModelNameId: this.queryParams.typeModelName,
constructionTypes:this.queryParams.lineTypes,
materialTypeId:this.queryParams.materialType,
jiJuType:this.queryParams.jiJuType,
pageSize: this.queryParams.pageSize, pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum pageNum: this.queryParams.pageNum
} }
@ -707,8 +807,11 @@ export default {
console.log(this.tableList) console.log(this.tableList)
let param = { let param = {
keyWord: this.queryParams.keyWord, keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName, typeNameId: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName, typeModelNameId: this.queryParams.typeModelName,
constructionTypes:this.queryParams.lineTypes,
materialTypeId:this.queryParams.materialType,
jiJuType:this.queryParams.jiJuType
} }
const response = await getRetainedEquipmentListNoPageApi(param) const response = await getRetainedEquipmentListNoPageApi(param)
let obj = { let obj = {
@ -733,6 +836,120 @@ export default {
console.log(this.tableList) console.log(this.tableList)
this.loading = false this.loading = false
}, },
async getLintTypeList() {
try {
const res = await getLintTypeList()
if (res.code === 200 && res.data) {
//
this.lineTypeOptions = res.data.map(item => {
//
return {
value: item.typeId,
label: item.typeName
}
})
} else {
this.$message.error('获取施工类型下拉失败')
this.lineTypeOptions = [] //
}
} catch (error) {
console.error('获取施工类型下拉列表失败:', error)
this.$message.error('获取施工类型下拉列表失败')
this.lineTypeOptions = [] //
}
},
// 线
async handleLineTypeChange(selectedLineTypes) {
//
this.queryParams.materialType = null
this.materialTypeOptions=[]
this.queryParams.typeName=null
this.typeNameOptions=[]
this.queryParams.typeModelName=null
this.typeModelNameOptions=[]
if (!selectedLineTypes || selectedLineTypes.length === 0) {
this.materialTypeOptions = []
}
//
await this.getMaterialTypeList(selectedLineTypes)
},
async getMaterialTypeList(lineTypes) {
const params = {
constructionType:lineTypes
}
try {
//
const res = await getMaterialTypeList(params)
if (res.code === 200 && res.data) {
//
const materialTypes = res.data.map(item => ({
value: item.typeId,
label: item.typeName
}))
//
this.materialTypeOptions = materialTypes
} else {
this.$message.error('获取物资类型失败')
this.materialTypeOptions = []
}
} catch (error) {
console.error('获取物资类型列表失败:', error)
this.$message.error('获取物资类型列表失败')
this.materialTypeOptions = []
}
},
async handleMaterialTypeChange(e){
this.queryParams.typeName=null
this.typeNameOptions=[]
this.queryParams.typeModelName=null
this.typeModelNameOptions=[]
getDeviceType({ level: 3, typeId:e }).then(response => {
let matNameRes = response.data
this.typeNameOptions = matNameRes.map((item) => {
return {
label: item.typeName,
value: item.typeId
}
})
})
},
async handleTypeNameChange(e){
this.queryParams.typeModelName=null
this.typeModelNameOptions=[]
getDeviceType({ level: 4, typeId:e }).then(response => {
let matNameRes = response.data
this.typeModelNameOptions = matNameRes.map((item) => {
return {
label: item.typeName,
value: item.typeId
}
})
})
},
getDeviceType() {
getDeviceType({ level: 3 }).then(response => {
let matNameRes = response.data
this.typeNameOptions = matNameRes.map((item) => {
return {
label: item.typeName,
value: item.typeId
}
})
})
getDeviceType({ level: 4 }).then(response => {
let matModelRes = response.data
this.typeModelNameOptions = matModelRes.map((item) => {
return {
label: item.typeName,
value: item.typeId
}
})
})
},
indexContinuationForTable(num, size) { indexContinuationForTable(num, size) {
let number = (num - 1) * size let number = (num - 1) * size
console.log(number) console.log(number)