<template>
|
<div class="main">
|
<div class="main_header">
|
<div class="header_item">
|
<span class="header_label">项目名称:</span>
|
<el-select v-model="search.proId" placeholder="请选择项目名称" clearable @change="changeSizes">
|
<el-option
|
v-for="item in optionsProject"
|
:key="item.proId"
|
:label="item.proName"
|
:value="item.proId">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="header_item">
|
<span class="header_label">尺寸:</span>
|
<el-select v-model="search.sizeId" placeholder="请选择尺寸" clearable>
|
<el-option
|
v-for="item in optionsSize"
|
:key="item.sizeId"
|
:label="item.sizeName"
|
:value="item.sizeId">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="header_item">
|
<span class="header_label">配筋:</span>
|
<el-select v-model="search.reinforcementId" placeholder="请选择配筋" clearable>
|
<el-option
|
v-for="item in optionsReins"
|
:key="item.hasSteel"
|
:label="item.has"
|
:value="item.hasSteel">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="header_item">
|
<span class="header_label">块号:</span>
|
<el-select v-model="search.blockId" placeholder="请选择块号" clearable>
|
<el-option
|
v-for="item in optionsBlocks"
|
:key="item.blockNum"
|
:label="item.blockName"
|
:value="item.blockNum">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="header_item">
|
<el-button :size="size" icon="el-icon-search" v-if="showButton('search')" @click="searchButtonInfo(true)">查询</el-button>
|
</div>
|
</div>
|
<div class="main_content">
|
<el-table
|
v-loading="loading"
|
:data="dataList"
|
height="100%">
|
<el-table-column align="center" label="序号" width="60">
|
<template #default="scope">
|
<span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column prop="proName" label="项目名称" align="center" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="sizeName" label="尺寸" align="center" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="reinforcementName" label="配筋" align="center"></el-table-column>
|
<el-table-column prop="blockNumName" label="块号" align="center"></el-table-column>
|
<el-table-column prop="stock" label="库存数量" align="center"></el-table-column>
|
</el-table>
|
</div>
|
<div class="main_footer">
|
<el-pagination
|
background
|
@current-change="changePageNum"
|
@size-change="changePageSize"
|
:current-page="pageNum"
|
:page-sizes="[10, 20, 50, 100]"
|
:page-size="pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="total">
|
</el-pagination>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { buttonPinia } from '../../pinia/index';
|
import { changeSize } from '../../plugins/public'; // 导入节流、动态切换组件尺寸方法
|
export default {
|
data() {
|
return {
|
size: changeSize(), // 组件尺寸
|
pageNum: 1,
|
pageSize: 10,
|
timer:null,//定时器
|
search:{},//查询条件
|
total: 0,
|
loading: false,
|
dataList: [], //钢筋笼库存信息列表
|
optionsReins:[],//配筋
|
optionsBlocks:[],//块号
|
optionsSize:[],//尺寸
|
optionsProject:[],//项目名称
|
}
|
},
|
mounted() {
|
const that = this;
|
// 根据窗口大小动态修改组件尺寸
|
window.onresize = () => {
|
that.size = changeSize();
|
}
|
that.searchButtonInfo(true);
|
that.timer = setInterval(()=>{
|
that.searchButtonInfo(true);
|
},30000)
|
// that.getAllTypes()
|
that.getAllProjects()
|
},
|
beforeDestroy() {
|
clearInterval(this.timer);
|
this.timer = null;
|
},
|
methods: {
|
//获得所有项目名称
|
getAllProjects(){
|
let obj = {
|
pageNum: 1,
|
pageSize: 100000000
|
}
|
this.$api.Engineer.searchProjects(obj).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.optionsProject = res.data.list
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
},
|
//通过选择项目选择尺寸
|
changeSizes(val){
|
this.$api.Reinforce.searchProjectSize({proId:val,pageNum: 1,
|
pageSize:100000000}).then(res=>{
|
if(res.statusMsg === 'ok'){
|
if(this.search.proId ===""){
|
this.optionsSize = []
|
}else{
|
this.optionsSize = res.data.list
|
}
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
this.$api.Reinforce.searchProjectBears({proId:val,pageNum: 1,
|
pageSize:1000000}).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.optionsReins = res.data.hasDtos
|
this.optionsBlocks = res.data.blokDtos
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
|
},
|
// //获取尺寸配筋转向等信息
|
// getAllTypes(){
|
// let params = {
|
// pageNum: 1,
|
// pageSize: 100000000
|
// }
|
// this.$api.Dictionary.searchDictionary(params).then(res=>{
|
// if(res.statusMsg === 'ok'){
|
// this.optionsSize = res.data.list.filter(item =>item.dictType === '1')
|
// this.optionsReins = res.data.list.filter(item =>item.dictType === '2')
|
// this.optionsBlocks = res.data.list.filter(item =>item.dictType === '5')
|
// }else{
|
// this.$message.warning(res.statusMsg)
|
// }
|
// })
|
// },
|
// 查询按钮列表信息
|
searchButtonInfo(bol) {
|
if(bol) {
|
this.pageNum = 1;
|
}
|
let params = Object.assign({},this.search,{
|
pageNum: this.pageNum,
|
pageSize: this.pageSize
|
})
|
this.loading = true;
|
this.$api.Reinforce.searchInventory(params).then((res) => {
|
if(res.statusMsg === 'ok') {
|
this.total = res.data.total;
|
this.dataList = res.data.list;
|
}
|
this.loading = false;
|
})
|
},
|
// 判断按钮权限信息
|
showButton(str) {
|
const pinia = buttonPinia();
|
return pinia.$state.buttonInfo.includes(str);
|
},
|
// 切换页数
|
changePageNum(page) {
|
this.pageNum = page;
|
this.searchButtonInfo();
|
},
|
// 切换每页条数
|
changePageSize(size) {
|
this.pageSize = size;
|
this.searchButtonInfo();
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '../../style/layout-main.scss';
|
</style>
|