Commit 1640fc82 authored by huangjie's avatar huangjie

*

parent b4b0bfac
...@@ -112,6 +112,14 @@ export const getProfitLossMenuTreeApi = (params = {}) => request({ ...@@ -112,6 +112,14 @@ export const getProfitLossMenuTreeApi = (params = {}) => request({
method: "get", method: "get",
params params
}) })
//盈亏分析对比 数据列表
export function getAnalysislist(data) {
return request({
url: '/cb/gain/loss/analysis/list',
method: 'get',
params:data
});
}
// 工料汇总 // 工料汇总
......
<template> <template>
<div class="otherProjects-container"> <div class="feed-summary-container">
<div class="otherProjects-cont"> <div class="feed-summary-inner">
<div class="left"> <div class="left-side-menu">
<div class="left-menu"> <project-side-menu ref="profitloss" :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive" >
<template slot="盈亏分析对比-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_7.svg" alt="">
<div class="project-sub-menu-title-text">盈亏分析对比</div>
</template>
</project-side-menu>
</div>
<div class="profitloss">
<div class="search">
<el-date-picker
v-model="expenseDate"
type="month"
placeholder="选择月"
:picker-options="pickerOptions">
</el-date-picker>
</div> </div>
</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>
</div> </div>
</template> </template>
<script> <script>
import Tables from "../../../../component/Tables" import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu";
import {getProfitLossMenuTreeApi} from '@/api/projectCostLedger/index' import { getProfitLossMenuTreeApi,getAnalysislist } from "@/api/projectCostLedger";
export default { export default {
name: "ProfitLoss", name: "orifitloss",
props:{ props: {
// 项目ID // 项目ID
projectId: { projectId: {
type: String, type: String,
required: true, required: true,
default: "" default: ""
}, },
// // 详情信息 // 详情信息
// projectDetailInfo: { projectDetailInfo: {
// type: Object, type: Object,
// default: () => ({}) default: () => ({})
// } }
}, },
watch: { watch: {
// projectDetailInfo: { projectDetailInfo: {
// handler(newValue) { handler(newValue) {
// this.comProjectDetailInfo = newValue ? newValue : {}; this.comProjectDetailInfo = newValue ? newValue : {};
// this.init(this.comProjectDetailInfo); this.init(this.comProjectDetailInfo);
// }, },
// deep: true, deep: true,
// immediate: true immediate: true
// }, },
// projectId: { projectId: {
// handler(newValue) { handler(newValue) {
// this.comProjectId = newValue; this.comProjectId = newValue;
// }, },
// immediate: true immediate: true
// } }
}, },
components: { components: {
Tables, ProjectSideMenu
}, },
data() { data() {
return { return {
pickerOptions: {
disabledDate(time) {
let istrue = true
let month = new Date().getMonth()+1
let year = new Date().getFullYear()
let times = (year+5)+'-'+ month + '-01 ' + '00:00:00'
istrue = new Date().getTime() < time.getTime() && time.getTime() < new Date(times).getTime()
return !istrue
},
},
menuOptions: { menuOptions: {
nodeName: "name", nodeName: "cbName",
nodeValue: "name", nodeValue: "id",
}, },
comProjectDetailInfo: {}, comProjectDetailInfo: {},
comProjectId: "", comProjectId: "",
...@@ -137,72 +139,88 @@ export default { ...@@ -137,72 +139,88 @@ export default {
// id: "2", // id: "2",
// children: [] // children: []
// } // }
] ],
} id: 0,
expenseDate:'',
};
}, },
//可访问data属性 //可访问data属性
created() { created() {
console.log(this.projectId) let month = new Date().getMonth() +1
this.init() let year = new Date().getFullYear()
this.expenseDate = year + '-' + (month>= 9? month:'0'+ month)
}, },
//计算集 //计算集
computed: { computed: {
},
//方法集
methods: {
select(menuPath){
this.id = menuPath
let param = {
id:this.id,
expenseDate:this.expenseDate
}
getAnalysislist(param).then(res=>{
})
}, },
async init(detail = {}) { async init(detail = {}) {
let cbStage = 1
try { try {
const { projectId, cbStage } = detail; const { projectId, cbStage,cbType} = detail;
if (!projectId) return; if (!projectId) return;
await this.getProfitLossMenuTree({ await this.getFeedSummaryMenuTree({
projectId, projectId,
cbStage cbStage,
cbType
}); });
} catch (error) { } catch (error) {
} }
}, },
async getProfitLossMenuTree(params) { async getFeedSummaryMenuTree(params) {
try { try {
const result = await getProfitLossMenuTreeApi(params); const result = await getProfitLossMenuTreeApi(params);
if (result.code == 200) { if (result.code == 200) {
const _tempArray = result.data; let arr = {}
arr.cbName = '盈亏分析对比'
arr.id = 0
arr.children = result.data
const _tempArray = [arr];
this.menuTreeList = _tempArray; this.menuTreeList = _tempArray;
await this.$nextTick()
console.log(this.$refs['profitloss'])
} }
} catch (error) { } catch (error) {
} }
}
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.otherProjects-container { .feed-summary-container {
width: 100%; width: 100%;
box-sizing: border-box;
background: #ffffff;
height: 100%; height: 100%;
align-items: center;
.otherProjects-cont{ .feed-summary-inner {
display: flex;
width: 100%; width: 100%;
height: 100%; height: 100%;
} display: flex;
.left{ align-items: center;
.left-side-menu {
width: 220px; width: 220px;
min-width: 220px;
height: 100%; 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{ .profitloss{
width: calc(100% - 220px); width: calc(100% - 220px);
padding: 16px; height: 100%;
background: #fff;
}
} }
} }
</style> </style>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<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> <profit-Loss v-if="current == 'profitAndLoss'" :project-id="projectID" :project-detail-info="detailInfo"></profit-Loss>
</div> </div>
</div> </div>
...@@ -61,7 +61,8 @@ export default { ...@@ -61,7 +61,8 @@ export default {
// 详情信息变量 // 详情信息变量
detailInfo: { detailInfo: {
projectId: "1754425038355890177", projectId: "1754425038355890177",
cbStage: 0 cbStage: 0,
cbType:1
}, },
toggleTabs: [ toggleTabs: [
{ {
......
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