Commit c570f021 authored by tianhongyang's avatar tianhongyang

merge

parent fbed8aee
......@@ -37,13 +37,13 @@
<!-- 有自定义插槽 -->
<slot v-if="item.slot" :name="item.prop" :row="scope.row" :index="scope.$index" :data="item">
<!-- 默认取值 -->
{{ scope.row[item.prop] || scope.row[item.prop] == '0' ? scope.row[item.prop] : '-' }}
{{ scope.row[item.prop] ? scope.row[item.prop] : '-' }}
</slot>
<!-- 操作栏 不需要设置slot-->
<slot v-else-if="item.prop == 'action-field-bar'" name="action-field-bar" :row="scope.row" :index="scope.$index" :data="item"></slot>
<!-- 没有插槽 -->
<div v-else>
{{ scope.row[item.prop] || scope.row[item.prop] == '0' ? scope.row[item.prop] : '-' }}
{{ scope.row[item.prop] ? scope.row[item.prop] : '-' }}
</div>
</template>
</el-table-column>
......
......@@ -64,7 +64,7 @@ export default {
.cooperation-desk-account-project,
.cooperation-desk-account-enterprise {
overflow: hidden;
height: calc(100% - 48px);
height: calc(100%);
}
}
}
......
......@@ -59,7 +59,7 @@ export default {
.cooperation-desk-account-project,
.cooperation-desk-account-enterprise {
overflow: hidden;
height: calc(100% - 48px);
height: calc(100%);
}
}
}
......
......@@ -2,8 +2,8 @@
<div class="feed-summary-container">
<div class="feed-summary-inner">
<div class="left-side-menu">
<project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="currentNodeName"
@select="menuSelect">
<project-side-menu ref="projectSideMenu" :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false"
:default-active="currentNodeName" @select="menuSelect">
<template slot="房建类成本科目-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_2.svg" alt="">
<div class="project-sub-menu-title-text">房建类成本科目</div>
......@@ -28,7 +28,7 @@
<!-- 实体工程材料单位换算 -->
<el-button type="primary" size="medium" class="unit-conversion-btn" v-if="currentParentName.indexOf('实体工程材料') != -1">单位换算</el-button>
<!-- 填写实际成本 -->
<el-button type="primary" size="medium" class="actual-cost-btn" v-else>填写实际成本</el-button>
<el-button type="primary" size="medium" class="actual-cost-btn" v-else @click="fillActualCost">填写实际成本</el-button>
<!-- 表头设置组件 -->
<dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting>
</div>
......@@ -39,9 +39,10 @@
<table-list-com :tableData="tableDataList" :formColum="formColum" v-else-if="!tableLoading" :maxHeight="true" :tableDataTotal="total"
:paging="false">
<template slot="action-field-bar" slot-scope="scope">
<div class="project-action-field-bar">
<div class="project-action-field-bar" v-if="scope.row.id">
<span class="push-project">推送工程量</span>
</div>
<span v-else>-</span>
</template>
</table-list-com>
</div>
......@@ -103,7 +104,7 @@ export default {
comProjectId: this.projectId,
menuTreeList: [],
// 加载数据列表
tableLoading: false,
tableLoading: true,
total: 0,
// 列表表头
formColum: [
......@@ -153,7 +154,8 @@ export default {
// 当前选中的成本科目
currentNodeName: "",
// 数据列表
tableDataList: []
tableDataList: [],
statisticsParentName: ["劳务分包工程", "专业分包工程"]
};
},
//可访问data属性
......@@ -162,7 +164,9 @@ export default {
},
//计算集
computed: {
hasTarget() {
return this.statisticsParentName.includes(this.currentParentName);
}
},
//方法集
methods: {
......@@ -179,14 +183,20 @@ export default {
await this.initDefaultSetting();
} catch (error) {
console.log(error);
} finally {
this.tableLoading = false;
}
},
async initDefaultSetting() {
try {
const defaultCurrent = this.findMenuNode(this.menuTreeList, "结构劳务分包");
await this.$nextTick();
const menus = this.$refs["projectSideMenu"].getResultMenuList();
const defaultCurrent = this.findMenuNode(menus, "结构劳务分包");
// 默认选中结构劳务分包
if (defaultCurrent) {
this.currentNodeName = defaultCurrent.name;
this.currentNodeName = defaultCurrent.nodeName;
const parentName = defaultCurrent.parent ? this.getCurrentType(defaultCurrent.parent) : defaultCurrent.name;
if (parentName) this.currentParentName = parentName;
const params = this.createRequestConditions();
await this.getFeedSummaryList(params);
}
......@@ -212,11 +222,11 @@ export default {
includeNowMonth(time) {
return this.originMonthList.includes(time);
},
findMenuNode(tree, nodeName) {
findMenuNode(tree, nodeName, targetName = "nodeName") {
for (const item of tree) {
if (item.name == nodeName) return item;
if (item[targetName] == nodeName) return item;
if (item.children instanceof Array) {
const result = this.findMenuNode(item.children, nodeName);
const result = this.findMenuNode(item.children, nodeName, targetName);
if (result) return result;
}
}
......@@ -226,8 +236,13 @@ export default {
this.tableLoading = true;
const list = await getFeedSummaryListApi(params);
if (list.code == 200 && list.data instanceof Array) {
this.tableDataList = list.data;
this.total = list.data.length;
const _temp = list.data;
// 计算总和
if (this.hasTarget) {
const row = this.countRowParams(_temp);
}
this.tableDataList = _temp;
this.total = _temp.length;
}
} catch (error) {
console.log(error);
......@@ -235,6 +250,17 @@ export default {
this.tableLoading = false;
}
},
countRowParams(arraylist = []) {
if (arraylist.length) {
const _template = {};
const _temp = cloneDeep(arraylist[0]);
const keys = Object.keys(_temp);
for (const key of keys) {
_template[key] = "";
}
console.log(_template);
}
},
async getFeedSummaryMenuTree(params) {
try {
const result = await getFeedSummaryMenuTreeApi(params);
......@@ -317,6 +343,10 @@ export default {
}
},
// 填写或修改新的 成本月份
fillActualCost() {
}
},
}
</script>
......
......@@ -101,6 +101,10 @@ export default {
},
//方法集
methods: {
// 获取最终菜单结构
getResultMenuList() {
return this.tempMenuTree;
},
// 展开所有指定层级的菜单 默认二级
openTargetAllSubMenu(openeds = [], level = 2) {
// 组件外传入了值 使用传入值,否则默认获取二级菜单打开二级
......
......@@ -192,6 +192,8 @@ export default {
const detail = await getProjectDetailApi(projectId);
if (detail.code == 200 && detail.data) {
if (detail.data.id) detail.data["projectId"] = detail.data.id;
detail.data["projectId"] = "1754425038355890177";
detail.data["cbStage"] = 0;
this.detailInfo = detail.data;
}
} catch (error) {
......
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