Commit 88862b3f authored by huangjie's avatar huangjie

*

parent 5165b094
......@@ -2,8 +2,8 @@ import request from '@/utils/request';
/**
* 获取项目详情
* @param {*} params
* @returns
* @param {*} params
* @returns
*/
export const getProjectDetailApi = (params = {}) => request({
url: "",
......@@ -34,6 +34,13 @@ export function editProjectInfo(data) {
data: data,
});
}
//删除项目
export function batchDeleteProject(ids) {
return request({
url: '/cbProjectRecord/batchDeleteProject/'+ids,
method: 'Delete',
});
}
//新增新阶段项目
export function addNewStageProject(data) {
return request({
......@@ -90,12 +97,29 @@ 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
})
// 工料汇总
/**
* 获取供料汇总左侧菜单
* @param {*} params
* @returns
* @param {*} params
* @returns
*/
export const getFeedSummaryMenuTreeApi = (params = {}) => request({
url: "/cb/quantity/summary/subjectTree",
......
<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 @@
<!-- 其他项目 -->
<other-projects v-if="current == 'otherItems'"></other-projects>
<!-- 盈亏分析对比 -->
<profit-Loss v-if="current == 'profitAndLoss'" :project-id="projectID"></profit-Loss>
</div>
</div>
</div>
......@@ -35,6 +38,8 @@ import DirectCost from "@/views/projectCostLedger/detail/components/DirectCost";
import FeedSummary from "@/views/projectCostLedger/detail/components/FeedSummary";
// 其他项目
import OtherProjects from "@/views/projectCostLedger/detail/components/OtherProjects";
// 盈亏分析对比
import ProfitLoss from "@/views/projectCostLedger/detail/components/ProfitLoss";
import { v4 } from "uuid";
import { cloneDeep } from "lodash-es";
import { getProjectDetailApi } from "@/api/projectCostLedger";
......@@ -46,7 +51,8 @@ export default {
FeedSummary,
EngineeringInformation,
DirectCost,
OtherProjects
OtherProjects,
ProfitLoss
},
data() {
return {
......
......@@ -10,18 +10,18 @@
<el-form :model="formdata" label-width="82px" label-position="right" :inline="true" >
<el-row>
<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 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 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-select>
</el-form-item>
<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-select>
</el-form-item>
......@@ -65,12 +65,12 @@
<template slot-scope="scope">
<div style="display:flex;align-items:center">
<!--<el-tooltip placement="top" v-if="scope.row.customerText.length>20">-->
<!--<div slot="content">{{scope.row.customerText}}</div>-->
<!--<div class="renling">-->
<!--<router-link v-if="scope.row.companyId" :to="`/enterprise/${encodeStr(scope.row.companyId)}?path=cooperationRecord&companyName=${scope.row.customerName}`" tag="a"-->
<!--class="wordprimary" v-html="scope.row.customerName"></router-link>-->
<!--<span v-else v-html="scope.row.customerName"></span>-->
<!--</div>-->
<!--<div slot="content">{{scope.row.projectName}}</div>-->
<div class="renling">
<router-link v-if="scope.row.isGetProjectDetail" :to="`/projectCostLedger/detail?projectID=${scope.row.id}`" tag="a"
class="wordprimary" v-html="scope.row.projectName"></router-link>
<span v-else v-html="scope.row.projectName"></span>
</div>
<!--</el-tooltip>-->
<!--<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"-->
......@@ -82,34 +82,46 @@
</template>
</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 label="IPM项目编码" min-width="136">
<template slot-scope="scope">
{{scope.row.recommendOrg||"--"}}
{{scope.row.ipmProjectNo||"--"}}
</template>
</el-table-column>
<el-table-column label="文件名称" min-width="286" :resizable="false">
<template slot-scope="scope">
{{scope.row.registerRegion||"--"}}
{{scope.row.projectFileName||"--"}}
</template>
</el-table-column>
<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 label="上传人" prop="customerCode" width="90" :resizable="false">
<el-table-column label="上传人" prop="updateBy" width="90" :resizable="false">
</el-table-column>
<el-table-column label="上传时间" min-width="180" :resizable="false">
<template slot-scope="scope">
{{scope.row.approveDate2||"--"}}
{{scope.row.updateTime||"--"}}
</template>
</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">
<span class="wordprimary tabs" @click="editpro(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>
</el-table-column>
</el-table>
......@@ -124,12 +136,12 @@
<el-dialog title="删除项目" :visible.sync="deletevisible" width="480px" custom-class='dialog-supplier'>
<el-divider></el-divider>
<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"><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">
<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>
</el-checkbox-group>
</div>
......@@ -139,6 +151,7 @@
<el-button type="primary" size="small" @click="getDelete">确定删除</el-button>
</div>
</el-dialog>
<!--新增、修改弹窗-->
<el-dialog
class="pro-news"
:visible.sync="dialogVisible"
......@@ -169,7 +182,7 @@
<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="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>
</el-dialog>
......@@ -233,7 +246,7 @@
checkProjectCodeExist,
deleteDraft,
editProjectInfo,
getDraftDialogList,getProjectCbStageNotDraft
getDraftDialogList,getProjectCbStageNotDraft,getProjectList,batchDeleteProject
} from '@/api/projectCostLedger/index'
import { getDicts } from '@/api/system/dict/data'
import proupload from '@/views/projectCostLedger/upload/index'
......@@ -244,10 +257,13 @@
components:{proupload,skeleton},
data() {
return {
typenum:2,
formdata:{},
typenum:0,
formdata:{
pageNum:1,
pageSize:50,
},
isSkeleton:false,
total:10,
total:0,
protitle:'',
dialogVisible:false,
cbStagelist:[],
......@@ -306,15 +322,25 @@
},
//方法集
methods: {
//获取台账列表
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){
this.checkAll = val
this.checkds = []
if(val == true){
this.allchecks.forEach(item=>{
this.checkds.push(item.label)
this.checkds.push(item.id)
})
}
this.indeterminate = false
......@@ -333,8 +359,8 @@
this.ischeck = false
this.prodetail = false
this.dialogVisible = true
this.queryParam = {}
this.queryParam = [...this.queryParam,...row]
row.cbStage = row.cbStage.toString()
this.queryParam = JSON.parse(JSON.stringify(row))
this.protitle = '修改项目信息'
},
//查看进度
......@@ -347,27 +373,40 @@
deleetpro(row){
this.deletevisible = true
this.prodetail = false
getProjectCbStageNotDraft(row.relatedId).then(res=>{
let list = res.data
let cb = this.cbStagelist
let datas = []
list.forEach(item =>{
cb.for(i=>{
if(item.dictValue == i){
let arr = {'label':i,'text':item.dictLabel}
datas.push(arr)
}
console.log(row.relatedId)
if(row.hasChildren){//有多个阶段
getProjectCbStageNotDraft(row.relatedId).then(res=>{
let list = res.data
let cb = this.cbStagelist
let datas = []
cb.forEach(item=>{
list.forEach(i =>{
if(item.dictValue == i.cbStage){
let arr = {'label':i.cbStage,'text':item.dictLabel,'id':i.id}
datas.push(arr)
}
})
})
this.allchecks = datas
this.typenum = list.length
this.checkds = []
})
this.allchecks = datas
this.typenum = list.length
this.checkds = []
})
}else{
this.checkds = [row.id]
this.typenum = 1
}
},
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()
},
//返回列表
......@@ -406,17 +445,10 @@
},
clears(){
this.formdata={
customerName: '',
customerClass:[],
areas:[],
province:[],
city:[],
customerState:[],
creditLevel:[],
credential:[],
approveDateBegion:null,
approveDateEnd:null,
times:[],
projectName:'',
ipmProjectNo:'',
cbStage:'',
projectFileStatus:'',
pageSize:50,
pageNum:1,
}
......@@ -433,6 +465,7 @@
},
//修改项目
savepro(){
this.queryParam.projectId = this.queryParam.id
editProjectInfo(JSON.stringify(this.queryParam)).then(res=>{
if(res.code == 200){
this.dialogVisible = false
......@@ -442,10 +475,11 @@
},
//修改阶段
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.id = this.uploadData.projectId
this.isupload = true
this.prodetail = false
})
},
//继续编辑
......@@ -738,7 +772,7 @@
padding: 0;
}
}
.wordprimary{
.wordprimary.tabs{
margin-left: 12px;
}
.worddel{
......@@ -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>
......@@ -275,6 +275,7 @@
this.formdata = JSON.parse(JSON.stringify(this.uploadData))
this.formdata.cbStage = this.formdata.cbStage.toString()
this.getDetail()
console.log(this.uploadData)
},
methods:{
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