Commit 660b04e5 authored by huangjie's avatar huangjie

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 3556a916 127904c7
...@@ -17,7 +17,6 @@ import org.springframework.validation.annotation.Validated; ...@@ -17,7 +17,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -42,9 +41,9 @@ public class CbProjectRecordController extends BaseController { ...@@ -42,9 +41,9 @@ public class CbProjectRecordController extends BaseController {
/** /**
* 校验项目编码是否存在 * 校验项目编码是否存在
*/ */
@GetMapping("/checkProjectCodeExist/{projectCode}") @GetMapping("/checkProjectCodeExist")
public R<Boolean> checkProjectCodeExist(@NotBlank(message = "项目编码不能为空") @PathVariable String projectCode) { public R<Boolean> checkProjectCodeExist(@Validated CbCheckProjectCodeExistBo checkBo) {
return R.ok(dProjectService.checkProjectCodeExist(projectCode)); return R.ok(dProjectService.checkProjectCodeExist(checkBo));
} }
/** /**
......
...@@ -32,21 +32,11 @@ public class AddCbDirectExpenseBo { ...@@ -32,21 +32,11 @@ public class AddCbDirectExpenseBo {
*/ */
@NotBlank(message = "单位不能为空") @NotBlank(message = "单位不能为空")
private String unit; private String unit;
/**
* 招标控制价单价
*/
@NotBlank(message = "招标控制价单价不能为空")
private String tenderControlUnitPrice;
/** /**
* 不含税成本单价 * 不含税成本单价
*/ */
@NotBlank(message = "不含税成本单价不能为空") @NotBlank(message = "不含税成本单价不能为空")
private String excludeTaxCbUnitPrice; private String excludeTaxCbUnitPrice;
/**
* 含税成本单价
*/
@NotBlank(message = "含税成本单价不能为空")
private String includeTaxCbUnitPrice;
/** /**
* 特征描述 * 特征描述
*/ */
......
package com.dsk.cscec.domain.bo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @author sxk
* @date 2024.03.22
* @time 16:02
*/
@Data
public class CbCheckProjectCodeExistBo {
/**
* 项目ID
*/
private Long projectId;
/**
* IPM项目编码
*/
@NotBlank(message = "项目编码不能为空")
String projectCode;
}
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.DProject; import com.dsk.cscec.domain.DProject;
import com.dsk.cscec.domain.bo.CbCheckProjectCodeExistBo;
import com.dsk.cscec.domain.bo.CooperateProjectDetailSearchBo; import com.dsk.cscec.domain.bo.CooperateProjectDetailSearchBo;
import com.dsk.cscec.domain.bo.ProjectDetailBo; import com.dsk.cscec.domain.bo.ProjectDetailBo;
import com.dsk.cscec.domain.bo.ProjectSearchBo; import com.dsk.cscec.domain.bo.ProjectSearchBo;
...@@ -57,13 +58,14 @@ public interface IDProjectService extends IService<DProject> { ...@@ -57,13 +58,14 @@ public interface IDProjectService extends IService<DProject> {
/** /**
* 校验项目编码是否存在 * 校验项目编码是否存在
* *
* @param projectCode 项目编码 * @param checkBo 待校验信息
* @return 校验结果 * @return 校验结果
*/ */
Boolean checkProjectCodeExist(String projectCode); Boolean checkProjectCodeExist(CbCheckProjectCodeExistBo checkBo);
/** /**
* 获取工程项目信息 * 获取工程项目信息
*
* @param projectId 项目ID * @param projectId 项目ID
* @return 工程项目信息 * @return 工程项目信息
*/ */
......
...@@ -244,7 +244,8 @@ public class CbDirectExpenseServiceImpl extends ServiceImpl<CbDirectExpenseMappe ...@@ -244,7 +244,8 @@ public class CbDirectExpenseServiceImpl extends ServiceImpl<CbDirectExpenseMappe
//查询该菜单下的清 //查询该菜单下的清
List<CbDirectExpenseDataDetailVo> qingList = BeanUtil.copyToList(baseMapper.selectList(new LambdaQueryWrapper<CbDirectExpense>() List<CbDirectExpenseDataDetailVo> qingList = BeanUtil.copyToList(baseMapper.selectList(new LambdaQueryWrapper<CbDirectExpense>()
.eq(CbDirectExpense::getParentId, menuId) .eq(CbDirectExpense::getParentId, menuId)
.eq(CbDirectExpense::getExpenseCategoryTag, CbProjectConstants.DIRECT_EXPENSE_CATEGORY_TAG_QING)), CbDirectExpenseDataDetailVo.class); //.eq(CbDirectExpense::getExpenseCategoryTag, CbProjectConstants.DIRECT_EXPENSE_CATEGORY_TAG_QING)
), CbDirectExpenseDataDetailVo.class);
Assert.isFalse(qingList.isEmpty(), "该菜单下无数据"); Assert.isFalse(qingList.isEmpty(), "该菜单下无数据");
//生成数据树形 //生成数据树形
...@@ -276,6 +277,7 @@ public class CbDirectExpenseServiceImpl extends ServiceImpl<CbDirectExpenseMappe ...@@ -276,6 +277,7 @@ public class CbDirectExpenseServiceImpl extends ServiceImpl<CbDirectExpenseMappe
directExpense.setParentId(qing.getId()); directExpense.setParentId(qing.getId());
directExpense.setLevel(qing.getLevel() + 1); directExpense.setLevel(qing.getLevel() + 1);
directExpense.setProjectId(qing.getProjectId()); directExpense.setProjectId(qing.getProjectId());
//新增数据没有项目文件,为防止空指针,暂且设为-1,后期可根据业务需要更改
directExpense.setProjectFileId(-1L); directExpense.setProjectFileId(-1L);
directExpense.setIsImport(false); directExpense.setIsImport(false);
......
...@@ -28,7 +28,6 @@ import lombok.extern.slf4j.Slf4j; ...@@ -28,7 +28,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopContext; import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -63,8 +62,6 @@ public class CbProjectRecordServiceImpl extends ServiceImpl<CbProjectRecordMappe ...@@ -63,8 +62,6 @@ public class CbProjectRecordServiceImpl extends ServiceImpl<CbProjectRecordMappe
private ICbCostMeasureService costMeasureService; private ICbCostMeasureService costMeasureService;
@Resource @Resource
private CbDirectExpenseService directExpenseService; private CbDirectExpenseService directExpenseService;
@Resource
private TransactionTemplate transactionTemplate;
/** /**
* 新增项目 * 新增项目
......
...@@ -18,6 +18,7 @@ import com.dsk.cscec.domain.AdvisoryBody; ...@@ -18,6 +18,7 @@ import com.dsk.cscec.domain.AdvisoryBody;
import com.dsk.cscec.domain.AdvisoryBodyProject; import com.dsk.cscec.domain.AdvisoryBodyProject;
import com.dsk.cscec.domain.CbProjectRecord; import com.dsk.cscec.domain.CbProjectRecord;
import com.dsk.cscec.domain.DProject; import com.dsk.cscec.domain.DProject;
import com.dsk.cscec.domain.bo.CbCheckProjectCodeExistBo;
import com.dsk.cscec.domain.bo.CooperateProjectDetailSearchBo; import com.dsk.cscec.domain.bo.CooperateProjectDetailSearchBo;
import com.dsk.cscec.domain.bo.ProjectDetailBo; import com.dsk.cscec.domain.bo.ProjectDetailBo;
import com.dsk.cscec.domain.bo.ProjectSearchBo; import com.dsk.cscec.domain.bo.ProjectSearchBo;
...@@ -256,15 +257,33 @@ public class IDProjectServiceImpl extends ServiceImpl<DProjectMapper, DProject> ...@@ -256,15 +257,33 @@ public class IDProjectServiceImpl extends ServiceImpl<DProjectMapper, DProject>
/** /**
* 校验项目编码是否存在 * 校验项目编码是否存在
* *
* @param projectCode 项目编码 * @param checkBo 待校验信息
* @return 校验结果 * @return 校验结果
*/ */
@Override @Override
public Boolean checkProjectCodeExist(String projectCode) { public Boolean checkProjectCodeExist(CbCheckProjectCodeExistBo checkBo) {
Assert.isFalse(projectRecordMapper.exists(new LambdaQueryWrapper<CbProjectRecord>() Long projectId = checkBo.getProjectId();
.eq(CbProjectRecord::getIpmProjectNo, projectCode)), "项目台账列表中已存在相同IPM编码的项目"); String projectCode = checkBo.getProjectCode();
return baseMapper.exists(new LambdaQueryWrapper<DProject>()
.eq(DProject::getProjectCode, projectCode)); //新增全新项目时,直接校验IPM编码是否重复和是否存在
if (ObjectUtil.isNull(projectId)) {
Assert.isFalse(projectRecordMapper.exists(new LambdaQueryWrapper<CbProjectRecord>()
.eq(CbProjectRecord::getIpmProjectNo, projectCode)), "项目台账列表中已存在相同IPM编码的项目");
return baseMapper.exists(new LambdaQueryWrapper<DProject>()
.eq(DProject::getProjectCode, projectCode));
} else {
//修改项目信息or新增新阶段项目时
CbProjectRecord projectRecord = projectRecordMapper.selectById(projectId);
if (projectCode.equals(projectRecord.getIpmProjectNo())
&& projectRecord.getIsGetProjectDetail()) {
return true;
} else {
Assert.isFalse(projectRecordMapper.exists(new LambdaQueryWrapper<CbProjectRecord>()
.eq(CbProjectRecord::getIpmProjectNo, projectCode)), "项目台账列表中已存在相同IPM编码的项目");
return baseMapper.exists(new LambdaQueryWrapper<DProject>()
.eq(DProject::getProjectCode, projectCode));
}
}
} }
/** /**
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
select cde.id menuId, cde.parent_id, cde.expense_name menuName, cde.level menuLevel select cde.id menuId, cde.parent_id, cde.expense_name menuName, cde.level menuLevel
from cb_direct_expense cde from cb_direct_expense cde
where cde.project_id = #{projectId} where cde.project_id = #{projectId}
and cde.expense_category_tag regexp #{regx} <!-- and cde.expense_category_tag regexp #{regx}-->
and cde.expense_category_tag in ('1','2','3')
and cde.del_flag = #{deleteFlagExist} and cde.del_flag = #{deleteFlagExist}
order by cde.sort order by cde.sort
</select> </select>
......
...@@ -360,7 +360,7 @@ li { ...@@ -360,7 +360,7 @@ li {
} }
.is-scrolling-left + .el-table__fixed, .is-scrolling-left + .el-table__fixed,
.is-scrolling-middle + .el-table__fixed, .is-scrolling-middle + .el-table__fixed,
.is-scrolling-right + .el-table__fixed { .is-scrolling-right + .el-table__fixed,.el-table__fixed-right {
box-shadow: 2px 0 8px -7px #202020; box-shadow: 2px 0 8px -7px #202020;
height: auto !important; height: auto !important;
bottom: 16px !important; bottom: 16px !important;
...@@ -416,13 +416,13 @@ li { ...@@ -416,13 +416,13 @@ li {
::-webkit-scrollbar-track-piece { ::-webkit-scrollbar-track-piece {
//滚动条凹槽的颜色,还可以设置边框属性 //滚动条凹槽的颜色,还可以设置边框属性
background-color: #f3f4f5; background-color: #f3f4f5;
height: 6px; height: 16px;
padding: 0 4px; padding: 0 4px;
} }
//滚动条的宽度 //滚动条的宽度
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
height: 6px; height: 16px;
background-color: #f3f4f5; background-color: #f3f4f5;
border-radius: 6px; border-radius: 6px;
} }
...@@ -591,7 +591,7 @@ li { ...@@ -591,7 +591,7 @@ li {
height: 8px; height: 8px;
} }
.el-scrollbar__thumb { .el-scrollbar__thumb {
background: rgba(98, 110, 126, 0.4); background: rgba(0,0,0,.2);
&:hover { &:hover {
background: #566380; background: #566380;
} }
......
...@@ -1234,7 +1234,7 @@ ...@@ -1234,7 +1234,7 @@
border-radius: 0; border-radius: 0;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background-color: rgba(98, 110, 126, 0.2); background: rgba(0,0,0,.2);
border: 4px solid #f3f4f5; border: 4px solid #f3f4f5;
border-radius: 10px; border-radius: 10px;
} }
...@@ -1261,7 +1261,7 @@ ...@@ -1261,7 +1261,7 @@
border-radius: 8px; border-radius: 8px;
height: 8px; height: 8px;
margin: 0 4px; margin: 0 4px;
background: rgba(98, 110, 126, 0.2); background: rgba(0,0,0,.2);
border: 4px solid #f3f4f5; border: 4px solid #f3f4f5;
&:hover { &:hover {
background: #566380; background: #566380;
......
<template> <template>
<div class="table-list-com-ins" :class="{'is-empty-table' : !tableDataTotal,'no-pagination' : !hasQueryParams,'auto-max-height' : maxHeight}" <div class="table-list-com-ins"
:class="{'is-empty-table' : !tableDataTotal,'no-pagination' : !hasQueryParams,'auto-max-height' : maxHeight,'has-y-Scroll' : maxHeight && hasYScroll}"
:style="maxBodyFixedStyle"> :style="maxBodyFixedStyle">
<div class="table-item"> <div class="table-item">
<el-table v-if="tableDataTotal>0" class="fixed-table" v-loading="tableLoading" :data="tableData" element-loading-text="Loading" <el-table v-if="tableDataTotal>0" class="custom-table" v-loading="tableLoading" :data="tableData" element-loading-text="Loading"
ref="customTableRef" border fit highlight-current-row :default-sort="defaultSort?defaultSort:{}" @sort-change="sortChange" ref="customTableRef" border fit highlight-current-row :default-sort="defaultSort?defaultSort:{}" @sort-change="sortChange"
@selection-change="selectionChange" :cell-class-name="cellClassName" :cell-style="cellStyle" :row-class-name="rowClassName" @selection-change="selectionChange" :cell-class-name="cellClassName" :cell-style="cellStyle" :row-class-name="rowClassName"
:row-style="rowStyle" :height="height" :maxHeight="comMaxHeight" v-sticky-header="stickyHeader"> :row-style="rowStyle" :height="height" :maxHeight="comMaxHeight" v-sticky-header="stickyHeader">
...@@ -144,6 +145,7 @@ export default { ...@@ -144,6 +145,7 @@ export default {
hasQueryParams: false, hasQueryParams: false,
comMaxBodyHeight: 0, comMaxBodyHeight: 0,
headerLastBlockHeight: 0, headerLastBlockHeight: 0,
hasYScroll: false,
observer: null, observer: null,
resizeTimer: null resizeTimer: null
}; };
...@@ -208,6 +210,7 @@ export default { ...@@ -208,6 +210,7 @@ export default {
const isFixedNumber = typeof this.maxHeight == "number"; const isFixedNumber = typeof this.maxHeight == "number";
// 最大高度 // 最大高度
let containerMaxHeight = null; let containerMaxHeight = null;
// 是固定数值
if (isFixedNumber && !resize) { if (isFixedNumber && !resize) {
containerMaxHeight = this.maxHeight; containerMaxHeight = this.maxHeight;
} else { } else {
...@@ -222,7 +225,7 @@ export default { ...@@ -222,7 +225,7 @@ export default {
} }
// 列表自适应高度 // 列表自适应高度
this.comMaxHeight = containerMaxHeight ? `${containerMaxHeight}px` : null; this.comMaxHeight = containerMaxHeight ? `${containerMaxHeight}px` : null;
// 重新计算表格高度 减去滚动条高度差 16 - 6 // 重新计算表格高度 减去滚动条高度差 16 - 6 有固定列的情况
if (containerMaxHeight) { if (containerMaxHeight) {
/** /**
* @type {HTMLDivElement} * @type {HTMLDivElement}
...@@ -234,6 +237,15 @@ export default { ...@@ -234,6 +237,15 @@ export default {
const bodyMaxHeight = containerMaxHeight - headerHeight - 16; const bodyMaxHeight = containerMaxHeight - headerHeight - 16;
// console.log(bodyMaxHeight, "bodyMaxHeight"); // console.log(bodyMaxHeight, "bodyMaxHeight");
this.comMaxBodyHeight = bodyMaxHeight; this.comMaxBodyHeight = bodyMaxHeight;
// 表体 判断是否有竖向滚动条 容器 bodyMaxHeight 整体 最大高度大于 内部列表高度 则没有滚动条
const fixedTableBody = this.$el.querySelector(".el-table__fixed-body-wrapper");
// dom更新后 重新比较 高度
await this.$nextTick();
// 拿到 固定列表体实际高度 包含滚动高度
const fixedBodyHeight = fixedTableBody.scrollHeight;
// console.log(bodyMaxHeight,"bodyMaxHeight");
// console.log(parseFloat(fixedBodyHeight),"fixedBodyHeight");
this.hasYScroll = bodyMaxHeight >= parseFloat(fixedBodyHeight) ? false : true;
} else { } else {
// 没有固定列 正常情况下 计算默认header高度 // 没有固定列 正常情况下 计算默认header高度
const defaultHeader = this.$el.querySelector(".el-table__header-wrapper"); const defaultHeader = this.$el.querySelector(".el-table__header-wrapper");
...@@ -306,14 +318,14 @@ export default { ...@@ -306,14 +318,14 @@ export default {
/* 右侧fixed列 */ /* 右侧fixed列 */
.el-table__fixed-right { .el-table__fixed-right {
z-index: 9; z-index: 9;
right: 16px !important; right: 0px !important;
bottom: 15px !important; bottom: 15px !important;
.el-table__fixed-header-wrapper { .el-table__fixed-header-wrapper {
position: absolute; position: absolute;
} }
} }
.el-table__fixed-right-patch { .el-table__fixed-right-patch {
width: 16px !important; width: 0px !important;
z-index: 9; z-index: 9;
top: 0px; top: 0px;
background: #f0f3fa; background: #f0f3fa;
...@@ -335,6 +347,21 @@ export default { ...@@ -335,6 +347,21 @@ export default {
} }
} }
} }
// 是否存在Y轴滚动条
&.has-y-Scroll {
::v-deep .table-item {
.el-table {
/* 右侧fixed列 */
.el-table__fixed-right {
right: 16px !important;
}
.el-table__fixed-right-patch {
width: 16px !important;
}
}
}
}
} }
/* 不需要分页 或没有分页参数 */ /* 不需要分页 或没有分页参数 */
...@@ -343,6 +370,7 @@ export default { ...@@ -343,6 +370,7 @@ export default {
max-height: 100%; max-height: 100%;
} }
} }
::v-deep .table-item { ::v-deep .table-item {
width: 100%; width: 100%;
max-height: calc(100% - 40px); max-height: calc(100% - 40px);
...@@ -400,6 +428,28 @@ export default { ...@@ -400,6 +428,28 @@ export default {
} }
.el-table { .el-table {
&.custom-table {
.el-table__body-wrapper {
/* 滚动条在最左侧时 */
&.is-scrolling-left {
& + .el-table__fixed {
box-shadow: unset;
}
}
/* 滚动条在最右侧时 */
&.is-scrolling-right {
/* 右侧固定列 */
& + .el-table__fixed + .el-table__fixed-right,
& + .el-table__fixed-right {
box-shadow: unset;
}
}
}
.el-table__fixed-right,
.el-table__fixed {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.12);
}
}
.el-table__header-wrapper { .el-table__header-wrapper {
min-height: 40px; min-height: 40px;
} }
......
...@@ -52,6 +52,9 @@ import VueMeta from 'vue-meta'; ...@@ -52,6 +52,9 @@ import VueMeta from 'vue-meta';
// 字典数据组件 // 字典数据组件
import DictData from '@/components/DictData'; import DictData from '@/components/DictData';
// 全局缩放
import ScreenScal from "@/utils/screenScal";
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts; Vue.prototype.getDicts = getDicts;
Vue.prototype.getConfigKey = getConfigKey; Vue.prototype.getConfigKey = getConfigKey;
...@@ -105,3 +108,5 @@ new Vue({ ...@@ -105,3 +108,5 @@ new Vue({
store, store,
render: h => h(App) render: h => h(App)
}); });
new ScreenScal();
import { multiply, divide } from "@/utils/decimal.js";
/**
* 根据屏幕缩放率 来进行样式缩放
*/
export default class ScreenScal {
// 需要缩放适配的倍率
resultCalcZoom = null;
// 总缩放倍数
zoom = null;
// 浏览器缩放倍数
browserZoom = null;
// 系统缩放倍数
systemZoom = null;
// 系统分辨率
systemResolution = null;
constructor() {
this.setUserScreenScal();
window.addEventListener("resize", this.setUserScreenScal.bind(this), false);
}
setDefaultOptions() {
const { zoom, resultCalcZoom, browserZoom, systemResolution, systemZoom } = this.getUserScreenInfo();
this.zoom = zoom;
this.resultCalcZoom = resultCalcZoom;
this.browserZoom = browserZoom;
this.systemZoom = systemZoom;
this.systemResolution = systemResolution;
}
/**
* 设置用户缩放
*/
setUserScreenScal() {
this.setDefaultOptions();
document.body.style.setProperty("zoom", this.resultCalcZoom);
}
/**
* 参数转换浮点
* @param {*} num
* @returns
*/
getDecimal = (num) => {
return parseFloat(divide(multiply(num, 100, 5), 100));
};
/**
* 获取用户屏幕信息
*/
getUserScreenInfo() {
// 总缩放倍数
const zoom = this.getZoom();
// 屏幕分辨率
const screenResolution = window.screen.width;
// 获取浏览器内部宽度
const browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
// 浏览器缩放倍数
// 浏览器外部宽度不受浏览器缩放影响,浏览器内部宽度受影响,所以根据这个可以计算出浏览器缩放倍数(F12调试工具的占位会影响该值)
const browserZoom = this.getDecimal(window.outerWidth / browserWidth);
// 系统缩放倍数
const systemZoom = this.getDecimal(zoom / browserZoom);
// 系统分辨率
const systemResolution = Math.round(screenResolution * systemZoom);
// 屏幕最终需要适配结果
const resultCalcZoom = 1 / zoom;
// console.log('系统分辨率', systemResolution, '屏幕分辨率', screenResolution, '浏览器外部宽度', window.outerWidth, '浏览器内部宽度', browserWidth, '总缩放倍数', zoom, "系统最终适配倍数", resultCalcZoom, '浏览器缩放倍数', browserZoom, '系统缩放倍数', systemZoom);
return {
zoom,
resultCalcZoom,
browserZoom,
systemZoom,
systemResolution
};
}
/**
* 获取用户屏幕缩放倍数 后期需要考虑 echarts 缩放兼容性问题
* @returns
*/
getZoom() {
let zoom = 1;
const screen = window.screen,
ua = navigator.userAgent.toLowerCase();
if (window.devicePixelRatio !== undefined) {
const _devicePixelRatio = window.devicePixelRatio;
zoom = _devicePixelRatio > 1 ? window.outerWidth / window.innerWidth : window.devicePixelRatio;
} else if (~ua.indexOf('msie')) {
if (screen.deviceXDPI && screen.logicalXDPI) {
zoom = screen.deviceXDPI / screen.logicalXDPI;
}
} else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
zoom = window.outerWidth / window.innerWidth;
}
return this.getDecimal(zoom);
}
}
\ No newline at end of file
...@@ -548,6 +548,8 @@ export default { ...@@ -548,6 +548,8 @@ export default {
.detail-menu { .detail-menu {
margin-top: 9px; margin-top: 9px;
border-right: 0; border-right: 0;
max-height: calc(100% - 50px);
overflow: auto;
::v-deep .el-menu-item, ::v-deep .el-menu-item,
::v-deep .el-submenu__title { ::v-deep .el-submenu__title {
height: 30px; height: 30px;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
<div class="right-table" ref="rightTable"> <div class="right-table" ref="rightTable">
<skeleton v-if="isSkeleton" style="padding: 16px"></skeleton> <skeleton v-if="isSkeleton" style="padding: 16px"></skeleton>
<div class="table-item"> <div class="table-item">
<el-table <el-table
v-if="!isSkeleton" v-if="!isSkeleton"
element-loading-text="Loading" element-loading-text="Loading"
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
border border
highlight-current-row highlight-current-row
> >
<el-table-column label="序号" width="60" align="left" prop="index"></el-table-column> <el-table-column label="序号" width="60" align="left" prop="index" fixed="left"></el-table-column>
<el-table-column label="编码" width="130" prop="code"></el-table-column> <el-table-column label="编码" width="130" prop="code"></el-table-column>
<el-table-column label="名称" width="230" prop="expenseName"></el-table-column> <el-table-column label="名称" width="230" prop="expenseName"></el-table-column>
<el-table-column label="清单" width="110" prop="expenseCategoryTag"></el-table-column> <el-table-column label="清单" width="110" prop="expenseCategoryTag"></el-table-column>
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
projectDetailInfo: { projectDetailInfo: {
handler(newValue) { handler(newValue) {
this.comProjectDetailInfo = newValue ? newValue : {}; this.comProjectDetailInfo = newValue ? newValue : {};
this.getCbDirectExpenseMenuTreeApi(this.comProjectDetailInfo.projectId) this.getCbDirectExpenseMenuTree(this.comProjectDetailInfo.projectId)
// this.getProjectOtherStatistics(this.comProjectDetailInfo.projectId) // this.getProjectOtherStatistics(this.comProjectDetailInfo.projectId)
// this.getProjectOtherStatistics('1762014527685136385') // this.getProjectOtherStatistics('1762014527685136385')
// this.init(this.comProjectDetailInfo); // this.init(this.comProjectDetailInfo);
...@@ -200,14 +200,14 @@ export default { ...@@ -200,14 +200,14 @@ export default {
}, },
//方法集 //方法集
methods: { methods: {
async getCbDirectExpenseMenuTreeApi(params) { async getCbDirectExpenseMenuTree(params) {
try { try {
const result = await getCbDirectExpenseMenuTreeApi(params); const result = await getCbDirectExpenseMenuTreeApi(params);
if (result.code == 200) { if (result.code == 200) {
const _tempArray = result.data; const _tempArray = result.data;
this.menuDetails=_tempArray this.menuDetails=_tempArray
this.menuTreeList.push(_tempArray); this.menuTreeList.push(_tempArray);
const defaultCurrent = this.findMenuNode(this.menuTreeList, "土石方部分"); const defaultCurrent = this.findMenuNode(this.menuTreeList, "宝安中学(集团)初中部改扩建工程施工总承包-加固修缮工程");
if (defaultCurrent) { if (defaultCurrent) {
this.defaultActive = defaultCurrent.menuId; this.defaultActive = defaultCurrent.menuId;
this.menuId = defaultCurrent.menuId; this.menuId = defaultCurrent.menuId;
...@@ -290,9 +290,8 @@ export default { ...@@ -290,9 +290,8 @@ export default {
}); });
}, },
findMenuNode(tree, nodeName) { findMenuNode(tree, nodeName) {
// console.log(tree)
for (const item of tree) { for (const item of tree) {
if (item.menuName == nodeName) return item; if (item.menuName == nodeName && !item?.childrenList?.length) return item;
if (item.childrenList instanceof Array) { if (item.childrenList instanceof Array) {
const result = this.findMenuNode(item.childrenList, nodeName); const result = this.findMenuNode(item.childrenList, nodeName);
if (result) return result; if (result) return result;
...@@ -361,10 +360,15 @@ export default { ...@@ -361,10 +360,15 @@ export default {
.color2{ .color2{
background: #FFFFFF; background: #FFFFFF;
} }
th.gutter:last-of-type {
display: block!important;
width: 16px!important;
}
.el-table__fixed-right { .el-table__fixed-right {
z-index: 9; z-index: 9;
right: 16px !important; right: 16px !important;
bottom: 15px !important; bottom: 16px !important;
height: calc(100% - 16px) !important;
.el-table__fixed-header-wrapper { .el-table__fixed-header-wrapper {
position: absolute; position: absolute;
} }
...@@ -380,14 +384,56 @@ export default { ...@@ -380,14 +384,56 @@ export default {
} }
// 自动适配下 减去滚动条高度 // 自动适配下 减去滚动条高度
.el-table__fixed { .el-table__fixed {
height: calc(100% - 15px) !important; height: calc(100% - 16px) !important;
}
.el-table__fixed-right {
height: calc(100% - 15px) !important;
} }
.el-table__fixed-body-wrapper { .el-table__fixed-body-wrapper {
.el-table__body { .el-table__body {
padding-bottom: 10px!important; padding-bottom: 16px!important;
}
}
.el-table__body-wrapper {
&::-webkit-scrollbar {
width: 16px; //竖轴宽度
height: 16px; //横轴宽度
}
}
.el-table__fixed-body-wrapper .el-table__body {
padding-bottom: 16px; // 滚动条高度
}
::-webkit-scrollbar-track-piece {
//滚动条凹槽的颜色,还可以设置边框属性
background-color: #f3f4f5;
height: 16px;
padding: 0 4px;
}
//滚动条的宽度
::-webkit-scrollbar {
width: 16px;
height: 16px;
background-color: #f3f4f5;
border-radius: 6px;
}
//滚动条的滑块
::-webkit-scrollbar-thumb {
border-radius: 8px;
height: 8px;
margin: 0 4px;
background: rgba(0,0,0,.2);
border: 4px solid #f3f4f5;
&:hover {
background: #7d7d7d;
}
}
.el-scrollbar {
height: 16px;
.el-scrollbar__bar.is-horizontal {
height: 8px;
}
.el-scrollbar__thumb {
background: rgba(98, 110, 126, 0.4);
&:hover {
background: #566380;
}
} }
} }
} }
......
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
<custom-table :tableData="dataForm.tableDataList" :formColum="formColum" :max-height="true" :tableDataTotal="total" :paging="false" <custom-table :tableData="dataForm.tableDataList" :formColum="formColum" :max-height="true" :tableDataTotal="total" :paging="false"
:cell-class-name="cellClassName"> :cell-class-name="cellClassName">
<template slot="action-field-bar" slot-scope="scope"> <template slot="action-field-bar" slot-scope="scope">
<div class="project-action-field-bar" v-if="scope.row.id != '0'"> <div class="project-action-field-bar" v-if="rowCanEditInput(scope.rowIndex,hasTarget)">
<span class="push-project-use" :class="{'is-emty-quantities' : !parseFloat(scope.row.quantities)}" <span class="push-project-use" :class="{'is-emty-quantities' : rowHasLastPush(scope.rowIndex)}"
@click="parseFloat(scope.row.quantities) ? pushProjectUse(scope.row) : ''">推送工程量</span> @click="parseFloat(scope.row.quantities) ? pushProjectUse(scope.row) : ''">推送工程量</span>
</div> </div>
<span v-else>-</span> <span v-else>-</span>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<template slot="quantities" slot-scope="scope"> <template slot="quantities" slot-scope="scope">
<!-- 编辑单元格 --> <!-- 编辑单元格 -->
<el-form-item :prop="`tableDataList.${scope.rowIndex}.quantities`" :rules="checkRules.amountCheck" <el-form-item :prop="`tableDataList.${scope.rowIndex}.quantities`" :rules="checkRules.amountCheck"
v-if="scope.rowIndex != '0' && addActualCostEditStatus" class="inner-edit-input-item"> v-if="rowCanEditInput(scope.rowIndex,hasTarget) && addActualCostEditStatus" class="inner-edit-input-item">
<el-input placeholder="请输入" v-model="scope.row.quantities" clearable @input="v => statisticsSum(v,'quantities')"></el-input> <el-input placeholder="请输入" v-model="scope.row.quantities" clearable @input="v => statisticsSum(v,'quantities')"></el-input>
</el-form-item> </el-form-item>
</template> </template>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<template slot="purchaseUnitPrice" slot-scope="scope"> <template slot="purchaseUnitPrice" slot-scope="scope">
<!-- 编辑单元格 --> <!-- 编辑单元格 -->
<el-form-item :prop="`tableDataList.${scope.rowIndex}.purchaseUnitPrice`" :rules="checkRules.amountCheck" <el-form-item :prop="`tableDataList.${scope.rowIndex}.purchaseUnitPrice`" :rules="checkRules.amountCheck"
v-if="scope.rowIndex != '0' && addActualCostEditStatus" class="inner-edit-input-item"> v-if="rowCanEditInput(scope.rowIndex,hasTarget) && addActualCostEditStatus" class="inner-edit-input-item">
<el-input placeholder="请输入" v-model="scope.row.purchaseUnitPrice" clearable <el-input placeholder="请输入" v-model="scope.row.purchaseUnitPrice" clearable
@input="v => statisticsSum(v,'purchaseUnitPrice')"></el-input> @input="v => statisticsSum(v,'purchaseUnitPrice')"></el-input>
</el-form-item> </el-form-item>
...@@ -590,7 +590,7 @@ export default { ...@@ -590,7 +590,7 @@ export default {
this.clearStatisticsTimer(); this.clearStatisticsTimer();
// 填写一秒后触发 // 填写一秒后触发
this.statisticsTimer = setTimeout(() => { this.statisticsTimer = setTimeout(() => {
const sum = this.sumHandler(this.dataForm.tableDataList, prop, true); const sum = this.sumHandler(this.dataForm.tableDataList, prop, this.hasTarget);
// 更新统计值 // 更新统计值
this.$set(this.dataForm.tableDataList[0], prop, sum); this.$set(this.dataForm.tableDataList[0], prop, sum);
}, 500); }, 500);
...@@ -605,6 +605,16 @@ export default { ...@@ -605,6 +605,16 @@ export default {
}, 0); }, 0);
return sum; return sum;
}, },
// 当前行是否可编辑
rowCanEditInput(index, hasTarget) {
// 不为id 0 或 不是劳务分包跟专业分包
return index != 0 || !hasTarget;
},
// 当前行源数据是否存在以推送工程量
rowHasLastPush(index) {
const _tempRow = this.originTableDataList[index];
return !parseFloat(_tempRow.quantities)
},
// 保存 // 保存
saveActualCost() { saveActualCost() {
this.$refs["feedSummaryForm"].validate(async flag => { this.$refs["feedSummaryForm"].validate(async flag => {
......
...@@ -105,6 +105,19 @@ export default { ...@@ -105,6 +105,19 @@ export default {
}, },
//方法集 //方法集
methods: { methods: {
// 获取第一层最深层的id
getFirstLevelWithDeepId() {
function getCurrentId(array) {
const len = array.length;
for (let index = 0; index < len; index++) {
if (index > 0) break;
const item = array[index];
if (!item?.children) return item.nodeValue;
return getCurrentId(item.children);
}
}
return getCurrentId(this.tempMenuTree);
},
// 获取最终菜单结构 // 获取最终菜单结构
getResultMenuList() { getResultMenuList() {
return this.tempMenuTree; return this.tempMenuTree;
...@@ -271,10 +284,9 @@ export default { ...@@ -271,10 +284,9 @@ export default {
/* 重置一级二级菜单 高度行高 */ /* 重置一级二级菜单 高度行高 */
.project-menu-item-container { .project-menu-item-container {
/* 有下级菜单 */ /* 有下级菜单 */
.project-sub-menu-item { .project-sub-menu-item {
&>.el-submenu__title { & > .el-submenu__title {
height: 32px; height: 32px;
line-height: unset; line-height: unset;
display: flex; display: flex;
...@@ -298,7 +310,7 @@ export default { ...@@ -298,7 +310,7 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
&>img { & > img {
width: 16px; width: 16px;
height: 16px; height: 16px;
margin-right: 4px; margin-right: 4px;
...@@ -316,9 +328,11 @@ export default { ...@@ -316,9 +328,11 @@ export default {
&:hover { &:hover {
background-color: unset; background-color: unset;
background: linear-gradient(91deg, background: linear-gradient(
rgba(0, 129, 255, 0.1) 0%, 91deg,
rgba(0, 129, 255, 0) 100%); rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%
);
} }
} }
} }
...@@ -344,9 +358,11 @@ export default { ...@@ -344,9 +358,11 @@ export default {
&.is-active { &.is-active {
.project-only-menu-title-container { .project-only-menu-title-container {
background-color: unset; background-color: unset;
background: linear-gradient(91deg, background: linear-gradient(
rgba(0, 129, 255, 0.1) 0%, 91deg,
rgba(0, 129, 255, 0) 100%); rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%
);
.project-only-menu-title { .project-only-menu-title {
color: #0081ff; color: #0081ff;
...@@ -372,9 +388,11 @@ export default { ...@@ -372,9 +388,11 @@ export default {
&:hover { &:hover {
background-color: unset; background-color: unset;
background: linear-gradient(91deg, background: linear-gradient(
rgba(0, 129, 255, 0.1) 0%, 91deg,
rgba(0, 129, 255, 0) 100%); rgba(0, 129, 255, 0.1) 0%,
rgba(0, 129, 255, 0) 100%
);
} }
.project-only-menu-title { .project-only-menu-title {
...@@ -393,7 +411,7 @@ export default { ...@@ -393,7 +411,7 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
&>img { & > img {
width: 16px; width: 16px;
height: 16px; height: 16px;
margin-right: 4px; margin-right: 4px;
......
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