保有量查询增加筛选条件

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

@ -87,7 +87,7 @@ export function getOutRecordListApi(query) {
params: query
})
}
// 在库详情查询
export function getStorageInfoListApi(query) {
@ -120,7 +120,7 @@ export function getOutRecordListApi(query) {
method: 'get',
params: query
})
}
}
// 修饰待入库详情查询
export function getRepairInputListApi(query) {
return request({
@ -156,7 +156,7 @@ export function getOutRecordListApi(query) {
params: query
})
}
// 获取电子标签下拉框
export function getSelectionList(query) {
return request({
@ -165,7 +165,7 @@ export function getOutRecordListApi(query) {
params: query
})
}
// 获取一级设备类型下拉框
export function getOptionListApi(query) {
return request({
@ -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,22 +9,98 @@
style="width: 240px"
/>
</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 prop="typeModelName">
<el-input
v-model="queryParams.typeModelName"
placeholder="请输入规格型号"
clearable :maxlength="20"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="施工类型" prop="lineTypes">
<el-select
v-model="queryParams.lineTypes"
placeholder="请选择施工类型"
multiple
collapse-tags
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 label="物资类型" prop="materialType">
<el-select
v-model="queryParams.materialType"
placeholder="请选择物资类型"
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-button
type="primary"
@ -178,6 +254,7 @@
<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>
<pagination
v-show="total > 0"
@ -580,9 +657,19 @@
// } from '@/api/stquery/deviceStatusRecord'
// import {getRecords} from "@/api/claimAndRefund/secondStore";
import {
getRetainedEquipmentListApi, getRetainedEquipmentListNoPageApi,getStorageInfoListApi,getUserRecordListApi,getRepairRecordListApi,
getPurchaseRecordListApi,getRepairInputListApi,getToScrapInputListApi,getAuditInputListApi,
getRetainedEquipmentListApi,
getRetainedEquipmentListNoPageApi,
getStorageInfoListApi,
getUserRecordListApi,
getRepairRecordListApi,
getPurchaseRecordListApi,
getRepairInputListApi,
getToScrapInputListApi,
getAuditInputListApi,
getLintTypeList, getMaterialTypeList,
} from '@/api/stquery/stquery';
import {getListProject} from "@/api/materialsStation";
import {getDeviceType} from "@/api/ma/device";
export default {
name: 'DeviceStatusRecord',
dicts: [],
@ -610,9 +697,15 @@ export default {
pageSize: 10,
keyWord: null,
typeName: null, //
typeModelName: null //
typeModelName: null, //
lineTypes: [], //线
materialType: null,
jiJuType:null
},
lineTypeOptions: [], // 线
materialTypeOptions: [], //
typeNameOptions:[],
typeModelNameOptions:[],
//
openRecord: false,
dialogList: [], //
@ -683,17 +776,24 @@ export default {
}
},
created() {
this.getList()
},
created() {
this.getList()
//线
this.getLintTypeList()
this.getMaterialTypeList()
this.getDeviceType()
},
methods: {
//
async getList() {
this.loading = true
const params = {
keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
typeNameId: this.queryParams.typeName,
typeModelNameId: this.queryParams.typeModelName,
constructionTypes:this.queryParams.lineTypes,
materialTypeId:this.queryParams.materialType,
jiJuType:this.queryParams.jiJuType,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum
}
@ -706,9 +806,12 @@ export default {
this.total = res.data.total;
console.log(this.tableList)
let param = {
keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
keyWord: this.queryParams.keyWord,
typeNameId: this.queryParams.typeName,
typeModelNameId: this.queryParams.typeModelName,
constructionTypes:this.queryParams.lineTypes,
materialTypeId:this.queryParams.materialType,
jiJuType:this.queryParams.jiJuType
}
const response = await getRetainedEquipmentListNoPageApi(param)
let obj = {
@ -733,6 +836,120 @@ export default {
console.log(this.tableList)
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) {
let number = (num - 1) * size
console.log(number)