update code
parent
c8f0ae592a
commit
608575c530
|
@ -0,0 +1,131 @@
|
|||
import request from "@/utils/request";
|
||||
import { tryToJson } from "../../utils/tools";
|
||||
import $dt from "dayjs";
|
||||
|
||||
// 节点计划预警
|
||||
const selectScheduledAlerts = (data) => {
|
||||
return request({
|
||||
url: "bgscreen/projectBuildNode/selectScheduledAlerts",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
// 获取当前节点及叶子节点
|
||||
const selectCurrent = (data) => {
|
||||
return request({
|
||||
url: "bgscreen/projectBuildNode/selectCurrent",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
const listByProject=(projectId)=>{
|
||||
return new Promise(resolve=>{
|
||||
request({
|
||||
url: `bgscreen/projectBuildNode/listByProject?projectId=${projectId}`,
|
||||
method: "get",
|
||||
}).then(d=>{
|
||||
let tmps = (d.data || []).map(it => {
|
||||
it.lvl = it.baseBuildNode.nodeLvl;
|
||||
it.parentLvl = it.lvl.substring(0, it.lvl.length - 2);
|
||||
it.nodeText = it.baseBuildNode.nodeText;
|
||||
it.file = tryToJson(it.files, []);
|
||||
it.expend=true;
|
||||
return it;
|
||||
});
|
||||
let objs = tmps.filter(d => d.parentLvl.length == 0);
|
||||
objs.forEach(it => {
|
||||
it.children = tmps.filter(item => item.parentLvl == it.lvl)
|
||||
it.children.forEach(item => {
|
||||
item.children = tmps.filter(item3 => item3.parentLvl == item.lvl);
|
||||
});
|
||||
})
|
||||
resolve(objs);
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
const covertData = (objs) => {
|
||||
let tmps = objs.map((it) => {
|
||||
it.lvl = it.baseBuildNode.nodeLvl;
|
||||
it.parentLvl = it.lvl.substring(0, it.lvl.length - 2);
|
||||
it.nodeText = it.baseBuildNode.nodeText;
|
||||
it.file = tryToJson(it.files, []);
|
||||
return it;
|
||||
});
|
||||
return tmps.map((it) => {
|
||||
let dt0 = +$dt($dt(new Date()).format("YYYY-MM-DD")); //当时时间
|
||||
let dt1 = it.planStartDate ? +$dt(it.planStartDate) : 0; //计划开始
|
||||
let dt2 = it.planEndDate ? +$dt(it.planEndDate) : 0; //计划结束
|
||||
let dt3 = it.startDate ? +$dt(it.startDate) : 0; //实际开始
|
||||
let dt4 = it.endDate ? +$dt(it.endDate) : 0; //实际结束
|
||||
if (it.lvl.length == 2) {
|
||||
if (!it.planStartDate || !it.planEndDate) {
|
||||
it.finish = "";
|
||||
it.finishState = -1;
|
||||
return it;
|
||||
}
|
||||
if (it.endDate) {
|
||||
if (dt4 > dt2) {
|
||||
it.finishState = 1;
|
||||
it.finish = "逾期" + (dt4 - dt2) / 3600 / 1000 / 24 + "天";
|
||||
} else {
|
||||
it.finish = "正常完工";
|
||||
it.finishState = 3;
|
||||
}
|
||||
} else {
|
||||
if (it.startDate) {
|
||||
if (dt2 >= dt0) {
|
||||
it.finish = "进行中";
|
||||
it.finishState = 2;
|
||||
} else {
|
||||
it.finishState = 1;
|
||||
it.finish = "逾期" + (dt2 - dt0) / 3600 / 1000 / 24 + "天";
|
||||
}
|
||||
} else {
|
||||
it.finish = "未开工";
|
||||
it.finishState = 4;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!it.planStartDate &&!it.planEndDate &&!it.startDate &&!it.endDate) {
|
||||
it.finish = "";
|
||||
it.finishState = -1;
|
||||
return it;
|
||||
}
|
||||
if (it.planStartDate && !it.startDate) {
|
||||
it.finish = "未开工";
|
||||
it.finishState = 4;
|
||||
return it;
|
||||
}
|
||||
if (!it.endDate) {
|
||||
it.finish = "进行中";
|
||||
it.finishState = 2;
|
||||
}
|
||||
if(it.endDate && !it.planEndDate){
|
||||
it.finish = "正常完工";
|
||||
it.finishState = 3;
|
||||
return it;
|
||||
}
|
||||
if(it.endDate && it.planEndDate){
|
||||
if(dt4>dt2){
|
||||
it.finishState = 1;
|
||||
it.finish = "逾期" + (dt4 - dt2) / 3600 / 1000 / 24 + "天";
|
||||
} else {
|
||||
it.finish = "正常完工";
|
||||
it.finishState = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return it;
|
||||
});
|
||||
};
|
||||
|
||||
export default {
|
||||
selectScheduledAlerts,
|
||||
selectCurrent,
|
||||
covertData,
|
||||
listByProject
|
||||
};
|
|
@ -10,6 +10,7 @@ import dict from './dict/index'
|
|||
import attendance from './attendance/index'
|
||||
import insurance from './insurance/index'
|
||||
import journalism from './journalism/index'
|
||||
import buildNode from './buildNode'
|
||||
export default {
|
||||
project,
|
||||
dept,
|
||||
|
@ -22,5 +23,6 @@ export default {
|
|||
dict,
|
||||
attendance,
|
||||
insurance,
|
||||
journalism
|
||||
journalism,
|
||||
buildNode
|
||||
}
|
|
@ -3,19 +3,11 @@ import Api from '../api/index'
|
|||
import dayjs from 'dayjs'
|
||||
import './style/index.less'
|
||||
import dayfilter from '@/utils/dayfilter'
|
||||
import {tryToJson} from '../utils/tools'
|
||||
dayfilter(Vue);
|
||||
Vue.prototype.$api=Api;
|
||||
Vue.prototype.$bus=new Vue();
|
||||
Vue.prototype.$apiPath="/jhapi"
|
||||
Vue.prototype.$dt=dayjs;
|
||||
Vue.prototype.$tryToJson=(str,def=null)=>{
|
||||
if(!str){
|
||||
return def;
|
||||
}
|
||||
try{
|
||||
return JSON.parse(str);
|
||||
}catch(e){
|
||||
return def;
|
||||
}
|
||||
}
|
||||
Vue.prototype.$tryToJson=tryToJson
|
||||
window.jhcaches={};
|
|
@ -0,0 +1,415 @@
|
|||
<template>
|
||||
<MyDialog v-if="show" v-model="show" width="1600px" height="850px" :class="'font-size-' + fontSize"
|
||||
class="build-node-dlg">
|
||||
<template slot="title">
|
||||
<div :key="elKey">
|
||||
{{ prj.projectName }} - 项目节点
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="font-size-tools">
|
||||
<i class="set-font-size font-size2" @click="fontSize = 2" :class="fontSize == 2 ? 'active' : ''">
|
||||
<svg class="icon svg-icon"
|
||||
style="width: 32px !important;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
|
||||
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3686">
|
||||
<path
|
||||
d="M839 875H735.3l-74.1-198.7H358.6L288.7 875H185l276.8-726h100.4L839 875zM632.1 594.3L522.3 292.4c-3.4-9.7-7.2-26.6-11.3-50.6h-2.3c-3.4 21.9-7.4 38.7-11.7 50.6L388.1 594.3h244z"
|
||||
fill="#fff" p-id="3687"></path>
|
||||
</svg>
|
||||
</i>
|
||||
<i class="set-font-size font-size1" @click="fontSize = 1" :class="fontSize == 1 ? 'active' : ''">
|
||||
<svg class="icon svg-icon"
|
||||
style="width: 32px !important;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
|
||||
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3686">
|
||||
<path
|
||||
d="M839 875H735.3l-74.1-198.7H358.6L288.7 875H185l276.8-726h100.4L839 875zM632.1 594.3L522.3 292.4c-3.4-9.7-7.2-26.6-11.3-50.6h-2.3c-3.4 21.9-7.4 38.7-11.7 50.6L388.1 594.3h244z"
|
||||
fill="#fff" p-id="3687"></path>
|
||||
</svg>
|
||||
</i>
|
||||
<i class="set-font-size font-size0" @click="fontSize = 0" :class="fontSize == 0 ? 'active' : ''">
|
||||
<svg class="icon svg-icon"
|
||||
style="width: 32px !important;height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
|
||||
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3686">
|
||||
<path
|
||||
d="M839 875H735.3l-74.1-198.7H358.6L288.7 875H185l276.8-726h100.4L839 875zM632.1 594.3L522.3 292.4c-3.4-9.7-7.2-26.6-11.3-50.6h-2.3c-3.4 21.9-7.4 38.7-11.7 50.6L388.1 594.3h244z"
|
||||
fill="#fff" p-id="3687"></path>
|
||||
</svg>
|
||||
</i>
|
||||
</div>
|
||||
<div class="modify-btn btn-left">
|
||||
<svg class="my-svg-icon-aaa" @click="modifyLeftBtn"
|
||||
style="cursor:pointer; width: 3em;vertical-align: middle;fill: currentColor;overflow: hidden;"
|
||||
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4967">
|
||||
<path
|
||||
d="M729.6 931.2l-416-425.6 416-416c9.6-9.6 9.6-25.6 0-35.2-9.6-9.6-25.6-9.6-35.2 0l-432 435.2c-9.6 9.6-9.6 25.6 0 35.2l432 441.6c9.6 9.6 25.6 9.6 35.2 0C739.2 956.8 739.2 940.8 729.6 931.2z"
|
||||
p-id="4968"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="modify-btn btn-right">
|
||||
<svg class="my-svg-icon-aaa" @click="modifyRightBtn"
|
||||
style="cursor:pointer; width: 3em;vertical-align: middle;fill: currentColor;overflow: hidden;"
|
||||
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4997">
|
||||
<path
|
||||
d="M761.6 489.6l-432-435.2c-9.6-9.6-25.6-9.6-35.2 0-9.6 9.6-9.6 25.6 0 35.2l416 416-416 425.6c-9.6 9.6-9.6 25.6 0 35.2s25.6 9.6 35.2 0l432-441.6C771.2 515.2 771.2 499.2 761.6 489.6z"
|
||||
p-id="4998"></path>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div class="main-content">
|
||||
|
||||
|
||||
<div class="head-title-tab">
|
||||
<div class="head-nav" :class="nav == it.lvl ? 'active' : ''" @click="doNavClick(it)"
|
||||
v-for="(it, idx) in tableData" :key="idx">{{ it.nodeText }}</div>
|
||||
</div>
|
||||
<div class="node-list scroll" style=" max-height: 675px;overflow-y: auto;">
|
||||
<NodeItem :item="curNode" :showLabel="false" class="node-item-lvl1 node-item"></NodeItem>
|
||||
<div v-for="(it, idx) in curNodes" :key="idx" class="node-item2"
|
||||
:class="'children' + (curNodes.length > 1 ? 'more' : 'one')">
|
||||
<NodeItem :item="it" class="node-item-lvl2 node-item" :class="'children' + it.children.length"
|
||||
@header-click="doLvl2HeaderClick(it)"></NodeItem>
|
||||
<div v-for="(itt, idxx) in it.children" :key="idx + '_' + idxx" class="node-item3" v-show="it.expend">
|
||||
<NodeItem :item="itt" class="node-item-lvl3 node-item"></NodeItem>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</MyDialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NodeItem from './nodeItem.vue'
|
||||
import '@/components/module/module-one-1-1'
|
||||
import MyDialog from '../components/MyDialog'
|
||||
export default {
|
||||
components: {
|
||||
MyDialog,
|
||||
NodeItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
elKey: 0,
|
||||
fontSize: 0,
|
||||
index: 0,
|
||||
nav: '01',
|
||||
show: false,
|
||||
prj: null,
|
||||
prjs: [],
|
||||
tableData: [],
|
||||
curNodes: [],
|
||||
curNode: {}
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
doLvl2HeaderClick(it) {
|
||||
if (it.children.length > 0) {
|
||||
it.expend = !it.expend;
|
||||
}
|
||||
},
|
||||
doNavClick(it) {
|
||||
this.nav = it.lvl;
|
||||
this.curNodes = it.children;
|
||||
this.curNode = it;
|
||||
},
|
||||
findItem() {
|
||||
let tmps = this.prjs.filter(d => d.id == this.prj.id);
|
||||
if (tmps.length > 0) {
|
||||
return tmps[0];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
showDialog(prjs, prj) {
|
||||
this.show = true
|
||||
let id = prj.id;
|
||||
if (id == 0) {
|
||||
id = prjs[1].id;
|
||||
this.prj = prjs[1];
|
||||
} else {
|
||||
this.prj = prj;
|
||||
}
|
||||
this.prjs = prjs.filter(d => d.id > 0);
|
||||
let find = this.findItem();
|
||||
if (find) {
|
||||
this.index = this.prjs.indexOf(find);
|
||||
} else {
|
||||
this.index = 0;
|
||||
}
|
||||
this.loadData();
|
||||
},
|
||||
loadData() {
|
||||
this.prj = this.prjs[this.index];
|
||||
this.$api.buildNode.listByProject(this.prjs[this.index].id).then(d => {
|
||||
this.tableData = d || [];
|
||||
this.elKey++;
|
||||
this.curNode = this.tableData.length > 0 ? this.tableData[0] : {}
|
||||
this.curNodes = this.tableData.length > 0 ? this.tableData[0].children : []
|
||||
this.nav = "01";
|
||||
})
|
||||
},
|
||||
modifyLeftBtn() {
|
||||
let n = this.index;
|
||||
n--;
|
||||
if (n < 0) {
|
||||
n = this.prjs.length - 1;
|
||||
}
|
||||
this.index = n;
|
||||
this.loadData();
|
||||
},
|
||||
modifyRightBtn() {
|
||||
let n = this.index;
|
||||
n++;
|
||||
if (n > this.prjs.length - 1) {
|
||||
n = 0;
|
||||
}
|
||||
this.index = n;
|
||||
this.loadData();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.build-node-dlg {
|
||||
|
||||
.popup-project-introduction-min {
|
||||
transform: translateY(100px);
|
||||
|
||||
&:hover {
|
||||
.modify-btn {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.font-size-2 {
|
||||
.popup-project-introduction-details {
|
||||
.main-content{
|
||||
font-size: 32px;
|
||||
line-height: 64px;
|
||||
|
||||
.head-title-tab {
|
||||
.head-nav {
|
||||
padding: 12px 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.node-list {
|
||||
.node-item {
|
||||
.date-info {
|
||||
line-height: 72px;
|
||||
|
||||
.sp-label {
|
||||
width: 90px !important;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
line-height: 28px;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.node-item-lvl2 {
|
||||
margin-top: 16px;
|
||||
.lbl-title {
|
||||
width: 150px;
|
||||
font-size: 32px;
|
||||
width: 240px !important;
|
||||
}
|
||||
}
|
||||
.node-item3 {
|
||||
margin-left: 50px;
|
||||
.lbl-title {
|
||||
font-size: 24px;
|
||||
width:190px
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.font-size-1 {
|
||||
.popup-project-introduction-details {
|
||||
.main-content{
|
||||
font-size: 24px;
|
||||
line-height: 28px;
|
||||
|
||||
.head-title-tab {
|
||||
.head-nav {
|
||||
padding: 12px 36px;
|
||||
}
|
||||
}
|
||||
|
||||
.node-list {
|
||||
.node-item {
|
||||
.date-info {
|
||||
line-height: 64px;
|
||||
.sp-label {
|
||||
width: 76px !important;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
line-height: 28px;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.node-item-lvl2 {
|
||||
margin-top: 16px;
|
||||
.lbl-title {
|
||||
width: 150px;
|
||||
font-size: 24px;
|
||||
width: 240px !important;
|
||||
}
|
||||
}
|
||||
.node-item3 {
|
||||
margin-left: 50px;
|
||||
.lbl-title {
|
||||
font-size: 20px;
|
||||
width:190px
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-project-introduction-details {
|
||||
padding: 0px !important;
|
||||
position: relative;
|
||||
|
||||
.quality-table {
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.font-size-tools {
|
||||
position: absolute;
|
||||
top: -40px;
|
||||
right: 100px;
|
||||
}
|
||||
|
||||
.modify-btn {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 400px;
|
||||
z-index: 100;
|
||||
cursor: pointer;
|
||||
padding: 0px;
|
||||
border-radius: 50%;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
|
||||
svg {
|
||||
* {
|
||||
fill: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-right {
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
&.btn-left {
|
||||
left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.head-title-tab {
|
||||
padding-top: 12px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
||||
.head-nav {
|
||||
background-size: 100% 100%;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
padding: 0px 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.node-list {
|
||||
padding: 12px;
|
||||
|
||||
.node-item {
|
||||
.date-info {
|
||||
box-shadow: inset 7px 0px 11px 5px rgb(36 131 167 / 70%);
|
||||
line-height: 32px;
|
||||
padding: 0px 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.node-item-lvl1 {
|
||||
border-bottom: solid 1px #fff;
|
||||
}
|
||||
|
||||
.node-item-lvl2 {
|
||||
&.children0 {
|
||||
.lbl-title {
|
||||
.el-icon-caret {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lbl-title {
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
width: 200px !important;
|
||||
color: #7fffd4;
|
||||
}
|
||||
}
|
||||
|
||||
.node-item-lvl3,
|
||||
.node-item-lvl2 {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
|
||||
.lbl-title {
|
||||
width: 150px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.date-info {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.node-item-lvl3 {
|
||||
.lbl-title {
|
||||
.el-icon-caret {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.node-item3 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.lbl-title {
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
}</style>
|
|
@ -0,0 +1,74 @@
|
|||
<template>
|
||||
<div class="build-node-item">
|
||||
<span class="lbl-title" v-show="showLabel" @click="doHeaderClick">
|
||||
<i class="el-icon-caret" :class="item.expend?'el-icon-caret-bottom':'el-icon-caret-right'"></i>
|
||||
{{ item.nodeText }}</span>
|
||||
<div class="date-info">
|
||||
<el-col :span="6">
|
||||
<span class="sp-label">计划开始时间:</span>
|
||||
<span class="sp-date">{{formatDate(item.planStartDate) }}</span>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<span class="sp-label">计划完成时间:</span>
|
||||
<span class="sp-date">{{ formatDate(item.planEndDate) }}</span>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<span class="sp-label">实际开始时间:</span>
|
||||
<span class="sp-date">{{formatDate(item.startDate) }}</span>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<span class="sp-label">实际完成时间:</span>
|
||||
<span class="sp-date">{{ formatDate(item.endDate)}}</span>
|
||||
</el-col>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'JhbigscreenNodeItem',
|
||||
props: {
|
||||
showLabel: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
formatDate(dt){
|
||||
if(dt){
|
||||
return this.$dt(dt).format("YYYY-MM-DD");
|
||||
}
|
||||
return "暂无";
|
||||
},
|
||||
doHeaderClick(){
|
||||
this.$emit("header-click");
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.build-node-item{
|
||||
.lbl-title {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
.sp-label{
|
||||
color: #d6f10a;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -746,50 +746,8 @@ export default {
|
|||
},
|
||||
getProjectBuildNode() {
|
||||
this.getProjectId(id => {
|
||||
this.$api.project.getProjectBuildNode(id).then(d => {
|
||||
let tmps = (d.data || []).map(it => {
|
||||
it.lvl = it.baseBuildNode.nodeLvl;
|
||||
it.parentLvl = it.lvl.substring(0, it.lvl.length - 2);
|
||||
it.nodeText = it.baseBuildNode.nodeText;
|
||||
it.file = this.$tryToJson(it.files, []);
|
||||
return it;
|
||||
}).filter(it => it.lvl.length == 2);
|
||||
this.projectBuildNode = tmps.map(it => {
|
||||
let dt0 = + this.$dt(this.$dt(new Date()).format("YYYY-MM-DD"));//当时时间
|
||||
let dt1 = it.planStartDate ? +this.$dt(it.planStartDate) : 0;//计划开始
|
||||
let dt2 = it.planEndDate ? +this.$dt(it.planEndDate) : 0;//计划结束
|
||||
let dt3 = it.startDate ? +this.$dt(it.startDate) : 0;//实际开始
|
||||
let dt4 = it.endDate ? +this.$dt(it.endDate) : 0;//实际结束
|
||||
if (!it.planStartDate || !it.planEndDate) {
|
||||
it.finish = "";
|
||||
it.finishState = -1;
|
||||
return it;
|
||||
}
|
||||
if (it.endDate) {
|
||||
if (dt4 > dt2) {
|
||||
it.finishState = 1;
|
||||
it.finish = "逾期" + ((dt4 - dt2) / 3600 / 1000 / 24) + "天";
|
||||
} else {
|
||||
it.finish = "正常完工";
|
||||
it.finishState = 3;
|
||||
}
|
||||
} else {
|
||||
if (it.startDate) {
|
||||
if (dt2 >= dt0) {
|
||||
it.finish = "进行中";
|
||||
it.finishState = 2;
|
||||
} else {
|
||||
it.finishState = 1;
|
||||
it.finish = "逾期" + ((dt2 - dt0) / 3600 / 1000 / 24) + "天";
|
||||
}
|
||||
} else {
|
||||
it.finish = "未开工";
|
||||
it.finishState = 4;
|
||||
}
|
||||
}
|
||||
|
||||
return it;
|
||||
});
|
||||
this.$api.project.getProjectBuildNode(id).then(d => {
|
||||
this.projectBuildNode = this.$api.buildNode.covertData(d.data || []).filter(it => it.lvl.length == 2);
|
||||
});
|
||||
this.getDeptWorksList();
|
||||
});
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<module-one-1-2 label="项目季度考核目标">
|
||||
<img src="images/icon2001.png" style="position: absolute;cursor: pointer;right: 12px;top: 12px;" @click="doShowDlg1">
|
||||
<img src="images/icon2001.png" style="position: absolute;cursor: pointer;right: 12px;top: 12px;" @click="doShowDlg1">
|
||||
<div class="quality-table special-table">
|
||||
<el-table :data="getAssessData()" style="width: 100%;background: transparent;"
|
||||
height="265"
|
||||
|
@ -107,18 +107,38 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="glr-title" style="margin-top:10px;color:#4DDEDF">在建项目本周进展</div>
|
||||
<div class="build-item">
|
||||
<div class="company-img">
|
||||
<img src="images/company_4.png">
|
||||
</div>
|
||||
<el-col :span="12" style="position: relative;">
|
||||
<div class="glr-title" style="margin-top:10px;color:#4DDEDF">在建项目节点明细</div>
|
||||
<img src="images/icon2001.png" style="position: absolute;cursor: pointer;right: 12px;top: 12px;" @click="showBuildNodeDlg">
|
||||
<div class="build-item">
|
||||
<div class="build-text" style="flex-grow: 1;">
|
||||
<div class="div-prj" v-if="prjInfo">{{ prjInfo.projectName }}</div>
|
||||
<template v-if="scheduleInfo && scheduleInfo.constructionProgress">
|
||||
<div style="margin-top:12px;"><img src="images/title_icon.png"><span class="sp-lbl" style="position: relative;top: -7px;color:#B8C9EE;">施工进展</span></div>
|
||||
<div class="div-text scroll" style="max-height: 140px;overflow: auto;color:#B8C9EE;"><div>{{scheduleInfo.constructionProgress}}</div></div>
|
||||
<div class="div-prj" v-if="scheduleInfo">
|
||||
<i style="color:#389DE3" class="el-icon-office-building"></i>
|
||||
{{ scheduleInfo.projectName }}</div>
|
||||
<template v-if="buildNode && buildNode.current">
|
||||
<div style="margin-top:12px;"><img src="images/title_icon.png"><span class="sp-lbl" style="position: relative;top: -7px;color:#B8C9EE;">
|
||||
{{buildNode.current.baseBuildNode.nodeText}}</span></div>
|
||||
<div class="div-text scroll" style="max-height: 140px;overflow: auto;color:#B8C9EE;padding-right: 12px;"><div>
|
||||
<table class="build-node-list" v-if="buildNode && buildNode.nodes && buildNode.nodes.length>0 ">
|
||||
<tr class="header">
|
||||
<th style="border-radius: 4px 0px 0px 0px;">项目</th>
|
||||
<th style="border-radius: 0px 4px 0px 0px;">状态</th>
|
||||
</tr>
|
||||
<tr v-for="(it,idx) in buildNode.nodes" :key="idx" class="data">
|
||||
<td>{{ it.nodeText }}</td>
|
||||
<td :class="'finish-'+it.finishState">{{ it.finish }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div v-else style="text-align: center;">
|
||||
<img src="images/nodata.png" style="width: 140px;" v-show="buildNodeLoad" >
|
||||
<div style="text-align: center;color:#ccc">暂无数据</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</template>
|
||||
<div v-else style="text-align: center;">
|
||||
<img src="images/nodata.png" style="width: 140px;" v-show="buildNodeLoad" >
|
||||
<div style="text-align: center;color:#ccc">暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -143,12 +163,12 @@
|
|||
<div class="prj-info-list" v-if="scheduleInfo">
|
||||
<div class="col-1" style="width:400px;padding-top:12px;">
|
||||
<el-carousel height="260px" v-if="scheduleInfo && scheduleInfo.images && scheduleInfo.images.length>0">
|
||||
<el-carousel-item v-for="item in scheduleInfo.images" :key="item">
|
||||
<div style="width: 100%;display: flex;align-items: center;justify-content: center;height: 260px;">
|
||||
<el-image :src="$apiPath+item" style="width:100%" :preview-src-list="[$apiPath+item]"/>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<el-carousel-item v-for="item in scheduleInfo.images" :key="item">
|
||||
<div style="width: 100%;display: flex;align-items: center;justify-content: center;height: 260px;">
|
||||
<el-image :src="$apiPath+item" style="width:100%" :preview-src-list="[$apiPath+item]"/>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
<div class="col-2 scroll" style="flex-grow: 1;max-height: 270px;overflow: auto;width: calc(100% - 4px);margin-top:8px;">
|
||||
<template v-if="scheduleInfo.plannedNode">
|
||||
|
@ -243,6 +263,7 @@
|
|||
<index-dlg1 ref="dlg1"></index-dlg1>
|
||||
<index-dlg2 ref="dlg2"></index-dlg2>
|
||||
<index-dlg3 ref="dlg3"></index-dlg3>
|
||||
<build-node-dlg ref="buildNodeDlg"></build-node-dlg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -259,12 +280,14 @@ import indexDlg1 from './progress/indexDlg1'
|
|||
import indexDlg2 from './progress/indexDlg2'
|
||||
import indexDlg3 from './progress/indexDlg3'
|
||||
import problemProgress from './progress/problemProgress.vue'
|
||||
import buildNodeDlg from './progress/buildNodeDlg.vue'
|
||||
export default {
|
||||
components:{
|
||||
indexDlg1,
|
||||
indexDlg2,
|
||||
indexDlg3,
|
||||
problemProgress
|
||||
problemProgress,
|
||||
buildNodeDlg
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -328,7 +351,12 @@ export default {
|
|||
prjInfo:{},
|
||||
scheduleInfo:null,
|
||||
projects:[],
|
||||
projectCategory:[]
|
||||
projectCategory:[],
|
||||
buildNodeLoad:false,
|
||||
buildNode:{
|
||||
current:null,
|
||||
nodes:[]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -336,7 +364,8 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
window.app=this;
|
||||
this.$bus.$on("projectChange",res=>{
|
||||
this.$bus.$on("projectChange",res=>{
|
||||
this.prjInfo=res;
|
||||
this.loadProjectConstructionProgress();
|
||||
});
|
||||
this.$bus.$on("loadProjects",prjs=>{
|
||||
|
@ -348,6 +377,9 @@ export default {
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
showBuildNodeDlg(){
|
||||
this.$refs.buildNodeDlg.showDialog(this.projects,this.prjInfo);
|
||||
},
|
||||
getAssessData(){
|
||||
if(this.prjInfo.id==0){
|
||||
return this.assessData;
|
||||
|
@ -411,7 +443,15 @@ export default {
|
|||
}
|
||||
this.scheduleInfo=obj;
|
||||
})
|
||||
this.$api.buildNode.selectCurrent({projectId:prjId}).then(d=>{
|
||||
let tmps=this.$api.buildNode.covertData(d.data||[]);
|
||||
let objs=tmps.filter(d=>d.lvl.length==2)
|
||||
this.buildNode.current=objs.length>0?objs[0]:null;
|
||||
this.buildNode.nodes=tmps.filter(d=>d.lvl.length>2)
|
||||
this.buildNodeLoad=true;
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
doShowDlg1(){
|
||||
this.$refs.dlg1.showDialog(this.assessData)
|
||||
|
@ -551,15 +591,7 @@ export default {
|
|||
|
||||
<style lang="less" >
|
||||
.project-progress{
|
||||
.finish-0{
|
||||
color: #01A9FF;
|
||||
}
|
||||
.finish-1{
|
||||
color: red;
|
||||
}
|
||||
.finish-2{
|
||||
color: green;
|
||||
}
|
||||
|
||||
.my-svg-icon-aaa *{
|
||||
fill: #aaa;
|
||||
}
|
||||
|
@ -678,5 +710,32 @@ export default {
|
|||
line-height: 30px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.build-node-list{
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
tr{
|
||||
&.data{
|
||||
td{
|
||||
&:first-child{
|
||||
border-bottom:solid 1px #2D5280;
|
||||
border-left:solid 1px #2D5280;
|
||||
|
||||
}
|
||||
&:last-child{
|
||||
border-bottom:solid 1px #2D5280;
|
||||
border-right:solid 1px #2D5280;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.header{
|
||||
background-color: #2D5280;
|
||||
}
|
||||
}
|
||||
td{
|
||||
|
||||
line-height: 32px;
|
||||
padding:0px 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -40,4 +40,13 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.finish-0{
|
||||
color: #01A9FF;
|
||||
}
|
||||
.finish-1{
|
||||
color: red;
|
||||
}
|
||||
.finish-2{
|
||||
color: green;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
export function tryToJson(str,def=null){
|
||||
if(!str){
|
||||
return def;
|
||||
}
|
||||
try{
|
||||
return JSON.parse(str);
|
||||
}catch(e){
|
||||
return def;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue