Commit 0d5acdc9 authored by tianhongyang's avatar tianhongyang

fix menu

parent 30f8ca3b
import request from '@/utils/request' import request from '@/utils/request';
/**
* 获取项目详情
* @param {*} params
* @returns
*/
export const getProjectDetailApi = (params = {}) => request({
url: "",
method: "get",
params
});
//校验项目编码是否存在 //校验项目编码是否存在
export function checkProjectCodeExist (data) { export function checkProjectCodeExist(data) {
return request({ return request({
url: '/cbProjectRecord/checkProjectCodeExist/'+data, url: '/cbProjectRecord/checkProjectCodeExist/' + data,
method: 'get', method: 'get',
}) });
} }
//新增项目 //新增项目
export function addProject (data) { export function addProject(data) {
return request({ return request({
url: '/cbProjectRecord/addProject', url: '/cbProjectRecord/addProject',
method: 'post', method: 'post',
data:data, data: data,
}) });
} }
//修改项目 //修改项目
export function editProjectInfo (data) { export function editProjectInfo(data) {
return request({ return request({
url: '/cbProjectRecord/editProjectInfo', url: '/cbProjectRecord/editProjectInfo',
method: 'PUT', method: 'PUT',
data:data, data: data,
}) });
} }
//新增新阶段项目 //新增新阶段项目
export function addNewStageProject (data) { export function addNewStageProject(data) {
return request({ return request({
url: '/cbProjectRecord/addNewStageProject', url: '/cbProjectRecord/addNewStageProject',
method: 'POST', method: 'POST',
data:data, data: data,
}) });
} }
//获取当前项目文件上传 //获取当前项目文件上传
export function getProjectFileUploadDetail (projectId) { export function getProjectFileUploadDetail(projectId) {
return request({ return request({
url: '/cbProjectFile/getProjectFileUploadDetail/'+projectId, url: '/cbProjectFile/getProjectFileUploadDetail/' + projectId,
method: 'get', method: 'get',
}) });
} }
//获取草稿箱列表 //获取草稿箱列表
export function getDraftDialogList (projectId) { export function getDraftDialogList(projectId) {
return request({ return request({
url: '/cbProjectRecord/getDraftDialogList', url: '/cbProjectRecord/getDraftDialogList',
method: 'get', method: 'get',
}) });
} }
//上传文件 //上传文件
export function uploadCbProjectFile (data) { export function uploadCbProjectFile(data) {
return request({ return request({
url: '/cbProjectFile/uploadCbProjectFile', url: '/cbProjectFile/uploadCbProjectFile',
method: 'post', method: 'post',
data data
}) });
} }
//删除文件 //删除文件
export function deleteCbProjectFile (fileId) { export function deleteCbProjectFile(fileId) {
return request({ return request({
url: '/cbProjectFile/deleteCbProjectFile/'+fileId, url: '/cbProjectFile/deleteCbProjectFile/' + fileId,
method: 'Delete', method: 'Delete',
}) });
} }
//删除草稿 //删除草稿
export function deleteDraft (projectId) { export function deleteDraft(projectId) {
return request({ return request({
url: '/cbProjectRecord/deleteDraft/'+projectId, url: '/cbProjectRecord/deleteDraft/' + projectId,
method: 'Delete', method: 'Delete',
}) });
} }
//查询当前项目可删除成本阶段 //查询当前项目可删除成本阶段
export function getProjectCbStageNotDraft (relatedId) { export function getProjectCbStageNotDraft(relatedId) {
return request({ return request({
url: '/cbProjectRecord/getProjectCbStageNotDraft/'+relatedId, url: '/cbProjectRecord/getProjectCbStageNotDraft/' + relatedId,
method: 'get', method: 'get',
}) });
} }
// 工料汇总
/**
* 获取供料汇总左侧菜单
* @param {*} params
* @returns
*/
export const getFeedSummaryMenuTreeApi = (params = {}) => request({
url: "/cb/quantity/summary/subjectTree",
method: "get",
params
})
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="feed-summary-container"> <div class="feed-summary-container">
<div class="feed-summary-inner"> <div class="feed-summary-inner">
<div class="left-side-menu"> <div class="left-side-menu">
<project-side-menu :menuTree="menuTreeList" :unique-opened="false" :default-active="defaultActive"> <project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive">
<template slot="房建类成本科目-1"> <template slot="房建类成本科目-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_2.svg" alt=""> <img src="@/assets/images/projectCostLedger/icon_cost_detail_2.svg" alt="">
<div class="project-sub-menu-title-text">房建类成本科目</div> <div class="project-sub-menu-title-text">房建类成本科目</div>
...@@ -18,74 +18,110 @@ ...@@ -18,74 +18,110 @@
</template> </template>
<script> <script>
import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu"; import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu";
import { getFeedSummaryMenuTreeApi } from "@/api/projectCostLedger";
export default { export default {
name: "feedSummary", name: "feedSummary",
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: { components: {
ProjectSideMenu ProjectSideMenu
}, },
data() { data() {
return { return {
menuOptions: {
nodeName: "name",
nodeValue: "name",
},
comProjectDetailInfo: {},
comProjectId: "",
defaultActive: "", defaultActive: "",
menuTreeList: [ menuTreeList: [
{ // {
nodeName: "房建类成本科目", // nodeName: "房建类成本科目",
id: "1", // id: "1",
children: [ // children: [
{ // {
nodeName: "劳务分包工程", // nodeName: "劳务分包工程",
id: "1-1", // id: "1-1",
children: [ // children: [
{ // {
nodeName: "主体工程-结构劳务", // nodeName: "主体工程-结构劳务",
id: "1-1-1", // id: "1-1-1",
children: [ // children: [
{ // {
nodeName: "结构劳务分包", // nodeName: "结构劳务分包",
id: "1-1-1-1", // id: "1-1-1-1",
} // }
] // ]
}, // },
{ // {
nodeName: "二次结构及粗装修劳务", // nodeName: "二次结构及粗装修劳务",
id: "1-2-1", // id: "1-2-1",
children: [ // children: [
{ // {
nodeName: "二次机构及粗装修劳务", // nodeName: "二次机构及粗装修劳务",
id: "1-2-1", // id: "1-2-1",
} // }
] // ]
}, // },
{ // {
nodeName: "拆除、修缮、清理、改造劳...", // nodeName: "拆除、修缮、清理、改造劳...",
id: "1-3-1", // id: "1-3-1",
children: [ // children: [
{ // {
nodeName: "拆除、修缮、清理、改造劳...", // nodeName: "拆除、修缮、清理、改造劳...",
id: "1-3-1", // id: "1-3-1",
} // }
] // ]
} // }
] // ]
}, // },
{ // {
nodeName: "专业分包工程", // nodeName: "专业分包工程",
id: "2-1", // id: "2-1",
}, // },
{ // {
nodeName: "实体工程材料(土建)", // nodeName: "实体工程材料(土建)",
id: "3-1", // id: "3-1",
}, // },
{ // {
nodeName: "其他直接费成本", // nodeName: "其他直接费成本",
id: "4-1", // id: "4-1",
}, // },
] // ]
}, // },
{ // {
nodeName: "未归类项目", // nodeName: "未归类项目",
id: "2", // id: "2",
children: [] // children: []
} // }
] ]
}; };
}, },
...@@ -99,7 +135,29 @@ export default { ...@@ -99,7 +135,29 @@ export default {
}, },
//方法集 //方法集
methods: { methods: {
async init(detail = {}) {
try {
const { projectId, cbStage } = detail;
if (!projectId) return;
await this.getFeedSummaryMenuTree({
projectId,
cbStage
});
} catch (error) {
}
},
async getFeedSummaryMenuTree(params) {
try {
const result = await getFeedSummaryMenuTreeApi(params);
if (result.code == 200) {
const _tempArray = result.data;
this.menuTreeList = _tempArray;
}
} catch (error) {
}
}
}, },
} }
</script> </script>
......
...@@ -85,11 +85,11 @@ export default { ...@@ -85,11 +85,11 @@ export default {
//方法集 //方法集
methods: { methods: {
// 事件订阅 // 事件订阅
subMenuOpen(menuPath) { subMenuOpen(menuPath, menuPathArray) {
this.$emit("open", menuPath); this.$emit("open", menuPath, menuPathArray);
}, },
subMenuClose(menuPath) { subMenuClose(menuPath, menuPathArray) {
this.$emit("close", menuPath); this.$emit("close", menuPath, menuPathArray);
}, },
menuSelect(menuPath) { menuSelect(menuPath) {
const result = this.getCurrentData(menuPath); const result = this.getCurrentData(menuPath);
...@@ -120,11 +120,12 @@ export default { ...@@ -120,11 +120,12 @@ export default {
// 合并默认配置 // 合并默认配置
const _options = this.mergeMenuOptions(JSON.parse(JSON.stringify(this.menuOptions))); const _options = this.mergeMenuOptions(JSON.parse(JSON.stringify(this.menuOptions)));
this.tempMenuOptions = _options; this.tempMenuOptions = _options;
console.log(this.tempMenuOptions);
// 映射配置 // 映射配置
const resultData = this.mapDataByMenuOptions(JSON.parse(JSON.stringify(this.comMenuTree)), _options); // const resultData = this.mapDataByMenuOptions(JSON.parse(JSON.stringify(this.comMenuTree)), _options);
if (resultData) { // if (resultData) {
this.tempMenuTree = resultData; // this.tempMenuTree = resultData;
} // }
} }
}, },
mergeMenuOptions(options) { mergeMenuOptions(options) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<direct-cost v-if="current == 'directCost'"></direct-cost> <direct-cost v-if="current == 'directCost'"></direct-cost>
<!-- 工料汇总 --> <!-- 工料汇总 -->
<feed-summary v-if="current == 'feedSummary'"></feed-summary> <feed-summary v-if="current == 'feedSummary'" :project-id="projectID" :project-detail-info="detailInfo"></feed-summary>
<!-- 其他项目 --> <!-- 其他项目 -->
<other-projects v-if="current == 'otherItems'"></other-projects> <other-projects v-if="current == 'otherItems'"></other-projects>
...@@ -37,6 +37,7 @@ import FeedSummary from "@/views/projectCostLedger/detail/components/FeedSummary ...@@ -37,6 +37,7 @@ 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 { v4 } from "uuid"; import { v4 } from "uuid";
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import { getProjectDetailApi } from "@/api/projectCostLedger";
export default { export default {
name: "projectCostLedgerDetail", name: "projectCostLedgerDetail",
components: { components: {
...@@ -52,7 +53,10 @@ export default { ...@@ -52,7 +53,10 @@ export default {
projectID: "", projectID: "",
current: "", current: "",
// 详情信息变量 // 详情信息变量
detailInfo: {}, detailInfo: {
projectId: "1754425038355890177",
cbStage: 0
},
toggleTabs: [ toggleTabs: [
{ {
value: "basicEngineeringInformation", value: "basicEngineeringInformation",
......
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