保有量查询增加筛选条件
This commit is contained in:
parent
2c18753063
commit
30250b7570
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,21 +9,97 @@
|
|||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="typeName">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入物资名称"
|
||||
clearable :maxlength="20"
|
||||
<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 prop="typeModelName">
|
||||
<el-input
|
||||
v-model="queryParams.typeModelName"
|
||||
placeholder="请输入规格型号"
|
||||
clearable :maxlength="20"
|
||||
<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
|
||||
|
|
@ -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: [], //在库编码设备列表
|
||||
|
|
@ -685,6 +778,10 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList()
|
||||
//线路类型下拉
|
||||
this.getLintTypeList()
|
||||
this.getMaterialTypeList()
|
||||
this.getDeviceType()
|
||||
},
|
||||
methods: {
|
||||
// 获取列表
|
||||
|
|
@ -692,8 +789,11 @@ export default {
|
|||
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
|
||||
}
|
||||
|
|
@ -707,8 +807,11 @@ export default {
|
|||
console.log(this.tableList)
|
||||
let param = {
|
||||
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
|
||||
}
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue