Commit 88862b3f authored by huangjie's avatar huangjie

*

parent 5165b094
...@@ -34,6 +34,13 @@ export function editProjectInfo(data) { ...@@ -34,6 +34,13 @@ export function editProjectInfo(data) {
data: data, data: data,
}); });
} }
//删除项目
export function batchDeleteProject(ids) {
return request({
url: '/cbProjectRecord/batchDeleteProject/'+ids,
method: 'Delete',
});
}
//新增新阶段项目 //新增新阶段项目
export function addNewStageProject(data) { export function addNewStageProject(data) {
return request({ return request({
...@@ -90,6 +97,23 @@ export function getProjectCbStageNotDraft(relatedId) { ...@@ -90,6 +97,23 @@ export function getProjectCbStageNotDraft(relatedId) {
}); });
} }
//查询当前项目可删除成本阶段
export function getProjectList(data) {
return request({
url: '/cbProjectRecord/getProjectList',
method: 'get',
params:data
});
}
//盈亏分析对比 左侧菜单
export const getProfitLossMenuTreeApi = (params = {}) => request({
url: "/cbSummary/cbNameList",
method: "get",
params
})
// 工料汇总 // 工料汇总
/** /**
......
<template>
<div class="otherProjects-container">
<div class="otherProjects-cont">
<div class="left">
<div class="left-menu">
</div>
</div>
<!--<div class="right-table">-->
<!--<div class="table-item">-->
<!--<tables-->
<!--v-if="!isSkeleton"-->
<!--:tableLoading="tableLoading"-->
<!--:tableData="tableData"-->
<!--:forData="forData1"-->
<!--:MaxPage=500-->
<!--:tableDataTotal="tableDataTotal"-->
<!--:queryParams="queryParams"-->
<!--@handle-current-change="handleCurrentChange"-->
<!--@sort-change="sortChange"-->
<!--&gt;-->
<!--<template slot="number" slot-scope="scope">-->
<!--<div>{{scope.row.number || '&#45;&#45;'}}</div>-->
<!--</template>-->
<!--<template slot="proportion" slot-scope="scope">-->
<!--<div>{{scope.row.proportion || '&#45;&#45;'}}{{scope.row.proportion ? '%':''}}</div>-->
<!--</template>-->
<!--</tables>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</template>
<script>
import Tables from "../../../../component/Tables"
import {getProfitLossMenuTreeApi} from '@/api/projectCostLedger/index'
export default {
name: "ProfitLoss",
props:{
// 项目ID
projectId: {
type: String,
required: true,
default: ""
},
// // 详情信息
// projectDetailInfo: {
// type: Object,
// default: () => ({})
// }
},
watch: {
// projectDetailInfo: {
// handler(newValue) {
// this.comProjectDetailInfo = newValue ? newValue : {};
// this.init(this.comProjectDetailInfo);
// },
// deep: true,
// immediate: true
// },
// projectId: {
// handler(newValue) {
// this.comProjectId = newValue;
// },
// immediate: true
// }
},
components: {
Tables,
},
data() {
return {
menuOptions: {
nodeName: "name",
nodeValue: "name",
},
comProjectDetailInfo: {},
comProjectId: "",
defaultActive: "",
menuTreeList: [
// {
// nodeName: "房建类成本科目",
// id: "1",
// children: [
// {
// nodeName: "劳务分包工程",
// id: "1-1",
// children: [
// {
// nodeName: "主体工程-结构劳务",
// id: "1-1-1",
// children: [
// {
// nodeName: "结构劳务分包",
// id: "1-1-1-1",
// }
// ]
// },
// {
// nodeName: "二次结构及粗装修劳务",
// id: "1-2-1",
// children: [
// {
// nodeName: "二次机构及粗装修劳务",
// id: "1-2-1",
// }
// ]
// },
// {
// nodeName: "拆除、修缮、清理、改造劳...",
// id: "1-3-1",
// children: [
// {
// nodeName: "拆除、修缮、清理、改造劳...",
// id: "1-3-1",
// }
// ]
// }
// ]
// },
// {
// nodeName: "专业分包工程",
// id: "2-1",
// },
// {
// nodeName: "实体工程材料(土建)",
// id: "3-1",
// },
// {
// nodeName: "其他直接费成本",
// id: "4-1",
// },
// ]
// },
// {
// nodeName: "未归类项目",
// id: "2",
// children: []
// }
]
}
},
//可访问data属性
created() {
console.log(this.projectId)
this.init()
},
//计算集
computed: {
},
async init(detail = {}) {
let cbStage = 1
try {
const { projectId, cbStage } = detail;
if (!projectId) return;
await this.getProfitLossMenuTree({
projectId,
cbStage
});
} catch (error) {
}
},
async getProfitLossMenuTree(params) {
try {
const result = await getProfitLossMenuTreeApi(params);
if (result.code == 200) {
const _tempArray = result.data;
this.menuTreeList = _tempArray;
}
} catch (error) {
}
},
}
</script>
<style lang="scss" scoped>
.otherProjects-container {
width: 100%;
box-sizing: border-box;
background: #ffffff;
height: 100%;
align-items: center;
.otherProjects-cont{
display: flex;
width: 100%;
height: 100%;
}
.left{
width: 220px;
height: 100%;
.left-menu{
width: 100%;
height: 100%;
border-right: 1px solid #eeeeee;
overflow: auto;
}
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
}
.right-table{
width: calc(100% - 220px);
padding: 16px;
}
}
</style>
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
<!-- 其他项目 --> <!-- 其他项目 -->
<other-projects v-if="current == 'otherItems'"></other-projects> <other-projects v-if="current == 'otherItems'"></other-projects>
<!-- 盈亏分析对比 -->
<profit-Loss v-if="current == 'profitAndLoss'" :project-id="projectID"></profit-Loss>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,6 +38,8 @@ import DirectCost from "@/views/projectCostLedger/detail/components/DirectCost"; ...@@ -35,6 +38,8 @@ import DirectCost from "@/views/projectCostLedger/detail/components/DirectCost";
import FeedSummary from "@/views/projectCostLedger/detail/components/FeedSummary"; import FeedSummary from "@/views/projectCostLedger/detail/components/FeedSummary";
// 其他项目 // 其他项目
import OtherProjects from "@/views/projectCostLedger/detail/components/OtherProjects"; import OtherProjects from "@/views/projectCostLedger/detail/components/OtherProjects";
// 盈亏分析对比
import ProfitLoss from "@/views/projectCostLedger/detail/components/ProfitLoss";
import { v4 } from "uuid"; import { v4 } from "uuid";
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import { getProjectDetailApi } from "@/api/projectCostLedger"; import { getProjectDetailApi } from "@/api/projectCostLedger";
...@@ -46,7 +51,8 @@ export default { ...@@ -46,7 +51,8 @@ export default {
FeedSummary, FeedSummary,
EngineeringInformation, EngineeringInformation,
DirectCost, DirectCost,
OtherProjects OtherProjects,
ProfitLoss
}, },
data() { data() {
return { return {
......
...@@ -10,18 +10,18 @@ ...@@ -10,18 +10,18 @@
<el-form :model="formdata" label-width="82px" label-position="right" :inline="true" > <el-form :model="formdata" label-width="82px" label-position="right" :inline="true" >
<el-row> <el-row>
<el-form-item label="工程名称"> <el-form-item label="工程名称">
<el-input v-model="formdata.customerName" placeholder="请输入工程名称" clearable></el-input> <el-input v-model="formdata.projectName" placeholder="请输入工程名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="IPM项目编码" label-width="100px"> <el-form-item label="IPM项目编码" label-width="100px">
<el-input v-model="formdata.customerName" placeholder="请输入IPM项目编码" clearable></el-input> <el-input v-model="formdata.ipmProjectNo" placeholder="请输入IPM项目编码" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="成本阶段"> <el-form-item label="成本阶段">
<el-select v-model="formdata.customerClass" placeholder="请选择" :collapse-tags="true" clearable> <el-select v-model="formdata.cbStage" placeholder="请选择" :collapse-tags="true" clearable>
<el-option v-for="(item,index) in cbStagelist" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option> <el-option v-for="(item,index) in cbStagelist" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="项目状态"> <el-form-item label="项目状态">
<el-select v-model="formdata.customerClass" placeholder="请选择" :collapse-tags="true" clearable> <el-select v-model="formdata.projectFileStatus" placeholder="请选择" :collapse-tags="true" clearable>
<el-option v-for="(item,index) in ztStagelist" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option> <el-option v-for="(item,index) in ztStagelist" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<!--<el-tooltip placement="top" v-if="scope.row.customerText.length>20">--> <!--<el-tooltip placement="top" v-if="scope.row.customerText.length>20">-->
<!--<div slot="content">{{scope.row.customerText}}</div>--> <!--<div slot="content">{{scope.row.projectName}}</div>-->
<!--<div class="renling">--> <div class="renling">
<!--<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"--> <router-link v-if="scope.row.isGetProjectDetail" :to="`/projectCostLedger/detail?projectID=${scope.row.id}`" tag="a"
<!--class="wordprimary" v-html="scope.row.customerName"></router-link>--> class="wordprimary" v-html="scope.row.projectName"></router-link>
<!--<span v-else v-html="scope.row.customerName"></span>--> <span v-else v-html="scope.row.projectName"></span>
<!--</div>--> </div>
<!--</el-tooltip>--> <!--</el-tooltip>-->
<!--<div class="renling" v-else>--> <!--<div class="renling" v-else>-->
<!--<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"--> <!--<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"-->
...@@ -82,34 +82,46 @@ ...@@ -82,34 +82,46 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目状态" prop="customerCode" width="90" :resizable="false"> <el-table-column label="项目状态" prop="customerCode" width="100" :resizable="false">
<template slot-scope="scope">
<template v-for="item in ztStagelist">
<template v-if="item.dictValue == scope.row.projectFileStatus">
<span class="zts" :class="'zt'+scope.row.projectFileStatus">{{item.dictLabel}}</span>
</template>
</template>
</template>
</el-table-column> </el-table-column>
<el-table-column label="IPM项目编码" min-width="136"> <el-table-column label="IPM项目编码" min-width="136">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.recommendOrg||"--"}} {{scope.row.ipmProjectNo||"--"}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文件名称" min-width="286" :resizable="false"> <el-table-column label="文件名称" min-width="286" :resizable="false">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.registerRegion||"--"}} {{scope.row.projectFileName||"--"}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成本阶段" prop="customerCode" width="90" :resizable="false"> <el-table-column label="成本阶段" prop="customerCode" width="90" :resizable="false">
<template slot-scope="scope">
<template v-for="item in cbStagelist">
<template v-if="item.dictValue == scope.row.cbStage">{{item.dictLabel}}</template>
</template>
</template>
</el-table-column> </el-table-column>
<el-table-column label="上传人" prop="customerCode" width="90" :resizable="false"> <el-table-column label="上传人" prop="updateBy" width="90" :resizable="false">
</el-table-column> </el-table-column>
<el-table-column label="上传时间" min-width="180" :resizable="false"> <el-table-column label="上传时间" min-width="180" :resizable="false">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.approveDate2||"--"}} {{scope.row.updateTime||"--"}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="256" :resizable="false" fixed="right"> <el-table-column label="操作" min-width="260" :resizable="false" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="wordprimary tabs" @click="editpro(scope.row)">修改项目信息</span> <span class="wordprimary tabs" @click="editpro(scope.row)">修改项目信息</span>
<span class="wordprimary tabs" @click="detailpro(scope.row)">查看导入进度</span> <span class="wordprimary tabs" @click="detailpro(scope.row)">查看导入进度</span>
<span class="worddel tabs" @click="deleetpro(scope.row)">删除</span> <span class="worddel tabs" v-if="scope.row.projectFileStatus != 1" @click="deleetpro(scope.row)">删除</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -124,12 +136,12 @@ ...@@ -124,12 +136,12 @@
<el-dialog title="删除项目" :visible.sync="deletevisible" width="480px" custom-class='dialog-supplier'> <el-dialog title="删除项目" :visible.sync="deletevisible" width="480px" custom-class='dialog-supplier'>
<el-divider></el-divider> <el-divider></el-divider>
<div class="protypes"> <div class="protypes">
<div class="ck" v-if="typenum>1">项目台账共有3个阶段</div> <div class="ck" v-if="typenum>1">项目台账共有{{typenum}}个阶段</div>
<div class="ck" v-else>是否删除此项目?删除后无法返回。</div> <div class="ck" v-else>是否删除此项目?删除后无法返回。</div>
<div class="ck"><el-checkbox :indeterminate="indeterminate" v-model="checkAll" @change="handleCheckAllChange">删除全部</el-checkbox></div> <div class="ck" v-if="typenum>1"><el-checkbox :indeterminate="indeterminate" v-model="checkAll" @change="handleCheckAllChange">删除全部</el-checkbox></div>
<el-checkbox-group v-model="checkds" @change="handleCheck"> <el-checkbox-group v-model="checkds" @change="handleCheck">
<div class="ck" v-for="(item,index) in allchecks"> <div class="ck" v-for="(item,index) in allchecks">
<el-checkbox :key="index" :label="item.label">{{item.text}}</el-checkbox> <el-checkbox :key="index" :label="item.id">{{item.text}}</el-checkbox>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -139,6 +151,7 @@ ...@@ -139,6 +151,7 @@
<el-button type="primary" size="small" @click="getDelete">确定删除</el-button> <el-button type="primary" size="small" @click="getDelete">确定删除</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--新增、修改弹窗-->
<el-dialog <el-dialog
class="pro-news" class="pro-news"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
...@@ -169,7 +182,7 @@ ...@@ -169,7 +182,7 @@
<div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div> <div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div>
<div class="btn btn_primary h32" v-if="isedit && !ischeck" @click="savepro">保存</div> <div class="btn btn_primary h32" v-if="isedit && !ischeck" @click="savepro">保存</div>
<div class="btn btn_primary h32" v-if="isedit && ischeck" @click="changepro">下一步,导入数据</div> <div class="btn btn_primary h32" v-if="isedit && ischeck" @click="changepro">下一步,导入数据</div>
<div class="btn btn_primary h32" v-if="!isedit && !ischeck" @click="insertPro" :class="{'btn_disabled':!queryParam.cbStage}" :disabled="!queryParam.cbStage">下一步,导入数据</div> <div class="btn btn_primary h32" v-if="!isedit && ischeck" @click="insertPro" :class="{'btn_disabled':!queryParam.cbStage}" :disabled="!queryParam.cbStage">下一步,导入数据</div>
</div> </div>
</el-dialog> </el-dialog>
...@@ -233,7 +246,7 @@ ...@@ -233,7 +246,7 @@
checkProjectCodeExist, checkProjectCodeExist,
deleteDraft, deleteDraft,
editProjectInfo, editProjectInfo,
getDraftDialogList,getProjectCbStageNotDraft getDraftDialogList,getProjectCbStageNotDraft,getProjectList,batchDeleteProject
} from '@/api/projectCostLedger/index' } from '@/api/projectCostLedger/index'
import { getDicts } from '@/api/system/dict/data' import { getDicts } from '@/api/system/dict/data'
import proupload from '@/views/projectCostLedger/upload/index' import proupload from '@/views/projectCostLedger/upload/index'
...@@ -244,10 +257,13 @@ ...@@ -244,10 +257,13 @@
components:{proupload,skeleton}, components:{proupload,skeleton},
data() { data() {
return { return {
typenum:2, typenum:0,
formdata:{}, formdata:{
pageNum:1,
pageSize:50,
},
isSkeleton:false, isSkeleton:false,
total:10, total:0,
protitle:'', protitle:'',
dialogVisible:false, dialogVisible:false,
cbStagelist:[], cbStagelist:[],
...@@ -306,15 +322,25 @@ ...@@ -306,15 +322,25 @@
}, },
//方法集 //方法集
methods: { methods: {
//获取台账列表
getlist(){ getlist(){
getProjectList(this.formdata).then(res=>{
if(res.code == 200){
this.total = res.total
this.formdata.pageNum = res.currentPage
this.tableData = res.rows
}else{
this.total = 0
this.tableData = []
}
})
}, },
handleCheckAllChange(val){ handleCheckAllChange(val){
this.checkAll = val this.checkAll = val
this.checkds = [] this.checkds = []
if(val == true){ if(val == true){
this.allchecks.forEach(item=>{ this.allchecks.forEach(item=>{
this.checkds.push(item.label) this.checkds.push(item.id)
}) })
} }
this.indeterminate = false this.indeterminate = false
...@@ -333,8 +359,8 @@ ...@@ -333,8 +359,8 @@
this.ischeck = false this.ischeck = false
this.prodetail = false this.prodetail = false
this.dialogVisible = true this.dialogVisible = true
this.queryParam = {} row.cbStage = row.cbStage.toString()
this.queryParam = [...this.queryParam,...row] this.queryParam = JSON.parse(JSON.stringify(row))
this.protitle = '修改项目信息' this.protitle = '修改项目信息'
}, },
//查看进度 //查看进度
...@@ -347,27 +373,40 @@ ...@@ -347,27 +373,40 @@
deleetpro(row){ deleetpro(row){
this.deletevisible = true this.deletevisible = true
this.prodetail = false this.prodetail = false
console.log(row.relatedId)
if(row.hasChildren){//有多个阶段
getProjectCbStageNotDraft(row.relatedId).then(res=>{ getProjectCbStageNotDraft(row.relatedId).then(res=>{
let list = res.data let list = res.data
let cb = this.cbStagelist let cb = this.cbStagelist
let datas = [] let datas = []
list.forEach(item =>{ cb.forEach(item=>{
cb.for(i=>{ list.forEach(i =>{
if(item.dictValue == i){ if(item.dictValue == i.cbStage){
let arr = {'label':i,'text':item.dictLabel} let arr = {'label':i.cbStage,'text':item.dictLabel,'id':i.id}
datas.push(arr) datas.push(arr)
} }
}) })
}) })
this.allchecks = datas this.allchecks = datas
this.typenum = list.length this.typenum = list.length
this.checkds = [] this.checkds = []
}) })
}else{
this.checkds = [row.id]
this.typenum = 1
}
}, },
getDelete(){ getDelete(){
// this.checkds 勾选了要删除的数据 batchDeleteProject(this.checkds).then(res=>{
if(res.code == 200){
this.$message.success(res.msg)
this.getlist()
this.deletevisible = false
}else{
this.$message.error(res.msg)
}
})
this.getlist() this.getlist()
}, },
//返回列表 //返回列表
...@@ -406,17 +445,10 @@ ...@@ -406,17 +445,10 @@
}, },
clears(){ clears(){
this.formdata={ this.formdata={
customerName: '', projectName:'',
customerClass:[], ipmProjectNo:'',
areas:[], cbStage:'',
province:[], projectFileStatus:'',
city:[],
customerState:[],
creditLevel:[],
credential:[],
approveDateBegion:null,
approveDateEnd:null,
times:[],
pageSize:50, pageSize:50,
pageNum:1, pageNum:1,
} }
...@@ -433,6 +465,7 @@ ...@@ -433,6 +465,7 @@
}, },
//修改项目 //修改项目
savepro(){ savepro(){
this.queryParam.projectId = this.queryParam.id
editProjectInfo(JSON.stringify(this.queryParam)).then(res=>{ editProjectInfo(JSON.stringify(this.queryParam)).then(res=>{
if(res.code == 200){ if(res.code == 200){
this.dialogVisible = false this.dialogVisible = false
...@@ -442,10 +475,11 @@ ...@@ -442,10 +475,11 @@
}, },
//修改阶段 //修改阶段
changepro(){ changepro(){
addNewStageProject(JSON.parse(JSON.stringify(this.queryParam))).then(res=>{ this.queryParam.projectId = this.queryParam.id
addNewStageProject(JSON.stringify(this.queryParam)).then(res=>{
this.uploadData = res.data this.uploadData = res.data
this.uploadData.id = this.uploadData.projectId
this.isupload = true this.isupload = true
this.prodetail = false
}) })
}, },
//继续编辑 //继续编辑
...@@ -738,7 +772,7 @@ ...@@ -738,7 +772,7 @@
padding: 0; padding: 0;
} }
} }
.wordprimary{ .wordprimary.tabs{
margin-left: 12px; margin-left: 12px;
} }
.worddel{ .worddel{
...@@ -763,4 +797,22 @@ ...@@ -763,4 +797,22 @@
} }
} }
} }
.renling{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 390px;
}
.zts{
padding: 0 8px;
height: 20px;
line-height: 20px;
display: inline-block;
color: #fff;
&.zt1{
background: #FFAB44;
}
&.zt2{background: #0CBC6D}
&.zt3{background: #FF3C3C}
}
</style> </style>
...@@ -275,6 +275,7 @@ ...@@ -275,6 +275,7 @@
this.formdata = JSON.parse(JSON.stringify(this.uploadData)) this.formdata = JSON.parse(JSON.stringify(this.uploadData))
this.formdata.cbStage = this.formdata.cbStage.toString() this.formdata.cbStage = this.formdata.cbStage.toString()
this.getDetail() this.getDetail()
console.log(this.uploadData)
}, },
methods:{ methods:{
goback(){ goback(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment