582 lines
28 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="buildingPlan">
<div class="left whiteBlock">
<div class="title">
{{$t('message.projectInfo.buildList')}}
<!-- 楼栋列表 -->
</div>
<vue-scroll style="height: 87%">
<div style="margin-left: 5%;margin-bottom: 10px;font-size: 16px;">
<!-- 请选择标段: -->
{{$t('message.projectInfo.pleaseChooseSection')+':'}}
</div>
<el-select style="margin-left: 5%;margin-bottom:20px;width: 90%" @change="changeAlarmType" v-model="alarmType" class="alarmTypeBox">
<el-option v-for="(item,index) in ProgressPlanBidSectionList" :key="index" :value="item.id" :label="item.projectfName"></el-option>
</el-select>
<el-menu
:default-active="String(checkedId)"
class="el-menu-vertical-demo whiteBlock"
>
<!-- <el-menu-item
index="0"
class="el-menu-item"
:class="checkedId == 0 ? 'checked_item' : ''"
@click="selectMenu(0)"
>
<span slot="title">全部塔吊(位置配置)</span>
</el-menu-item> -->
<div style="width: 260px" v-if="buildingList.length > 0">
<el-menu-item
:index="String(item.id)"
class="el-menu-item"
:class="checkBuildingId == index ? 'checked_item' : ''"
v-for="(item, index) in buildingList"
@click="selectMenu(index,item.id)"
:key="index"
>
<span @mouseenter="moveShow = index" @mouseleave="moveShow = ''" slot="title" class="flex3">
<span class="title_index">{{ index + 1 }}</span>
<span :title="item.buildingName" class="title_name">{{ item.buildingName }}</span>
<!-- <i v-if="moveShow === index" class="el-icon-edit-outline" style="color: #F56C6C;font-size: 14px;width: 15px" @click="editBuilding(item.id,index)"></i>-->
<!-- <i v-if="moveShow === index" class="el-icon-delete" style="color: #F56C6C;font-size: 14px;width: 15px" @click="deleteBuilding(item.id)"></i>-->
</span>
</el-menu-item>
</div>
<img style="margin: 40px;" v-else src="@/assets/images/noData2.png"/>
</el-menu>
</vue-scroll>
<div class="flex2 btn_pack">
<el-button size="small" type="primary" @click="newTowerBtn">
<i class="el-icon-plus" style="margin-right: 6px"></i>新增楼栋
</el-button>
</div>
<el-dialog
class="dialog"
:title="dialogTitle"
:modal-append-to-body="false"
:visible.sync="dialogVisible"
@close="closeDialog"
destroy-on-close
width="50%"
>
<div class="dialog-content">
<vue-scroll>
<el-form
ref="form"
:model="dialogdata"
:rules="rules"
label-width="135px"
size="medium"
class="dialogFormBox">
<!-- 批次建筑面积 -->
<el-form-item :label="$t('message.projectInfo.batchCoveredArea')" prop="batchBuildArea" required>
<!-- 请输入 -->
<el-input
v-model="dialogdata.batchBuildArea"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 组团编码 -->
<el-form-item :label="$t('message.projectInfo.groupCoding')" prop="batchCode" required>
<el-input
v-model="dialogdata.batchCode"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 组团名称 -->
<el-form-item :label="$t('message.projectInfo.groupName')" prop="batchName" required>
<el-input
v-model="dialogdata.batchName"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 供应批次 -->
<el-form-item :label="$t('message.projectInfo.supplyBatch')" prop="batchNum" required>
<el-input
v-model="dialogdata.batchNum"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 批次供应套数 -->
<el-form-item :label="$t('message.projectInfo.supplyBatchNum')" prop="batchRoomNum" required>
<el-input
v-model="dialogdata.batchRoomNum"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 批次供应面积(M2) -->
<el-form-item :label="$t('message.projectInfo.supplyBatchArea')" prop="batchSaleArea" required>
<el-input
v-model="dialogdata.batchSaleArea"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 楼栋编码 -->
<el-form-item :label="$t('message.projectInfo.buildingCodes')" prop="buildingCode" required>
<el-input
v-model="dialogdata.buildingCode"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 楼栋名称 -->
<el-form-item :label="$t('message.projectInfo.nameOfTheBuilding')" prop="buildingName" required>
<el-input
v-model="dialogdata.buildingName"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 产品类型装修类型 -->
<el-form-item :label="$t('message.projectInfo.productTypedecorationType')" prop="decorateName" required>
<el-input
v-model="dialogdata.decorateName"
:laceholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 产品类型名称 -->
<el-form-item :label="$t('message.projectInfo.productTypeName')" prop="productTypeName" required>
<el-input
v-model="dialogdata.productTypeName"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 产品类型编码 -->
<el-form-item :label="$t('message.projectInfo.productTypeCode')" prop="productTypeNum" required>
<el-input
v-model="dialogdata.productTypeNum"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 可售车位个数() -->
<el-form-item :label="$t('message.projectInfo.numberOfAvailableParkingSpaces')" prop="salePark">
<el-input
v-model="dialogdata.salePark"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 经营方式 -->
<el-form-item :label="$t('message.projectInfo.modeOfBusiness')" prop="saleType">
<el-select v-model="dialogdata.saleType" :disabled="formType == 3" placeholder="请选择">
<el-option
v-for="(item,index) in options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- 总建筑面积 -->
<el-form-item :label="$t('message.projectInfo.overallFloorage')" prop="totalBuildArea">
<el-input
v-model="dialogdata.totalBuildArea"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 总套数 -->
<el-form-item :label="$t('message.projectInfo.theTotalNumber')" prop="totalRoomNum">
<el-input
v-model="dialogdata.totalRoomNum"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
<!-- 总可售面积 -->
<el-form-item :label="$t('message.projectInfo.totalSaleableArea')" prop="totalSaleArea">
<el-input
v-model="dialogdata.totalSaleArea"
:placeholder="$t('message.projectInfo.placeholder')"
:disabled="formType == 3"
></el-input>
</el-form-item>
</el-form>
</vue-scroll>
</div>
<div class="dialog-btn" v-if="formType != 3">
<el-button type="primary" @click="submitForm">
<!-- 确定 -->
{{$t('message.energyManage.material.confirm')}}
</el-button>
<el-button @click="closeDialog">
<!-- 取消 -->
{{$t('message.energyManage.material.cancel')}}
</el-button>
</div>
</el-dialog>
</div>
<div class="right">
<div class="inner">
<div style="margin-top: 5px;margin-bottom: 10px;width: 45%;position: absolute;left: 450px;top:20px" class="dotBox">
<p class="text"><i style="background: #44D7B6;width: 12px;height: 12px;border-radius: 0px" class="dot"></i><span>
<!-- 任务完成 -->
{{$t('message.projectInfo.completionOfTask')}}
</span></p>
<p class="text"><i style="background: #F7D300;width: 12px;height: 12px;border-radius: 0px" class="dot"></i><span>
<!-- 提前完成 -->
{{$t('message.projectInfo.fulfilAheadOfSchedule')}}
</span></p>
<p class="text"><i style="background: #FE6C7F;width: 12px;height: 12px;border-radius: 0px" class="dot"></i><span>
<!-- 逾期完成 -->
{{$t('message.projectInfo.withinTheTimeLimitToComplete')}}
</span></p>
<p class="text"><i style="background: #3D6DC3;width: 12px;height: 12px;border-radius: 0px" class="dot"></i><span>
<!-- 计划完成时间 -->
{{$t('message.projectInfo.planCompleteTime')}}
</span></p>
<p class="text"><i style="background: #FF0000;width: 12px;height: 12px;border-radius: 0px" class="dot"></i><span>
<!-- 逾期 -->
{{$t('message.projectInfo.overdue')}}
</span></p>
</div>
<iframe :src="'doc/ExtGantt/Ext甘特图2.html?url='+baseURL+'&projectSn='+projectSn+'&buildingId='+buildingId+'&token='+$store.state.userInfo.token" id="iframe" class="Extgantt" ></iframe>
</div>
</div>
</div>
</template>
<script>
import {
progressBuildingPlanListApi,//查询楼栋计划列表
addBuildingPlanApi,//增加楼栋计划
editBuildingPlanApi,//修改增加楼栋计划
checkBuildingPlanApi,//通过id查询进度-楼栋计划信息
deleteBuildingPlanApi//通过id删除楼栋计划信息
} from "@/assets/js/api/buildingPlan.js";
import {
selectProgressPlanBidSectionListApi
} from "@/assets/js/api/dataBoard.js"
export default {
data(){
return{
alarmType:'',
ProgressPlanBidSectionList:'',
dialogTitle:/* '添加计划', */this.$t('message.projectInfo.addPlan'),
formType: 1, //1.新增 2.编辑
dialogVisible: false,
buildingList:[],
options:this.$t('message.projectInfo.options'),
checkBuildingId: 0,
moveShow: '',
checkedId: 1,
baseURL: '',
projectSn: '',
buildingId:'',//楼栋计划ID
dialogdata:{
"batchBuildArea": "",//批次建筑面积
"batchCode": "",//组团编码
"batchName": "",//组团名称
"batchNum": "",//供应批次
"batchRoomNum": "",//批次供应套数
"batchSaleArea": "",//批次供应面积M2
"buildingCode": "",//楼栋编码
"buildingName": "",//楼栋名称
"decorateName": "",//产品类型装修类型
"productTypeName": "",//产品类型名称
"productTypeNum": "",//产品类型编码
"projectSn": "",//项目SN
"salePark": "",//可售车位个数(个)
"saleType": "",//经营方式(可售、可租、不可租售)
"totalBuildArea": "",//总建筑面积M2
"totalRoomNum": "",//总套数
"totalSaleArea": ""//总可售面积M2
},
rules:{
batchBuildArea: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.batchCoveredArea')},
batchCode: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.groupCoding')},
batchName: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.groupName')},
batchRoomNum:{required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.supplyBatchNum')},
batchNum: {type: 'string', required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.supplyBatch')},
batchSaleArea: {type: 'string', required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.supplyBatchArea')},
buildingCode: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.buildingCodes')},
buildingName: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.nameOfTheBuilding')},
decorateName: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.productTypedecorationType')},
productTypeName: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.productTypeName')},
productTypeNum: { required: true, message: this.$t('message.projectInfo.placeholder')+this.$t('message.projectInfo.productTypeCode')},
// salePark: { required: true, message: '请输入可售车位个数'},
// saleType: { required: true, message: '请选择经营方式'},
// totalBuildArea: { required: true, message: '请输入总建筑面积'},
// totalRoomNum:{ required: true, message: '请输入总套数'},
// totalSaleArea: { required: true, message: '请输入总可售面积'}
},
}
},
created(){
this.selectProgressPlanBidSectionList()
this.baseURL = this.$http.defaults.baseURL;
this.projectSn = this.$store.state.projectSn;
},
methods:{
selectProgressPlanBidSectionList(){
selectProgressPlanBidSectionListApi({projectSn: this.$store.state.projectSn}).then( res => {
this.ProgressPlanBidSectionList = res.result
this.alarmType = res.result[0].id
this.progressBuildingPlanList()
this.selectMenu(0)
console.log(res.result);//projectfName
})
},
changeAlarmType(){
this.progressBuildingPlanList()
this.selectMenu(0)
},
selectMenu(val,id) {
console.log(id);
console.log(val)
this.buildingId = id
this.checkBuildingId = val
if(document.querySelector('iframe')){
document.querySelector('iframe').contentWindow.location.reload();
}
},
progressBuildingPlanList(){
progressBuildingPlanListApi({ projectSn:this.$store.state.projectSn,bidSectionId:this.alarmType}).then(res=>{
if(res.code == 200){
this.buildingList = res.result
this.buildingId = res.result[0].id
console.log(res.result);
}
})
},
submitForm(){
this.$refs['form'].validate((valid) => {
console.log(valid)
if(valid){
let data = this.dialogdata
data.projectSn = this.projectSn
data.bidSectionId = this.alarmType
// console.log('新增的参数',data)
if(this.formType == 1){
addBuildingPlanApi(data).then(res=>{
// console.log('新增之后的结果',res)
if(res.code == 200){
this.$message.success(this.$t('message.projectInfo.addSuccess')+'!')
this.progressBuildingPlanList()
this.closeDialog()
this.selectMenu(this.buildingList.length)
}
})
} else if(this.formType == 2){
editBuildingPlanApi(data).then(res=>{
console.log(res)
if(res.code == 200){
this.$message.success(this.$t('message.projectInfo.editSuccess')+'!')
this.progressBuildingPlanList()
this.closeDialog()
}
})
}
}
})
},
closeDialog(){
this.dialogVisible = false
this.dialogdata = {}
this.dialogdata = {
"batchBuildArea": "",//批次建筑面积
"batchCode": "",//组团编码
"batchName": "",//组团名称
"batchNum": "",//供应批次
"batchRoomNum": "",//批次供应套数
"batchSaleArea": "",//批次供应面积M2
"buildingCode": "",//楼栋编码
"buildingName": "",//楼栋名称
"decorateName": "",//产品类型装修类型
"productTypeName": "",//产品类型名称
"productTypeNum": "",//产品类型编码
"projectSn": "",//项目SN
"salePark": "",//可售车位个数(个)
"saleType": "",//经营方式(可售、可租、不可租售)
"totalBuildArea": "",//总建筑面积M2
"totalRoomNum": "",//总套数
"totalSaleArea": ""//总可售面积M2
}
},
deleteBuilding(id){
this.$confirm(this.$t('message.projectInfo.confirmTipText')+'?', this.$t('message.projectInfo.tip'), {
confirmButtonText: this.$t('message.energyManage.material.confirm'),
cancelButtonText: this.$t('message.energyManage.material.cancel'),
type: 'warning'
}).then(() => {
deleteBuildingPlanApi({
id:id
}).then(res=>{
console.log(res)
if(res.code == 200){
this.$message({
type: 'success',
message: this.$t('message.projectInfo.deleteSuccess')+'!'
});
this.progressBuildingPlanList()
this.selectMenu(0)
}
})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('message.projectInfo.cancelDelete')
});
});
},
editBuilding(id,index){
this.dialogVisible = true
this.dialogTitle = /* '编辑计划' */this.$t('message.projectInfo.editPlan')
this.formType = 2
this.checkBuildingId = index
checkBuildingPlanApi({
id:id
}).then(res=>{
console.log(res)
if(res.code == 200){
this.dialogdata = res.result
}
})
},
newTowerBtn(){
this.dialogVisible = true
this.dialogTitle = /* '添加计划' */this.$t('message.projectInfo.addPlan')
this.formType = 1
}
}
}
</script>
<style lang="less" scoped>
.dotBox{
display: flex;
justify-content: space-between;
.text{
display: flex;
align-items: center;
.dot{
display: inline-block;
width: 5px;
height: 5px;
border-radius: 50%;
margin-right: 5px;
}
}
}
.dialog-btn{
display: flex;
justify-content: space-around;
align-items: center;
}
.dialog-content{
/*height: 360px;*/
margin-bottom: 60px;
}
.dialogFormBox{
width: 100%;
padding: 0 30px;
box-sizing: border-box;
/deep/.el-form-item{
display: inline-block;
width: 50%;
.el-select{
width: 260px !important;
}
.el-date-picker{
width: 260px !important;
}
.el-cascader{
width: 260px !important;
}
.el-input{
width: 260px !important;
}
}
}
.buildingPlan{
display: flex;
height: 100%;
// background: #fff;
.left {
height: 100%;
width: 260px;
margin-right: 15px;
font-size: 15px;
.title {
height: 41px;
line-height: 41px;
box-sizing: border-box;
padding: 0 22px;
margin-bottom: 0;
// color: #282e49;
// border-bottom: 2px #ebf0fc solid;
font-weight: 600;
}
.title_index {
display: inline-block;
width: 30px;
text-align: center;
background: #ec7e2e;
height: 20px;
line-height: 20px;
font-size: 14px;
margin-right: 10px;
border-radius: 25px;
color: #fff;
}
.title_name {
width: 68%;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.el-menu-item {
border-bottom: 1px #ebf0fc solid;
border-left: 3px solid white;
height: 50px;
line-height: 50px;
padding: 0 20px !important;
font-size: 16px;
}
// .el-menu-item:hover > .el-icon-delete{
// display: none;
// }
.checked_item {
border-left: 3px solid #5181f6;
// padding: 0 27px !important;
background-color: #e1e8fa !important;
}
.btn_pack {
display: flex;
padding: 15px 15px;
box-sizing: border-box;
justify-content: center;
button {
height: 34px;
}
}
}
.right{
flex: 1;
background: #fff;
.inner {
padding: 25px 20px;
width: 100%;
height: 100%;
box-sizing: border-box;
.Extgantt{
width: 100%;
height: 100% ;
border: none;
}
}
}
}
</style>