保有量查询增加筛选条件
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,22 +9,98 @@
|
||||||
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
|
||||||
style="width: 240px"
|
collapse-tags
|
||||||
/>
|
style="width: 240px"
|
||||||
</el-form-item>
|
clearable
|
||||||
<el-form-item prop="typeModelName">
|
@change="handleLineTypeChange"
|
||||||
<el-input
|
>
|
||||||
v-model="queryParams.typeModelName"
|
<el-option
|
||||||
placeholder="请输入规格型号"
|
v-for="item in lineTypeOptions"
|
||||||
clearable :maxlength="20"
|
:key="item.value"
|
||||||
style="width: 240px"
|
:label="item.label"
|
||||||
/>
|
:value="item.value"
|
||||||
</el-form-item>
|
/>
|
||||||
|
</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-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
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="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: [], //在库编码设备列表
|
||||||
|
|
@ -683,17 +776,24 @@ export default {
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
//线路类型下拉
|
||||||
|
this.getLintTypeList()
|
||||||
|
this.getMaterialTypeList()
|
||||||
|
this.getDeviceType()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取列表
|
// 获取列表
|
||||||
async getList() {
|
async getList() {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
@ -706,9 +806,12 @@ export default {
|
||||||
this.total = res.data.total;
|
this.total = res.data.total;
|
||||||
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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue