From 0f81beb7d9aade59ff1fa2e135c676f751c1bfa7 Mon Sep 17 00:00:00 2001
From: haha
Date: Wed, 6 Sep 2023 00:37:37 +0800
Subject: [PATCH] update code
---
src/api/buildNode/index.js | 23 +-
src/api/costOut/index.js | 12 +-
src/api/index.js | 5 +-
src/components/headerV2.js | 1 -
src/pages/progress/indexDlg2.vue | 3 -
src/pages/projectDetail.vue | 369 ++++++++++++++++++++-----------
src/utils/request.js | 6 +-
7 files changed, 272 insertions(+), 147 deletions(-)
diff --git a/src/api/buildNode/index.js b/src/api/buildNode/index.js
index 55271ec..33d1336 100644
--- a/src/api/buildNode/index.js
+++ b/src/api/buildNode/index.js
@@ -274,6 +274,26 @@ const queryByProjectTypeNoTree = (type) => {
});
});
};
+
+const queryFinishProject=projectId=>{
+ return new Promise((resolve)=>{
+ request({
+ url: "bgscreen/projectBuildNode/queryFinishProject?projectId=" + projectId,
+ method: "get",
+ }).then(d=>{
+ let tmps = (d.data || []).map((it) => {
+ it.lvl = it.baseBuildNode.nodeLvl;
+ it.projectName = it.project?.projectName || "";
+ it.parentLvl = it.lvl.substring(0, it.lvl.length - 2);
+ it.nodeText = it.baseBuildNode.nodeText;
+ return it;
+ });
+ resolve(tmps);
+ })
+ });
+}
+
+
export default {
selectScheduledAlerts,
selectCurrent,
@@ -282,5 +302,6 @@ export default {
countCompletionRate,
queryByProjectType,
queryByProjectTypeNoTree,
- toTree
+ toTree,
+ queryFinishProject
};
diff --git a/src/api/costOut/index.js b/src/api/costOut/index.js
index cb46563..bd7b93a 100644
--- a/src/api/costOut/index.js
+++ b/src/api/costOut/index.js
@@ -23,12 +23,16 @@ const selectYearAndMonth=(data)=> {
let totalObjs=tmps.filter(it=>it.costType==9);
let total=0;
totalObjs.forEach(it=>{
- total+=(it.money?it.money:0)
+ if(it.money){
+ total+=it.money;
+ }
});
- totalObjs=tmps.filter(it=>it.costType==9 && it.year==y);
+ let yearObjs=tmps.filter(it=>it.costType==9 && it.year==y);
let totalY=0;
- totalObjs.forEach(it=>{
- totalY+=(it.money?it.money:0)
+ yearObjs.forEach(it=>{
+ if(it.money){
+ totalY+=it.money;
+ }
});
let obj={
totalInv:getValue(tmps,1).money||0,//总投资
diff --git a/src/api/index.js b/src/api/index.js
index 29e0774..ff0d78a 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -17,7 +17,7 @@ import materialSeal from './materialSeal/index'
import costOut from './costOut/index'
import checkDetection from './checkDetection/index'
import video from './video/index'
-import {axios} from '@/utils/request'
+import {axios,download} from '@/utils/request'
export default {
project,
dept,
@@ -38,5 +38,6 @@ export default {
materialSeal,
checkDetection,
http:axios,
- video
+ video,
+ downFile:download
}
\ No newline at end of file
diff --git a/src/components/headerV2.js b/src/components/headerV2.js
index 6d4c202..ca79a11 100644
--- a/src/components/headerV2.js
+++ b/src/components/headerV2.js
@@ -134,7 +134,6 @@ Vue.component("screen-header", {
},
//页面条状
pageJump(n,url){
- debugger
if(n != this.nav){
if(url){
diff --git a/src/pages/progress/indexDlg2.vue b/src/pages/progress/indexDlg2.vue
index da48c2f..0e54b92 100644
--- a/src/pages/progress/indexDlg2.vue
+++ b/src/pages/progress/indexDlg2.vue
@@ -31,9 +31,6 @@
-
-
-
diff --git a/src/pages/projectDetail.vue b/src/pages/projectDetail.vue
index 6e0023f..26c2a36 100644
--- a/src/pages/projectDetail.vue
+++ b/src/pages/projectDetail.vue
@@ -22,7 +22,8 @@
甲方代表
-
{{getPrjUser('甲方代表')||' ' }}
+
+ {{ getPrjUser('甲方代表') || ' ' }}
@@ -31,7 +32,8 @@
项目等级
-
{{ getProjectLevel()||' ' }}
+
{{
+ getProjectLevel() || ' ' }}
@@ -40,7 +42,8 @@
项目经理
-
{{getPrjUser('项目经理')||' ' }}
+
+ {{ getPrjUser('项目经理') || ' ' }}
@@ -49,7 +52,8 @@
项目总监
-
{{getPrjUser('总监')||' ' }}
+
+ {{ getPrjUser('总监') || ' ' }}
@@ -58,7 +62,8 @@
总包单位
-
{{getPrjUser('总包单位','2')||' ' }}
+
+ {{ getPrjUser('总包单位', '2') || ' ' }}
@@ -67,7 +72,8 @@
监理单位
-
{{getPrjUser('监理单位','4')||' ' }}
+
+ {{ getPrjUser('监理单位', '4') || ' ' }}
@@ -77,8 +83,10 @@
-
在岗人数
-
今日出勤
+
在岗人数
+
+
今日出勤
+
@@ -104,10 +112,12 @@
-
+
-
+
@@ -116,40 +126,40 @@
-
+
施工进展:
- {{ scheduleInfo ? scheduleInfo.constructionProgress || '暂无' : '暂无' }}
+ {{ scheduleInfo ? scheduleInfo.constructionProgress || '暂无' : '暂无' }}
-
+
报建、设计进展:
- {{ scheduleInfo ? scheduleInfo.designProgress || '暂无' : '暂无' }}
+ {{ scheduleInfo ? scheduleInfo.designProgress || '暂无' : '暂无' }}
融资、招采进展:
- {{ scheduleInfo ? scheduleInfo.purchaseProgress || '暂无' : '暂无' }}
+ {{ scheduleInfo ? scheduleInfo.purchaseProgress || '暂无' : '暂无' }}
-
-
+
+
验收进展:
- {{ scheduleInfo ? scheduleInfo.acceptanceProgress || '暂无' : '暂无' }}
+ {{ scheduleInfo ? scheduleInfo.acceptanceProgress || '暂无' : '暂无' }}
结算进展:
- {{ scheduleInfo ? scheduleInfo.purchaseProgress || '暂无' : '暂无' }}
+ {{ scheduleInfo ? scheduleInfo.purchaseProgress || '暂无' : '暂无' }}
运维进展:
- {{ scheduleInfo ? scheduleInfo.designProgress || '暂无' : '暂无' }}
+ {{ scheduleInfo ? scheduleInfo.designProgress || '暂无' : '暂无' }}
-
+
-
+
@@ -171,7 +181,7 @@
总投资
-
{{ costOut.totalInv||0 }} 万元
+
{{ costOut.totalInv || 0 }} 万元
@@ -190,7 +200,7 @@
fill="#070102" p-id="15830">
本月完成
- {{costOut.curMonth||0}} 万元
+ {{ costOut.curMonth || 0 }} 万元
@@ -211,7 +221,7 @@
本年完成
- {{costOut.totalY||0}} 万元
+ {{ costOut.totalYear || 0 }} 万元
@@ -232,7 +242,7 @@
开累完成
- {{costOut.totalMonth||0}} 万元
+ {{ costOut.totalMonth || 0 }} 万元
@@ -277,7 +287,8 @@
计划开工日期
- {{ getCurProject().scheduledStartTime||'' }}
+ {{ fmtDate(getCurProject().scheduledStartTime || '') }}
+
@@ -322,7 +333,8 @@
计划竣工日期
- {{ getCurProject().plannedCompletionTime||'' }}
+ {{ fmtDate(getCurProject().plannedCompletionTime || '') }}
+
@@ -367,7 +379,7 @@
实际开工日期
- {{ getCurProject().actualOperatingTime|formatDate }}
+ {{ fmtDate(getCurProject().actualOperatingTime) }}
@@ -412,7 +424,7 @@
合同工期
- {{ getCurProject().projectTimeLimit||'-' }} 天
+ {{ getCurProject().projectTimeLimit || '-' }} 天
@@ -446,8 +458,9 @@
-
-
![]()
+
+
@@ -482,19 +495,32 @@
-
报建
-
设计
-
合同
-
验收成果
+
方案设计
+
报建
+
招采
+
施工阶段
+
验收阶段
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ it.original }}
+
+
+ {{row.files.length}} 个
+
+ 0个
+
+
@@ -603,20 +629,20 @@ import MonitAndWarning from './components/MonitAndWarning.vue'
import projectInfoDlg from './detail/projectInfoDlg.vue'
export default {
components: {
- MonitAndWarning,projectInfoDlg
+ MonitAndWarning, projectInfoDlg
},
data() {
return {
- elCostOut:0,
+ elCostOut: 0,
prjs: [],
dept: null,
- project: null,
+ project: null,
scheduleInfo: null,
projectBuildNode: null,
- prjResNav: 0,
- projectLvlDict:[],
- projectUsers:[],//项目用户,用于项目概况
- elPrjUser:0,
+ prjResNav: '03',
+ projectLvlDict: [],
+ projectUsers: [],//项目用户,用于项目概况
+ elPrjUser: 0,
//项目概况
top: 0,
introduceInterval: undefined,
@@ -722,10 +748,10 @@ export default {
],
warningTypeInterval: undefined,
warningTypeIndex: 0,
- mapName:'',
- costOut:{
-
- }
+ mapName: '',
+ costOut: {},
+ finishBuildNode: [],
+ modleMap: []
}
},
created() {
@@ -734,71 +760,86 @@ export default {
this.projectLvlDict = d || [];
});
},
- mounted() {
- window.xapp=this
+ mounted() {
+ window.xapp = this
this.$bus.$on("loadProjects", prjs => {
this.prjs = prjs;
});
this.$bus.$on("projectChange", res => {
this.project = res;
- this.mapName="";
- if(res.id==0){
- if(this.prjs.length>1){
+ this.mapName = "";
+ if (res.id == 0) {
+ if (this.prjs.length > 1) {
this.getMapName(this.prjs[1].projectName);
}
- }else{
+ } else {
this.getMapName(res.projectName);
}
this.loadData();
+ this.loadFilshNode();
});
this.$bus.$on("deptChange", dept => {
this.dept = dept;
});
},
methods: {
- getMapName(name){
- if(name){
- if(name.indexOf("医疗")>=0){
- this.mapName="map1.html?time="+ +new Date();
+ doDownFile(it){
+ if (it && it.url) {
+ this.$api.downFile( it.url,{},it.original);
+ }
+ },
+ fmtDate(d) {
+ if (!d) {
+ return "";
+ }
+ if (d.indexOf(":") >= 0) {
+ return this.$dt(d).format("YYYY-MM-DD");
+ }
+ return d;
+ },
+ getMapName(name) {
+ if (name) {
+ if (name.indexOf("医疗") >= 0) {
+ this.mapName = "map1.html?time=" + +new Date();
return;
- }else if(name.indexOf('体育中心')>=0){
- this.mapName="map2.html?time="+ +new Date();
+ } else if (name.indexOf('体育中心') >= 0) {
+ this.mapName = "map2.html?time=" + +new Date();
return;
}
}
- this.mapName="";
+ this.mapName = "";
},
- getPrjUser(t,deptType){
- if(this.projectUsers && this.projectUsers.length>0){
- if(deptType){
- let tmps=this.projectUsers.filter(it=>it.deptType==deptType);
- if(tmps.length>0){
+ getPrjUser(t, deptType) {
+ if (this.projectUsers && this.projectUsers.length > 0) {
+ if (deptType) {
+ let tmps = this.projectUsers.filter(it => it.deptType == deptType);
+ if (tmps.length > 0) {
return tmps[0].deptName;
}
- }else{
- let tmps=this.projectUsers.filter(it=>it.jobTypeName==t);
- if(tmps.length>0){
- return tmps[0].nickName+' '+tmps[0].phonenumber;
+ } else {
+ let tmps = this.projectUsers.filter(it => it.jobTypeName == t);
+ if (tmps.length > 0) {
+ return tmps[0].nickName + ' ' + tmps[0].phonenumber;
}
}
}
return "";
},
- getProjectLevel(){
- let lvl=this.getCurProject()?.projiectLevel||'';
- if(lvl){
+ getProjectLevel() {
+ let lvl = this.getCurProject()?.projiectLevel || '';
+ if (lvl) {
let tmps = this.projectLvlDict.filter(d => d.dictValue == lvl);
return tmps.length > 0 ? tmps[0].dictLabel : '';
}
return "";
},
- getCurProject(){
- if(!this.project){
+ getCurProject() {
+ if (!this.project) {
return {};
}
- if(this.project.id==0){
- if(this.prjs.length>1){
+ if (this.project.id == 0) {
+ if (this.prjs.length > 1) {
return this.prjs[1];
}
return {};
@@ -811,7 +852,7 @@ export default {
if (prjId == 0) {
if (this.prjs.length == 0) {
setTimeout(func, 100);
- } else {
+ } else {
cb && cb(this.prjs[1].id);
}
} else {
@@ -820,6 +861,14 @@ export default {
}
func();
},
+ loadFilshNode() {
+ this.getProjectId(id => {
+ this.$api.buildNode.queryFinishProject(id).then(d => {
+ this.finishBuildNode = d || [];
+ this.doPrjRes('03');
+ })
+ });
+ },
loadData() {
this.getProjectId(id => {
this.$api.schedule.projectConstructionProgress(id).then(d => {
@@ -840,37 +889,37 @@ export default {
this.getCostOut(id);
});
},
- getCostOut(id){
- let dt=this.$dt(new Date())
+ getCostOut(id) {
+ let dt = this.$dt(new Date())
this.$api.costOut.selectYearAndMonth({
- projectId:id,
- year:dt.$y,
- month:dt.$M
- }).then(d=>{
- this.costOut=d;
+ projectId: id,
+ year: dt.$y,
+ month: dt.$M
+ }).then(d => {
+ this.costOut = d;
this.elCostOut++;
})
},
- getProjectUser(){
+ getProjectUser() {
this.getProjectId(id => {
- this.$api.project.getProjectUser(id).then(d=>{
- this.projectUsers=d.data||[];
- this.elPrjUser++;
- });
+ this.$api.project.getProjectUser(id).then(d => {
+ this.projectUsers = d.data || [];
+ this.elPrjUser++;
+ });
});
},
getProjectBuildNode() {
this.getProjectId(id => {
- this.$api.project.getProjectBuildNode(id).then(d => {
+ this.$api.project.getProjectBuildNode(id).then(d => {
this.projectBuildNode = this.$api.buildNode.covertData(d.data || []).filter(it => it.lvl.length == 2);
- this.maxWidth=200*this.projectBuildNode.length;
- let n=0;
- for(let i=0;i {
- this.laborPersonnelTotal=0;
- this.laborPersonnelData=[{text: "劳务人员", value: 0},{text: "监理人员", value: 0},{text: "总包人员", value: 0}];
- if(d.rows.length>0 && d.rows[0]!=null){
- this.laborPersonnelData=[];
- this.laborPersonnelTotal += d.rows[0].servicePersonnel;
- this.laborPersonnelData.push({text: "劳务人员", value: d.rows[0].servicePersonnel});
- this.laborPersonnelTotal += d.rows[0].supervisorPersonnel;
- this.laborPersonnelData.push({text: "监理人员", value: d.rows[0].supervisorPersonnel});
- this.laborPersonnelTotal += d.rows[0].contractorPersonnel;
- this.laborPersonnelData.push({text: "总包人员", value: d.rows[0].contractorPersonnel});
- }
- });
-
+ this.$api.attendance.getDeptWorksList(this.dept?.id || 0, this.project?.id || 0).then(d => {
+ this.laborPersonnelTotal = 0;
+ this.laborPersonnelData = [{ text: "劳务人员", value: 0 }, { text: "监理人员", value: 0 }, { text: "总包人员", value: 0 }];
+ if (d.rows.length > 0 && d.rows[0] != null) {
+ this.laborPersonnelData = [];
+ this.laborPersonnelTotal += d.rows[0].servicePersonnel;
+ this.laborPersonnelData.push({ text: "劳务人员", value: d.rows[0].servicePersonnel });
+ this.laborPersonnelTotal += d.rows[0].supervisorPersonnel;
+ this.laborPersonnelData.push({ text: "监理人员", value: d.rows[0].supervisorPersonnel });
+ this.laborPersonnelTotal += d.rows[0].contractorPersonnel;
+ this.laborPersonnelData.push({ text: "总包人员", value: d.rows[0].contractorPersonnel });
+ }
+ });
+
} else {
//查询出勤人数
- this.$api.attendance.getWorkAttendanceList(this.dept?.id||0,this.project?.id||0).then(d => {
- this.laborPersonnelTotal=0;
- this.laborPersonnelData=[{text: "劳务人员", value: 0},{text: "监理人员", value: 0},{text: "总包人员", value: 0}];
- if(d.rows.length>0 && d.rows[0]!=null){
- this.laborPersonnelData=[];
- this.laborPersonnelTotal += d.rows[0].servicePersonnel;
- this.laborPersonnelData.push({text: "劳务人员", value: d.rows[0].servicePersonnel});
- this.laborPersonnelTotal += d.rows[0].supervisorPersonnel;
- this.laborPersonnelData.push({text: "监理人员", value: d.rows[0].supervisorPersonnel});
- this.laborPersonnelTotal += d.rows[0].contractorPersonnel;
- this.laborPersonnelData.push({text: "总包人员", value: d.rows[0].contractorPersonnel});
- }
- });
+ this.$api.attendance.getWorkAttendanceList(this.dept?.id || 0, this.project?.id || 0).then(d => {
+ this.laborPersonnelTotal = 0;
+ this.laborPersonnelData = [{ text: "劳务人员", value: 0 }, { text: "监理人员", value: 0 }, { text: "总包人员", value: 0 }];
+ if (d.rows.length > 0 && d.rows[0] != null) {
+ this.laborPersonnelData = [];
+ this.laborPersonnelTotal += d.rows[0].servicePersonnel;
+ this.laborPersonnelData.push({ text: "劳务人员", value: d.rows[0].servicePersonnel });
+ this.laborPersonnelTotal += d.rows[0].supervisorPersonnel;
+ this.laborPersonnelData.push({ text: "监理人员", value: d.rows[0].supervisorPersonnel });
+ this.laborPersonnelTotal += d.rows[0].contractorPersonnel;
+ this.laborPersonnelData.push({ text: "总包人员", value: d.rows[0].contractorPersonnel });
+ }
+ });
}
},
//项目介绍弹窗
projectIntroduction() {
//this.popupShow = true
- this.$refs.prjInfoDlg.showDialog(this.prjs,this.project,this.projectUsers);
+ this.$refs.prjInfoDlg.showDialog(this.prjs, this.project, this.projectUsers);
},
closeProjectIntroduction() {
this.popupShow = false
},
doPrjRes(n, text) {
this.prjResNav = n;
+ if (n == '06') {
+ this.prjResultsData = this.finishBuildNode.filter(d => d.lvl.length == 4 && d.lvl.substring(0, 2) == '06').map(it => {
+ if (it.files) {
+ it.files = JSON.parse(it.files);
+ } else {
+ it.files = [];
+ }
+ return it;
+ });
+ } else {
+ this.prjResultsData = this.finishBuildNode.filter(d => d.lvl.length == 6 && d.lvl.substring(0, 2) == n).map(it => {
+ if (it.files) {
+ it.files = JSON.parse(it.files);
+ } else {
+ it.files = [];
+ }
+ return it;
+ });
+ }
},
//造价
modifyLeftBtn() {
@@ -1168,7 +1236,8 @@ export default {
};
-
\ No newline at end of file
+
+ .prj-finish-node {
+ .el-table__body-wrapper {
+ &::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ }
+
+ &::-webkit-scrollbar-thumb {
+ background-color: rgb(1, 169, 255);
+ border-radius: 4px;
+ }
+
+ tr {
+ cursor: pointer;
+ }
+ }
+ }
+
+
+}
+.prj-detail-finish-node-pop{
+.node-file-list{
+ .node-file-item{
+ line-height: 24px;
+ cursor: pointer;
+ &:hover{
+ color:rgb(1, 169, 255);
+ }
+ }
+ }
+}
+
\ No newline at end of file
diff --git a/src/utils/request.js b/src/utils/request.js
index 5449f27..484053e 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -120,9 +120,9 @@ service.interceptors.response.use(res => {
)
// 通用下载方法
-export function download(url, params, filename, config) {
+export function download(url, params, filename, config={}) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
- return service.post(url, params, {
+ return service.get(url, params, {
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
@@ -146,5 +146,7 @@ export function download(url, params, filename, config) {
})
}
+
+
export { axios,service}
export default service