<template>
|
<div class="main tabs_main" style="height:93%">
|
<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">
|
<el-button :size="size" icon="el-icon-search" v-if="showButton('search')" @click="searchButtonInfo(true)">查询</el-button>
|
</div>
|
</div>
|
<div class="main_content" style="display:flex;flex-wrap:wrap;overflow:auto;">
|
<div class="main_content_index" v-for="(item,index) in staticLists" :key="index">
|
<div class="main_content_top">
|
<div class="main_content_title">
|
<div class="main_text">{{item.proName}}</div>
|
<div class="main_datas">{{item.sizeName}}</div>
|
</div>
|
</div>
|
<div class="main_content_bottom">
|
<div class="content_top">
|
<div style="border:1px solid #39B5FE;background-color:#042548;border-radius:4px">
|
<img src="../../../../assets/wheel.png" class="bottom_left">
|
</div>
|
<div class="bottom_right">
|
<div class="plan_content_items" style="margin-bottom:16px">
|
<div class="plan_content_title">序号</div>
|
<div class="plan_content_datas" style="background-color:#052C55;color:#39B5FE" v-for="(its,indexs) in item.hasDtos" :key="indexs">{{indexs+1}}</div>
|
</div>
|
<div class="plan_content_items" style="margin-bottom:0px;border-bottom:0px solid transparent;">
|
<div class="plan_content_title">管片配筋</div>
|
<div class="plan_content_datas" v-for="(iten,idx) in item.hasDtos" :key="idx" :style="{'background': iten.colors || 'none'}">{{iten.has}}</div>
|
</div>
|
<div class="plan_content_items">
|
<div class="plan_content_title">已成环数(环)</div>
|
<div class="plan_content_datas" v-for="(loop,indexs) in item.hasDtos" :key="indexs">
|
{{showLooping(item.looping,loop)}}
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="content_bottom">
|
<div class="content_bottom_rows">
|
<div class="content_bottom_text">
|
<span style="position:absolute;top:26px;left:10px;">配筋</span>
|
<span style="position:absolute;top:8px;left:65px">块号</span>
|
</div>
|
<div class="content_bottom_datas" v-for="(block,index) in item.blokDtos" :key="index">{{block.blockName}}</div>
|
</div>
|
<div class="content_bottom_rebar">
|
<div style="display: flex; flex-direction: column;">
|
<div class="content_bottom_titles" v-for="(iten,index) in item.hasDtos" :key="index">{{iten.has}}</div>
|
</div>
|
<template v-if="item&&item.info.length !==0">
|
<div style="display: flex; flex-direction: column; flex: 1"
|
v-for="(blockItem,blockIndex) in item.blokDtos"
|
:key="blockIndex">
|
<div
|
class="content_bottom_num"
|
:class="{'bottom_nums':showCounts(item.info, hasItem, blockItem) !== 0}"
|
v-for="(hasItem,hasIndex) in item.hasDtos"
|
:key="hasIndex">
|
{{showCounts(item.info, hasItem, blockItem)}}
|
</div>
|
</div>
|
</template>
|
<div v-else class="content_bottom_nodata" style="border-bottom:1px solid #39B5FE;">暂无数据</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</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,
|
search:{},//查询条件
|
total: 0,
|
loading: false,
|
staticLists: [], //成环统计信息列表
|
optionsSize:[],//尺寸
|
optionsProject:[],//项目名称
|
numLists: [],//已成环数
|
nums:[],//配筋块号对应数量
|
}
|
},
|
mounted() {
|
const that = this;
|
// 根据窗口大小动态修改组件尺寸
|
window.onresize = () => {
|
that.size = changeSize();
|
}
|
// that.searchButtonInfo(true);
|
// that.getAllProjects()
|
},
|
methods: {
|
//获得所有项目名称
|
getAllProjects(){
|
this.$api.Engineer.getAllProjects({}).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.optionsProject = res.data
|
}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(val ===""){
|
this.optionsSize = []
|
this.$set(this.search,'sizeId','')
|
}else{
|
this.optionsSize = res.data.list
|
}
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
},
|
async getBlockData(proId) {
|
const { data } = await this.$api.Reinforce.searchProjectBears({
|
proId: proId
|
})
|
return data
|
},
|
async getLoopData(item) {
|
const { data } = await this.$api.Reinforce.searchRing({
|
proId:item.proId,sizeId:item.sizeId
|
})
|
return data;
|
},
|
// 查询按钮列表信息
|
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.searchProjectSize(params).then((res) => {
|
if(res.statusMsg === 'ok') {
|
this.total = res.data.total;
|
this.staticLists = res.data.list.map((item) => {
|
this.getBlockData(item.proId).then((data) => {
|
this.$set(item, 'blokDtos', data.blokDtos || []);
|
this.$set(item, 'hasDtos', data.hasDtos || []);
|
})
|
this.getLoopData(item).then((data) => {
|
this.$set(item, 'info', data.info || []);
|
this.$set(item, 'looping', data.looping || []);
|
})
|
return item;
|
});
|
}
|
this.loading = false;
|
})
|
},
|
showLooping(loopData,hasItem){
|
if(loopData){
|
const dataList = loopData.filter(item =>item.reinforcementId === hasItem.hasSteel)
|
if(dataList &&dataList[0]){
|
return dataList[0].counts
|
}else{
|
return 0
|
}
|
}else{
|
return 0
|
}
|
},
|
//
|
showCounts(infoData, hasItem, blockItem) {
|
if(infoData) {
|
infoData = infoData.flat(Infinity);
|
const dataList = infoData.filter(item =>
|
item.reinforcementId === hasItem.hasSteel && item.blockNum === blockItem.blockNum
|
)
|
if(dataList && dataList[0]) {
|
return dataList[0].inventory
|
} else {
|
return 0;
|
}
|
}
|
},
|
// 判断按钮权限信息
|
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';
|
.main_content_index{
|
min-width: calc(50% - 16px);
|
height: 500px;
|
margin: 5px 16px 16px 0px;
|
.main_content_top{
|
height: 40px;
|
background-color: rgba(57,181,254,0.3);
|
border-top-left-radius: 6px;
|
border-top-right-radius: 6px;
|
|
.main_content_title{
|
height: 40px;
|
margin-left: 24px;
|
display: flex;
|
align-items: center;
|
flex-direction: row;
|
position: relative;
|
&::before{
|
width: 4px;
|
height: 20px;
|
content: '';
|
position: absolute;
|
left: -13px;
|
top: 10px;
|
background-color: #39B5FE;
|
}
|
.main_text{
|
color: #39B5FE;
|
font-size: 16px;
|
font-weight: 500;
|
}
|
.main_datas{
|
margin-left: 30px;
|
color: #39B5FE;
|
font-size: 16px;
|
font-weight: 500;
|
}
|
}
|
}
|
.main_content_bottom{
|
border-bottom-left-radius: 6px;
|
border-bottom-right-radius: 6px;
|
height: calc(100% - 50px);
|
background-color: #02163C;
|
padding: 20px;
|
overflow: auto;
|
|
.content_top{
|
display: flex;
|
height: 145px;
|
.bottom_left{
|
width: 100%;
|
height: 100%;
|
margin-left: -7px;
|
cursor: pointer;
|
&:hover{
|
animation: rotate 3s linear infinite;
|
}
|
@keyframes rotate {
|
0% {
|
transform: rotateY(0deg);
|
}
|
100% {
|
transform: rotateY(360deg);
|
}
|
}
|
}
|
.bottom_right{
|
width: 100%;
|
min-width: 400px;
|
|
.plan_content_items{
|
display: flex;
|
border: 1px solid #39B5FE;
|
margin: 0px 0px 8px 15px;
|
|
.plan_content_title{
|
width: 145px;
|
padding: 12px 0px;
|
flex: none;
|
color: #39B5FE;
|
text-align: center;
|
background-color: #052C55;
|
}
|
.plan_content_datas{
|
flex: 1;
|
padding: 12px 0px;
|
color: #fff;
|
text-align: center;
|
border-left: 1px solid #39B5FE;
|
}
|
}
|
}
|
}
|
.content_bottom{
|
width: 100%;
|
height: calc(100% - 145px);
|
margin-top: 10px;
|
border-bottom: 1px solid #063B5B;
|
|
.content_bottom_rows{
|
display: flex;
|
text-align: center;
|
height: 50px;
|
border: 1px solid #09607A;
|
margin-bottom: 15px;
|
.content_bottom_text{
|
span{
|
color: #39B5FE;
|
}
|
flex: none;
|
color: #fff;
|
position: relative;
|
width: 100px;
|
height: 50px;
|
background: linear-gradient(to top right,#085A76,#032249);
|
&::before{
|
content: '';
|
width: 110%;
|
height: 2px;
|
background: linear-gradient(to bottom right,#085A76,#032249);
|
position: absolute;
|
top: 22px;
|
left: -6px;
|
transform: rotateZ(26deg);
|
}
|
}
|
.content_bottom_datas{
|
display: flex;
|
flex: 1;
|
align-items: center;
|
justify-content: center;
|
color: #39B5FE;
|
border-left: 1px solid #09607A;
|
background: linear-gradient(to bottom,#032048,#09607A);
|
// cursor: pointer;
|
}
|
}
|
.content_bottom_rebar{
|
display: flex;
|
text-align: center;
|
height: calc(100% - 65px);
|
border-top: 1px solid #39B5FE;
|
border-left: 1px solid #39B5FE;
|
border-right: 1px solid #39B5FE;
|
|
.content_bottom_nodata{
|
border-left: 1px solid #39B5FE;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex: 1;
|
color: #fff;
|
}
|
.content_bottom_titles{
|
color: #39B5FE;
|
width: 100px;
|
flex: 1;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border-bottom: 1px solid #39B5FE;
|
&:last-child{
|
border-bottom-color: #39B5FE;
|
}
|
}
|
.content_bottom_num{
|
border-left: 1px solid #39B5FE;
|
display: flex;
|
flex: 1;
|
align-items: center;
|
justify-content: center;
|
color: #fff;
|
border-bottom: 1px solid #39B5FE;
|
&:last-child{
|
border-bottom-color: #39B5FE;
|
}
|
}
|
.bottom_nums{
|
background-color: #014C6E;
|
color: #39B5FE;
|
}
|
}
|
}
|
}
|
}
|
//滚动条样式
|
::-webkit-scrollbar {
|
width: 4px;
|
height: 8px;
|
}
|
::-webkit-scrollbar-thumb {
|
border-radius: 10px;
|
box-shadow: inset 0 0 5px #084E6B;
|
background: rgba(0,0,0,0.2);
|
}
|
::-webkit-scrollbar-track {
|
box-shadow: inset 0 0 5px transparent;
|
border-radius: 0;
|
background: transparent;
|
}
|
</style>
|