<template>
|
<div class="main">
|
<div class="main_header">
|
<div class="header_item">
|
<el-button class="search_btn" v-if="showButton('insert')" icon="el-icon-plus" @click="propInsert()">新增</el-button>
|
</div>
|
</div>
|
<div class="main_content cistern_content" v-loading="loading" style="margin: 30px 10px 0px;overflow:auto">
|
<div
|
class="cistern_item"
|
v-for="item in dataLists"
|
:key="item.id">
|
<div class="cistern_item_image" @click="yardClick(item)">
|
<img src="../../assets/yard_icon.png" width="100%" height="100%">
|
</div>
|
<div class="yard_item_btn">
|
<div class="yarn_item_title">{{item.repoName}}</div>
|
<div >
|
<el-button @click="updataInfo(item)" class="table_btn" size="mini" icon="el-icon-edit-outline" v-if="showButton('update')">
|
<span >修改</span>
|
</el-button>
|
<el-button @click="deleteInfo(item)" class="delete_btn" size="mini" icon="el-icon-delete" style="margin-lft:20px" v-if="showButton('delete')">
|
<span >删除</span>
|
</el-button>
|
</div>
|
</div>
|
<div class="yard_item_lines"></div>
|
<div class="cistern_item_content">
|
<div class="yarn_item_right">
|
<div class="yard_item_top">
|
<div style="color:#C2CAD6;">单元数(个)</div>
|
<div style="color:#39B5FE;font-size:28px;padding-top:5px">{{item.unitCount}}</div>
|
</div>
|
<div class="yard_item_nums">
|
<div class="yard_item_nums_titles">总环数(环)</div>
|
<div class="yard_item_nums_datas">{{item.ringCount}}</div>
|
</div>
|
</div>
|
<div class="yarn_item_right">
|
<div class="yard_item_nums">
|
<div class="yard_item_nums_titles">管片数(块)</div>
|
<div class="yard_item_nums_datas">{{item.pipeCount}}</div>
|
</div>
|
<div class="yard_item_nums">
|
<div class="yard_item_nums_titles">龄期(块)</div>
|
<div class="yard_item_nums_datas">{{item.timeCount}}</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<el-dialog
|
class="prop_dialog"
|
:title="asyncTitle ? '新增堆场信息' : '修改堆场信息'"
|
:visible.sync="asyncCistern"
|
width="35%">
|
<el-form ref="form" :model="formYard" :rules="rulesYard" label-width="auto" class="rule_form">
|
<el-form-item label="堆场名称:" prop="repoName">
|
<el-input v-model="formYard.repoName" clearable placeholder="请输入堆场名称"></el-input>
|
</el-form-item>
|
<el-form-item label="最大容量:" prop="maxSize">
|
<el-input v-model="formYard.maxSize" clearable placeholder="请输入最大容量"></el-input>
|
</el-form-item>
|
<el-form-item label="存放类型:" prop="saveType">
|
<el-select v-model="formYard.saveType" clearable placeholder="请选择存放类型">
|
<el-option
|
v-for="item in optionSaves"
|
:key="item.repoTypeId"
|
:label="item.repoTypeName"
|
:value="item.repoTypeId">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="龄期(天):" prop="saveTime">
|
<el-input v-model="formYard.saveTime" clearable placeholder="请输入龄期"></el-input>
|
</el-form-item>
|
<div style="position:relative;margin-top:65px;">
|
<el-button class="search_btn" v-if="showButton('insert')" icon="el-icon-plus" style="position:absolute;top:-40px;right:0px;" @click="addSaveUnits()">新增</el-button>
|
<el-table
|
v-loading="loadingForm"
|
:data="storeList"
|
height="250"
|
style="margin-top:50px">
|
<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 label="存放单元名称" align="center">
|
<template #default="{row}">
|
<el-input
|
v-model="row.unitName"
|
:size="size"
|
placeholder="请输入单元名称">
|
</el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center">
|
<template #default="{ row }">
|
<el-button class="delete_btn" size="mini" v-if="showButton('delete')" @click="deleteStore(row)">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</el-form>
|
<div slot="footer">
|
<el-button @click="asyncCistern = false">取 消</el-button>
|
<el-button @click="asyncTitle ? submitInsertForm() :submitUpdateForm()">确 定</el-button>
|
</div>
|
</el-dialog>
|
<!-- 详情弹框 -->
|
<el-dialog
|
class="prop_dialog line_prop"
|
title="详情"
|
:close-on-click-modal="false"
|
:visible.sync="detailsVisible"
|
width="70%">
|
<div class="detail_index">
|
<div class="detail_title">管片入库</div>
|
<div class="detail_content">
|
<div class="detail_header_item">
|
<div class="detail_header_titles">环号:</div>
|
<el-input v-model="search.ringNum" :size="size" clearable placeholder="请输入环号"></el-input>
|
</div>
|
<div class="detail_header_item">
|
<div class="detail_header_titles">单元名称:</div>
|
<el-select v-model="search.unitId" placeholder="请选择单元名称" clearable>
|
<el-option
|
v-for="item in optionsUnit"
|
:key="item.unitId"
|
:label="item.unitName"
|
:value="item.unitId">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="detail_header_item">
|
<div class="detail_header_titles">块号:</div>
|
<el-select v-model="search.blockNum" placeholder="请选择块号" clearable>
|
<el-option
|
v-for="item in optionsBlocks"
|
:key="item.dictId"
|
:label="item.dictName"
|
:value="item.dictId">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="detail_header_item">
|
<div class="detail_header_titles">配筋:</div>
|
<el-select v-model="search.reinforcement" placeholder="请选择配筋" clearable>
|
<el-option
|
v-for="item in optionsHass"
|
:key="item.dictId"
|
:label="item.dictName"
|
:value="item.dictId">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="detail_header_item">
|
<div class="detail_header_titles">注浆孔:</div>
|
<el-select v-model="search.groutingHoles" placeholder="请选择注浆孔" clearable>
|
<el-option
|
v-for="item in optionsGrout"
|
:key="item.dictId"
|
:label="item.dictName"
|
:value="item.dictId">
|
</el-option>
|
</el-select>
|
</div>
|
<div class="detail_header_item">
|
<div class="detail_header_titles">是否龄期:</div>
|
<el-select v-model="search.timeOut" placeholder="请选择是否龄期" clearable>
|
<el-option label="是" value="1"></el-option>
|
<el-option label="否" value="2"></el-option>
|
</el-select>
|
</div>
|
<div class="detail_header_item">
|
<div class="detail_header_titles">入库时间:</div>
|
<el-date-picker
|
v-model="search.time"
|
clearable
|
type="datetimerange"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
:default-time="['00:00:00','23:59:59']"
|
range-separator="-"
|
start-placeholder="起始时间"
|
end-placeholder="结束时间">
|
</el-date-picker>
|
</div>
|
<div class="detail_header_item">
|
<el-button :size="size" icon="el-icon-search" v-if="showButton('search')" @click="searchButtonInfo(true,repoId)">查询</el-button>
|
</div>
|
</div>
|
<div class="detail_content_mains">
|
<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="repoName" label="堆场名称" align="center" ></el-table-column>
|
<el-table-column prop="unitName" label="单元名称" align="center" ></el-table-column>
|
<el-table-column prop="pipeNum" label="管片编号" align="center" width="150" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="ringNum" label="环号" align="center" ></el-table-column>
|
<el-table-column prop="proName" label="项目名称" align="center" width="130"></el-table-column>
|
<el-table-column prop="turnName" label="转向" align="center" ></el-table-column>
|
<el-table-column prop="sizeName" label="尺寸" align="center" ></el-table-column>
|
<el-table-column prop="blockNumName" label="块号" align="center" ></el-table-column>
|
<el-table-column prop="reinforcementName" label="配筋" align="center" ></el-table-column>
|
<el-table-column prop="groutingHolesName" label="注浆孔" align="center"></el-table-column>
|
<el-table-column prop="createTime" label="管片入库时间" align="center" width="150"></el-table-column>
|
<el-table-column prop="timeOut" label="是否龄期" align="center">
|
<template #default="{row}">
|
<div>{{row.timeOut ==='0'?'否':'是'}}</div>
|
</template>
|
</el-table-column>
|
<el-table-column prop="outRepoTime" label="管片出库时间" align="center" width="150"></el-table-column>
|
</el-table>
|
</div>
|
<div class="main_footer" style="margin:0">
|
<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>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { buttonPinia } from '../../pinia';
|
import { throttle,changeSize } from '../../plugins/public';
|
export default {
|
data() {
|
return {
|
size: changeSize(), // 组件尺寸
|
total: 0,
|
pageNum: 1,
|
pageSize: 10,
|
loading: false,
|
loadingForm:false,
|
repoId:"",//详情id
|
dataLists: [], // 堆场管理信息
|
storeList:[],//存放单元
|
asyncTitle: true, // true 新增堆场 false 修改堆场信息
|
asyncCistern: false,
|
detailsVisible:false,//详情弹框
|
search:{},//筛选条件
|
dataList:[],//弹框详情tables
|
formYard: {}, // 表单信息
|
rulesYard: {
|
repoName: [{
|
required: true,
|
message: '请输入堆场名称',
|
trigger: 'blur'
|
}],
|
maxSize: [{
|
required: true,
|
message: '请输入最大容量',
|
trigger: 'blur'
|
}],
|
saveType: [{
|
required: true,
|
message: '请选择存放类型',
|
trigger: ['blur', 'change']
|
}],
|
saveTime: [{
|
required: true,
|
message: '请输入龄期',
|
trigger: 'blur'
|
}],
|
}, // 表单校验信息
|
optionSaves: [], // 存放类型信息
|
optionsUnit:[],//单元名称
|
optionsBlocks:[],//块号
|
optionsHass:[],//配筋
|
optionsGrout:[],//注浆孔
|
}
|
},
|
mounted() {
|
this.searchCisternList();
|
this.getYarnType()
|
this.getAllTypes()
|
// this.getUnitLists()
|
},
|
methods: {
|
//获取单元下拉框
|
// getUnitLists(){
|
// this.$api.DuctpiecePLM.getUnitYardList({}).then(res=>{
|
// if(res.statusMsg ==='ok'){
|
// this.optionsUnit = res.data
|
// }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.optionsGrout = res.data.list.filter(item =>item.dictType === '4')
|
this.optionsHass = 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,val){
|
if(bol) {
|
this.pageNum = 1;
|
}
|
let params = Object.assign({},this.search,{
|
pageNum: this.pageNum,
|
pageSize: this.pageSize,
|
repoId:val
|
})
|
params.startTime = this.search.time&&this.search.time[0]
|
params.endTime = this.search.time&&this.search.time[1]
|
delete params.time
|
this.loading = true;
|
this.$api.DuctpiecePLM.detailsYardInfo(params).then((res) => {
|
if(res.statusMsg === 'ok') {
|
this.total = res.data.total;
|
this.dataList = res.data.list;
|
}
|
this.loading = false;
|
})
|
},
|
// 切换页数
|
changePageNum(page) {
|
this.pageNum = page;
|
this.searchButtonInfo();
|
},
|
// 切换每页条数
|
changePageSize(size) {
|
this.pageSize = size;
|
this.searchButtonInfo();
|
},
|
//点击查看详情
|
yardClick(row){
|
this.repoId = row.repoId
|
this.detailsVisible = true
|
this.searchButtonInfo(true,row.repoId)
|
this.$api.DuctpiecePLM.cellYardInfo({repoId:row.repoId}).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.optionsUnit = res.data.repoUnitList
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
},
|
//获取堆场类型
|
getYarnType(){
|
this.$api.DuctpiecePLM.yardTypeList({}).then(res=>{
|
if(res.statusMsg ==='ok'){
|
this.optionSaves = res.data
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
},
|
//弹框中的添加按钮
|
addSaveUnits(){
|
this.storeList.push({})
|
},
|
//弹框中的删除按钮
|
deleteStore(item){
|
let storeId = item.unitId
|
this.storeList.splice(this.storeList.findIndex(itm => itm.unitId === storeId),1)
|
if(this.asyncTitle ===false){
|
this.$api.DuctpiecePLM.deleteUnitYard({unitId:item.unitId}).then(res=>{
|
if(res.statusMsg !=='ok'){
|
this.$message.success(res.statusMsg)
|
}else{
|
this.$message.success('删除成功!')
|
}
|
})
|
}
|
},
|
// 查询堆场信息
|
searchCisternList() {
|
this.loading = true;
|
this.dataLists = [];
|
this.$api.DuctpiecePLM.searchYardInfo({
|
pageNum: 1,
|
pageSize: 100000
|
}).then((res) => {
|
if(res.success) {
|
this.total = res.data.total;
|
this.dataLists = res.data.list
|
}
|
this.loading = false;
|
}).catch(() => {
|
this.loading = false;
|
});
|
},
|
// 打开添加信息
|
propInsert() {
|
this.asyncTitle = true;
|
this.asyncCistern = true;
|
this.storeList = []
|
},
|
// 打开修改信息
|
updataInfo(row) {
|
this.asyncTitle = false;
|
this.asyncCistern = true;
|
this.$api.DuctpiecePLM.cellYardInfo({repoId:row.repoId}).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.formYard = res.data.repo
|
this.storeList = res.data.repoUnitList
|
}else{
|
this.$message.warning(res.statusMsg)
|
}
|
})
|
},
|
// 删除堆场信息
|
deleteInfo(row) {
|
this.$confirm("该操作将删除该信息,是否继续删除?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
this.$api.DuctpiecePLM.deleteYardInfo({repoId: row.repoId})
|
.then(res => {
|
if(res.statusMsg === 'ok') {
|
this.searchCisternList(true);
|
this.$message.success("删除成功!");
|
} else {
|
this.$message.warning(res.statusMsg);
|
}
|
})
|
})
|
.catch(() => {
|
this.$message.warning("您已取消");
|
})
|
},
|
// 提交添加信息
|
submitInsertForm: throttle(function() {
|
this.$refs.form.validate((valid) => {
|
if(valid) {
|
const params = Object.assign({}, this.formYard);
|
params.repoUnitList = this.storeList
|
this.$api.DuctpiecePLM.insertYardInfo(params).then((res) => {
|
if(res.success) {
|
this.asyncCistern = false;
|
this.searchCisternList();
|
this.$message.success('添加成功!');
|
} else {
|
this.$message.warning(res.statusMsg);
|
}
|
})
|
}
|
})
|
}, 3000),
|
// 提交修改信息
|
submitUpdateForm: throttle(function() {
|
this.$refs.form.validate((valid) => {
|
if(valid) {
|
const params = Object.assign({}, this.formYard);
|
params.repoUnitList = this.storeList
|
this.$api.DuctpiecePLM.updateYardInfo(params).then((res) => {
|
if(res.success) {
|
this.asyncCistern = false;
|
this.searchCisternList();
|
this.$message.success('修改成功!');
|
} else {
|
this.$message.warning(res.statusMsg);
|
}
|
})
|
}
|
})
|
}, 3000),
|
// 判断按钮权限信息
|
showButton(str) {
|
const pinia = buttonPinia();
|
return pinia.$state.buttonInfo.includes(str);
|
}
|
},
|
watch: {
|
asyncCistern(bol) {
|
if(!bol) {
|
this.formYard = {};
|
this.$refs.form.resetFields();
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '@/style/layout-main.scss';
|
|
.main_header {
|
justify-content: flex-end;
|
}
|
|
.cistern_content {
|
display: flex;
|
flex-wrap: wrap;
|
align-content: flex-start;
|
flex: 1;
|
|
.cistern_item {
|
display: flex;
|
align-items: center;
|
cursor: pointer;
|
padding: 38px 20px 20px 30px;
|
margin: 10px;
|
margin-top: 0;
|
width: calc((100% + 140px) / 3.5);
|
height: calc((100% - 263px) / 2);
|
border-top-left-radius: 6px;
|
border-top-right-radius: 6px;
|
border-bottom-left-radius: 6px;
|
border-bottom-right-radius: 6px;
|
background-color: #031A46;
|
// margin: 30px 20px 5px 5px;
|
box-shadow:0px 0px 8px 0px #0C4F79;
|
// background: url('../../assets/yard_bg.png')no-repeat;
|
// background-size: 100% 100%;
|
position: relative;
|
|
.cistern_item_image {
|
// width: 180px;
|
// height: 140px;
|
padding-top: 20px;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.yard_item_btn{
|
width: 100%;
|
line-height: 48px;
|
padding: 0px 24px;
|
position: absolute;
|
top: 0px;
|
left: 0px;
|
display: flex;
|
justify-content: space-between;
|
border-top-left-radius: 6px;
|
border-top-right-radius: 6px;
|
background-color: rgba(57,181,254,0.3);
|
|
.yarn_item_title{
|
color: #39B5FE;
|
font-size: 20px;
|
}
|
}
|
.yard_item_lines{
|
width: 2px;
|
height: 60%;
|
position: absolute;
|
top: 77px;
|
left: 190px;
|
background-color:rgba(57,181,254,0.3) ;
|
}
|
.cistern_item_content {
|
width: calc(100% - 285px);
|
position: absolute;
|
top: 59px;
|
right: 50px;
|
color: #fff;
|
|
.yarn_item_right{
|
width: calc((50% + 266px) / 1.7);
|
height: 80px;
|
display: flex;
|
justify-content: space-between;
|
margin-top: 20px;
|
.yard_item_top{
|
height: 100px;
|
align-items: center;
|
flex-direction:row;
|
}
|
.yard_item_nums{
|
margin: 0px 10px;
|
.yard_item_nums_titles{
|
color: #E1E5EB;
|
}
|
.yard_item_nums_datas{
|
padding-top: 5px;
|
font-size: 28px;
|
color: #39B5FE;
|
}
|
}
|
|
}
|
|
|
.yard_item_bottom{
|
height: calc(100% - 100px);
|
display: flex;
|
|
|
}
|
}
|
}
|
.line{
|
&::before{
|
background-color: #0F95AC;
|
}
|
}
|
}
|
.line_prop{
|
/deep/.el-dialog__body{
|
padding: 20px 0px 0px 0px;
|
}
|
}
|
.detail_index{
|
width: 100%;
|
.detail_title{
|
color: #39B5FE;
|
width: 100%;
|
height: 30px;
|
position: relative;
|
padding-left: 28px;
|
border-bottom:1px solid #1949A3 ;
|
padding-bottom: 30px;
|
&::before{
|
content: "";
|
width: 80px;
|
height: 2px;
|
background-color: #39B5FE;
|
position: absolute;
|
left: 18px;
|
top: 28px;
|
}
|
}
|
.detail_content{
|
width: 100%;
|
// height: 134px;
|
display: flex;
|
padding: 20px 10px;
|
font-size: 1rem;
|
flex-wrap: wrap;
|
|
.detail_header_item{
|
display: flex;
|
align-items: center;
|
margin-right: 10px;
|
margin-top: 15px;
|
|
.detail_header_titles{
|
color: #EAEAEA;
|
white-space: nowrap;
|
text-align: right;
|
}
|
}
|
}
|
.detail_content_mains{
|
width: 100%;
|
// height: calc(100% - 164px);
|
height: 400px;
|
padding-bottom: 15px;
|
}
|
}
|
</style>
|