Commit 6ab2fc68 authored by tianhongyang's avatar tianhongyang

fix merge

parent 866c1b33
module.exports = { module.exports = {
presets: [ presets: [
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
'@vue/cli-plugin-babel/preset', [
'@vue/cli-plugin-babel/preset',
{
useBuiltIns: "entry",
},
],
['@vue/babel-preset-jsx', { 'injectH': false }] ['@vue/babel-preset-jsx', { 'injectH': false }]
], ],
'env': { 'env': {
......
...@@ -240,6 +240,17 @@ export const getFeedSummaryListApi = (params = {}) => request({ ...@@ -240,6 +240,17 @@ export const getFeedSummaryListApi = (params = {}) => request({
params params
}); });
/**
* 更新月成本信息
* @param {*} data
* @returns
*/
export const updateFeedSummaryRowsApi = (data) => request({
url: "/cb/quantity/summary/updateActual",
method: "put",
data
});
//工程项目信息 //工程项目信息
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<script> <script>
import NoData from '@/components/NoData'; import NoData from '@/components/NoData';
import TableListColumn from "@/components/TableListCom/components/TableListColumn"; import TableListColumn from "@/components/TableListCom/components/TableListColumn";
import { generateRandomLowerCaseLetter } from "@/utils";
export default { export default {
name: "tableListCom", name: "tableListCom",
props: { props: {
...@@ -140,7 +141,9 @@ export default { ...@@ -140,7 +141,9 @@ export default {
show_page: this.paging, show_page: this.paging,
comMaxHeight: null, comMaxHeight: null,
hasQueryParams: false, hasQueryParams: false,
comMaxBodyHeight: 0 comMaxBodyHeight: 0,
observer: null,
resizeTimer: null
}; };
}, },
watch: { watch: {
...@@ -170,24 +173,50 @@ export default { ...@@ -170,24 +173,50 @@ export default {
}, },
created() { created() {
this.maxHeight ? this.maxHeightInit() : null; this.maxHeight ? this.maxHeightInit() : null;
// 创建dom元素 监听器 ,容器出现变化 重新获取元素参数
this.createResizeObserver();
},
beforeDestroy() {
this.clearResizeTimer();
if (this.observer) {
this.observer.disconnect();
}
}, },
methods: { methods: {
async createResizeObserver() {
this.observer = new ResizeObserver(entries => {
this.clearResizeTimer();
this.resizeTimer = setTimeout(() => {
this.maxHeightInit(true);
}, 1000);
});
await this.$nextTick();
this.observer.observe(this.$el);
},
clearResizeTimer() {
clearTimeout(this.resizeTimer);
this.resizeTimer = null;
},
// 自适应当前容器 // 自适应当前容器
async maxHeightInit() { async maxHeightInit(resize = false) {
try { try {
await this.$nextTick(); await this.$nextTick();
// 固定数值 // 固定数值
const isFixedNumber = typeof this.maxHeight == "number"; const isFixedNumber = typeof this.maxHeight == "number";
// 最大高度 // 最大高度
let containerMaxHeight = null; let containerMaxHeight = null;
if (isFixedNumber) { if (isFixedNumber && !resize) {
containerMaxHeight = this.maxHeight; containerMaxHeight = this.maxHeight;
} else { } else {
/** /**
* @type {HTMLDivElement} * @type {HTMLDivElement}
*/ */
const container = this.$el.querySelector(".table-item"); const container = this.$el;
if (container) { if (container) {
// console.log(container.offsetHeight, "container.offsetHeight");
// 拿到可用视口高度
console.log(container.offsetHeight);
console.log(container.getBoundingClientRect());
containerMaxHeight = container.offsetHeight; containerMaxHeight = container.offsetHeight;
} }
} }
...@@ -203,6 +232,7 @@ export default { ...@@ -203,6 +232,7 @@ export default {
const headerHeight = parseInt(window.getComputedStyle(tableRightHeader).height); const headerHeight = parseInt(window.getComputedStyle(tableRightHeader).height);
//原滚动条高度为6px 差 10px //原滚动条高度为6px 差 10px
const bodyMaxHeight = containerMaxHeight - headerHeight - 16; const bodyMaxHeight = containerMaxHeight - headerHeight - 16;
// console.log(bodyMaxHeight, "bodyMaxHeight");
this.comMaxBodyHeight = bodyMaxHeight; this.comMaxBodyHeight = bodyMaxHeight;
} }
} }
...@@ -262,6 +292,7 @@ export default { ...@@ -262,6 +292,7 @@ export default {
/* maxHeight自适应样式 */ /* maxHeight自适应样式 */
&.auto-max-height { &.auto-max-height {
height: 100%;
::v-deep .table-item { ::v-deep .table-item {
// 原滚动条为6px 现在多10px // 原滚动条为6px 现在多10px
.el-table { .el-table {
......
...@@ -35,15 +35,17 @@ ...@@ -35,15 +35,17 @@
<!-- 数据列表部分 --> <!-- 数据列表部分 -->
<div class="project-feedsummary-list-container"> <div class="project-feedsummary-list-container">
<dsk-skeleton v-if="tableLoading"></dsk-skeleton> <dsk-skeleton v-if="tableLoading"></dsk-skeleton>
<custom-table :tableData="tableDataList" :formColum="formColum" v-else-if="!tableLoading" :max-height="true" :tableDataTotal="total" <el-form :model="dataForm" ref="feedSummaryForm" :show-message="false" v-else-if="!tableLoading" class="feed-summary-form">
:paging="false"> <custom-table :tableData="dataForm.tableDataList" :formColum="formColum" :max-height="true" :tableDataTotal="total" :paging="false"
<template slot="action-field-bar" slot-scope="scope"> :cell-class-name="cellClassName">
<div class="project-action-field-bar" v-if="scope.row.id != '0'"> <template slot="action-field-bar" slot-scope="scope">
<span class="push-project">推送工程量</span> <div class="project-action-field-bar" v-if="scope.row.id != '0'">
</div> <span class="push-project">推送工程量</span>
<span v-else>-</span> </div>
</template> <span v-else>-</span>
</custom-table> </template>
</custom-table>
</el-form>
</div> </div>
</div> </div>
</div> </div>
...@@ -55,7 +57,7 @@ ...@@ -55,7 +57,7 @@
</template> </template>
<script> <script>
import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu"; import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu";
import { getFeedSummaryMenuTreeApi, getFeedSummaryMonthListApi, getFeedSummaryListApi } from "@/api/projectCostLedger"; import { getFeedSummaryMenuTreeApi, getFeedSummaryMonthListApi, getFeedSummaryListApi, updateFeedSummaryRowsApi } from "@/api/projectCostLedger";
import DskTableHeaderSetting from "@/components/DskTableHeaderSetting"; import DskTableHeaderSetting from "@/components/DskTableHeaderSetting";
import DskSkeleton from "@/components/DskSkeleton"; import DskSkeleton from "@/components/DskSkeleton";
import CustomTable from "@/components/CustomTable"; import CustomTable from "@/components/CustomTable";
...@@ -78,6 +80,14 @@ const statisticsPropNames = [ ...@@ -78,6 +80,14 @@ const statisticsPropNames = [
"purchaseUnitPrice" "purchaseUnitPrice"
]; ];
// 可编辑字段
const editPropNames = [
"quantities",
"totalQuantities",
"purchaseUnitPrice",
"createTime"
];
export default { export default {
name: "feedSummary", name: "feedSummary",
props: { props: {
...@@ -174,7 +184,11 @@ export default { ...@@ -174,7 +184,11 @@ export default {
// 当前选中的成本科目 // 当前选中的成本科目
currentNodeName: "", currentNodeName: "",
// 数据列表 // 数据列表
tableDataList: [], originTableDataList: [],
dataForm: {
// 数据列表源数据
tableDataList: [],
},
statisticsParentName: ["劳务分包工程", "专业分包工程"], statisticsParentName: ["劳务分包工程", "专业分包工程"],
// 填写实际成本弹窗 // 填写实际成本弹窗
showAddActualCost: false, showAddActualCost: false,
...@@ -271,7 +285,8 @@ export default { ...@@ -271,7 +285,8 @@ export default {
const row = this.countRowParams(_temp, statisticsPropNames); const row = this.countRowParams(_temp, statisticsPropNames);
_temp.unshift(row); _temp.unshift(row);
} }
this.tableDataList = _temp; this.$set(this.dataForm, "tableDataList", cloneDeep(_temp));
this.originTableDataList = cloneDeep(_temp);
this.total = _temp.length; this.total = _temp.length;
} }
} catch (error) { } catch (error) {
...@@ -376,14 +391,14 @@ export default { ...@@ -376,14 +391,14 @@ export default {
// 获取列表数据 // 获取列表数据
this.getFeedSummaryList(params); this.getFeedSummaryList(params);
}, },
menuSelect(currentId, currentTemp) { async menuSelect(currentId, currentTemp) {
this.resetEditStatus(); this.resetEditStatus();
this.currentNodeName = currentId; this.currentNodeName = currentId;
const parentName = currentTemp.parent ? this.getCurrentType(currentTemp.parent) : currentId; const parentName = currentTemp.parent ? this.getCurrentType(currentTemp.parent) : currentId;
if (parentName) this.currentParentName = parentName; if (parentName) this.currentParentName = parentName;
// 请求数据列表 // 请求数据列表
const params = this.createRequestConditions(); const params = this.createRequestConditions();
this.getFeedSummaryList(params); await this.getFeedSummaryList(params);
}, },
getCurrentType(parent) { getCurrentType(parent) {
if (parent.level == 2) { if (parent.level == 2) {
...@@ -449,6 +464,33 @@ export default { ...@@ -449,6 +464,33 @@ export default {
params["recordDate"] = selectTime; params["recordDate"] = selectTime;
// 获取选中月数据 // 获取选中月数据
await this.getFeedSummaryList(params); await this.getFeedSummaryList(params);
// 将编辑区域移动到视口
await this.editRegionToViewPort();
},
async editRegionToViewPort() {
await this.$nextTick();
// 获取编辑列所处位置
const container = document.querySelector(".el-table__body-wrapper");
/**
* @type {HTMLTableCellElement}
*/
const editElement = container.querySelector(".el-table__row [class *= can-edit-column-]");
if (editElement) {
const left = editElement.offsetLeft;
container.scrollTo({
behavior: "smooth",
left,
top: 0
});
}
},
cellClassName({ row, column, rowIndex, columnIndex }) {
// console.log(column);
const { property } = column;
if (editPropNames.includes(property)) {
return `can-edit-column-${property}`;
}
return "";
} }
}, },
} }
...@@ -533,17 +575,21 @@ export default { ...@@ -533,17 +575,21 @@ export default {
} }
.project-feedsummary-list-container { .project-feedsummary-list-container {
position: relative;
width: 100%; width: 100%;
height: calc(100% - 48px); height: calc(100% - 48px);
overflow: auto; overflow: auto;
.feed-summary-form {
height: 100%;
}
.dsk-skeleton-outer-container { .dsk-skeleton-outer-container {
padding: 0px; padding: 0px;
height: 100%; height: 100%;
} }
::v-deep .table-list-com-ins { ::v-deep .table-list-com-ins {
height: 100%;
.table-item { .table-item {
.el-table { .el-table {
th { th {
......
...@@ -193,8 +193,8 @@ export default { ...@@ -193,8 +193,8 @@ export default {
const detail = await getProjectDetailApi(projectId); const detail = await getProjectDetailApi(projectId);
if (detail.code == 200 && detail.data) { if (detail.code == 200 && detail.data) {
if (detail.data.id) detail.data["projectId"] = detail.data.id; if (detail.data.id) detail.data["projectId"] = detail.data.id;
// detail.data["projectId"] = "1754425038355890177"; detail.data["projectId"] = "1754425038355890177";
// detail.data["cbStage"] = 0; detail.data["cbStage"] = 0;
this.detailInfo = detail.data; this.detailInfo = detail.data;
} }
} catch (error) { } 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