Commit 101d3efb authored by tianhongyang's avatar tianhongyang

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 ed3c94f4 f9e9329c
......@@ -69,19 +69,20 @@ public class CbSummaryActualListVo extends BaseEntity {
/**
* 本月费用(含税)
*/
private BigDecimal taxInclusiveExpense;
private Double taxInclusiveExpense;
/**
* 本月费用(不含税)
*/
private BigDecimal taxExclusiveExpense;
private Double taxExclusiveExpense;
/**
* 截至本月费用(含税)
*/
private BigDecimal taxInclusiveExpenseTotal;
private Double taxInclusiveExpenseTotal;
/**
* 截至本月费用(不含税)
*/
private BigDecimal taxExclusiveExpenseTotal;
private Double taxExclusiveExpenseTotal;
/**
* 费用日期
*/
......
......@@ -19,5 +19,9 @@ public interface CbCostMeasureActualMapper extends BaseMapper<CbCostMeasureActua
List<CbCostMeasureActualVo> getMonthActualCostList(@Param("projectId") Long projectId,@Param("month") String month);
// List<CbCostMeasureActualVo> getMonthActualCostListByLevel(@Param("level") Integer level,@Param("projectId") Long projectId,@Param("month") String month);
BigDecimal selectSumData(CbCostMeasureActualSaveBo bo);
BigDecimal selectMonthProjectVolumeByLevel(@Param("level") Integer level,@Param("projectId") Long projectId,@Param("month") String month);
}
\ No newline at end of file
......@@ -4,4 +4,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.cscec.domain.CbProjectExpenseSummary;
public interface CbProjectExpenseSummaryMapper extends BaseMapper<CbProjectExpenseSummary> {
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.dsk.cscec.domain.CbCostMeasureActual;
import com.dsk.cscec.domain.bo.CbCostMeasureActualBo;
import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
......@@ -23,5 +24,7 @@ public interface ICbCostMeasureActualService extends IService<CbCostMeasureActua
List<CbCostMeasureActualVo> getMonthActualCostList(Long projectId, String month);
BigDecimal selectSumData(CbCostMeasureActualSaveBo bo);
BigDecimal selectMonthProjectVolumeByLevel(Integer level, Long projectId, String month);
}
......@@ -245,6 +245,12 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
saveList.add(cbCostMeasureActual);
}
cbCostMeasureActualService.saveOrUpdateBatch(saveList);
CbCostMeasureActual cbCostMeasureActual = saveList.get(0);
//todo 查询最新的二级费用合计, 用于更新一级费用项
// cbCostMeasureActualService.selectMonthProjectVolumeByLevel(1,cbCostMeasureActual.GET);
//更新
}
@Override
......
......@@ -331,15 +331,15 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
}
//截至本月费用汇总
Map<String, BigDecimal> parentTotal = cbSummaryActualMapper.getTotal(cbSummaryActualListVo.getId(), bo.getExpenseDate());
cbSummaryActualListVo.setTaxExclusiveExpenseTotal(parentTotal.get("taxExclusiveExpenseTotal"));
cbSummaryActualListVo.setTaxInclusiveExpenseTotal(parentTotal.get("taxInclusiveExpenseTotal"));
cbSummaryActualListVo.setTaxExclusiveExpenseTotal(parentTotal.get("taxExclusiveExpenseTotal").doubleValue());
cbSummaryActualListVo.setTaxInclusiveExpenseTotal(parentTotal.get("taxInclusiveExpenseTotal").doubleValue());
List<CbSummaryActualListVo> childrenList = baseMapper.getByParentId(bo.getId(), bo.getExpenseDate());
//截至本月费用汇总
childrenList.parallelStream().forEach(children -> {
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate());
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal"));
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal"));
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal").doubleValue());
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal").doubleValue());
});
if (CollectionUtil.isNotEmpty(childrenList)) {
cbSummaryActualListVo.setHasChildren(1);
......@@ -391,8 +391,8 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
children.setChildren(getProjectSumList(childBo));
//截至本月费用汇总
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate());
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal"));
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal"));
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal").doubleValue());
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal").doubleValue());
});
return childrenList;
......@@ -533,8 +533,8 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
//截至本月费用汇总
resultList.forEach(cbSummaryActualListVo -> {
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(cbSummaryActualListVo.getId(), bo.getExpenseDate());
cbSummaryActualListVo.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal"));
cbSummaryActualListVo.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal"));
cbSummaryActualListVo.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal").doubleValue());
cbSummaryActualListVo.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal").doubleValue());
});
return resultList;
}
......
......@@ -29,4 +29,9 @@ public class ICbCostMeasureActualServiceImpl extends ServiceImpl<CbCostMeasureAc
public BigDecimal selectSumData(CbCostMeasureActualSaveBo bo) {
return baseMapper.selectSumData(bo);
}
@Override
public BigDecimal selectMonthProjectVolumeByLevel(Integer level, Long projectId, String month) {
return baseMapper.selectMonthProjectVolumeByLevel(level,projectId,month);
}
}
......@@ -177,7 +177,7 @@
</select>
<select id="getMonthActualCostList" resultType="com.dsk.cscec.domain.vo.CbCostMeasureActualVo">
SELECT t1.item_content, t.cost_effective
SELECT t1.item_content, t.project_volume
FROM cb_cost_measure_actual t
inner JOIN cb_cost_measure t1 ON t1.id=t.plan_measure_id
WHERE
......@@ -190,4 +190,14 @@
SELECT SUM(t.project_volume) measureTotal FROM cb_cost_measure_actual t WHERE t.plan_measure_id=#{planMeasureId}
and t.month &lt;#{month}
</select>
<select id="selectMonthProjectVolumeByLevel" resultType="java.math.BigDecimal">
SELECT SUM(t.project_volume)
FROM cb_cost_measure_actual t
inner JOIN cb_cost_measure t1 ON t1.id=t.plan_measure_id
WHERE
t1.project_id=#{projectId}
AND t1.level=#{level}
AND t.`month`=#{month}
</select>
</mapper>
\ No newline at end of file
......@@ -977,3 +977,109 @@ li {
.el-tooltip__popper {
max-width: 70%;
}
//表格样式
.meafixed-table{
width: 100%;
padding: 16px 0;
.el-table {
width: 100%;
height: 100%;
font-size: 14px;
color: #232323;
.el-table-horizontal-scrollbar{
display: none !important;
}
.el-table__fixed-right-patch{
background: rgb(240, 243, 250);
}
th {
height: 40px;
padding: 9px 0px;
}
td {
padding: 9px 0px;
.cell {
color: #232323;
}
}
.cell {
padding-right: 12px;
padding-left: 12px;
line-height: 21px;
font-size: 14px;
font-weight: 400;
}
thead {
color: rgba(35, 35, 35, 0.7);
}
.is-scrolling-left + .el-table__fixed,
.is-scrolling-middle + .el-table__fixed,
.is-scrolling-right + .el-table__fixed {
box-shadow: 2px 0 8px -7px #202020;
height: auto !important;
bottom: 16px !important;
}
.el-table__body tr.current-row > td.el-table__cell {
background: none;
}
.el-table__body-wrapper {
&::-webkit-scrollbar {
width: 16px; //竖轴宽度
height: 16px; //横轴宽度
}
&::-webkit-scrollbar-track {
background-color: #f3f4f5;
border-radius: 0;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0,0,0,.2);
border: 4px solid #f3f4f5;
border-radius: 10px;
&:hover{
background: rgb(125,125,125);
}
}
&::-webkit-scrollbar-corner {
background: #f3f4f5;
/*border-left: 1px solid #E0EAF2;*/
}
tr {
&.current-row > td {
background-color: initial;
}
&:nth-child(2n) {
background: #f8fbff;
}
}
tr:hover > td.el-table__cell {
background: #dcebff;
}
}
.el-table__body tr.hover-row > td.el-table__cell {
background: #dcebff;
}
.el-table__fixed,.el-table__fixed-right {
bottom:16px !important;
.el-table__body {
padding-bottom: 16px;
}
tr:nth-child(2n) {
background-color: #f8fbff;
}
}
.el-scrollbar {
height: 16px;
.el-scrollbar__bar.is-horizontal {
height: 8px;
}
.el-scrollbar__thumb {
background: rgba(0,0,0,.2);
&:hover {
background: #7d7d7d;
}
}
}
}
}
......@@ -20,9 +20,10 @@
<el-button v-if="!isall && isinput" type="primary" size="small" @click="addinputs">保存</el-button>
</div>
<!--汇总-->
<div class="table-item" v-if="isall">
<div class="meafixed-table" v-if="isall">
<el-table element-loading-text="Loading" :data="tableData" row-key="id" v-horizontal-scroll="'hover'" default-expand-all :max-height="tableHeight"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row :cell-class-name="tored" :header-cell-class-name="tored">
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row :cell-class-name="tored" :header-cell-class-name="tored"
:header-cell-style="{ background:'#f0f3fa',color: 'rgba(35,35,35,0.8)'}">
<el-table-column label="序号" width="60" align="left" type="index"></el-table-column>
<el-table-column label="名称" width="220" prop="expenseName">
<template slot-scope="scope">{{scope.row.expenseName || '--'}}</template>
......@@ -39,9 +40,12 @@
</el-table>
</div>
<!--单条-->
<div class="table-item" v-else>
<el-table element-loading-text="Loading" ref="edittable" :data="tableData" row-key="id" v-horizontal-scroll="'hover'" default-expand-all :max-height="tableHeight"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row :cell-class-name="tored1" :header-cell-class-name="tored1">
<div class="meafixed-table" v-else>
<el-table element-loading-text="Loading" ref="edittable" :data="tableData" row-key="id"
:header-cell-style="{ background:'#f0f3fa',color: 'rgba(35,35,35,0.8)'}"
v-horizontal-scroll="'hover'" :max-height="tableHeight"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row
:cell-class-name="tored1" :header-cell-class-name="tored1">
<el-table-column label="序号" width="60" align="left" type="index" fixed="left"></el-table-column>
<el-table-column label="清单内容" width="130" prop="itemContent" fixed="left">
<template slot-scope="scope">{{scope.row.itemContent || '--'}}</template>
......@@ -91,8 +95,10 @@
<el-table-column label="本月成本发生比例" width="150" prop="monthCostRate">
<template slot-scope="scope">
<template v-if="isinput"><el-input v-model="scope.row.monthCostRate "></el-input></template>
<template v-else>{{scope.row.monthCostRate || '--'}}</template>
<template v-if="isinput">
<el-input v-model="scope.row.monthCostRate "></el-input>
</template>
<template v-else>{{scope.row.monthCostRate?scope.row.monthCostRate+'%':'--'}}</template>
</template>
</el-table-column>
<el-table-column label="成本合价" width="130" prop="costEffective">
......@@ -100,7 +106,9 @@
</el-table-column>
<el-table-column label="本月工程量" width="130" prop="projectVolume">
<template slot-scope="scope">
<template v-if="isinput"><el-input v-model="scope.row.projectVolume "></el-input></template>
<template v-if="isinput">
<el-input v-model="scope.row.projectVolume "></el-input>
</template>
<template v-else>{{scope.row.projectVolume || '--'}}</template>
</template>
</el-table-column>
......@@ -115,7 +123,7 @@
<template slot-scope="scope">{{scope.row.remarks || '--'}}</template>
</el-table-column>
<el-table-column label="是否推送" width="130">
<template slot-scope="scope">{{scope.row.pushTime?"是":"否"}}</template>
<template slot-scope="scope">{{scope.row.pushTime?'是':'否'}}</template>
</el-table-column>
<el-table-column label="操作" width="130" fixed="right">
<template slot-scope="scope">
......@@ -185,18 +193,19 @@
</div>
</template>
<script>
import ProjectSideMenu from '@/views/projectCostLedger/detail/components/ProjectSideMenu';
import {
getCostMeasureslist,
getMeasureslist,
getSummarydata,
projectVolume,
pushProjectvolume,
getActualMonthsApi,saveBatch
} from '@/api/projectCostLedger';
import { cloneDeep } from "lodash-es";
import ProjectSideMenu from '@/views/projectCostLedger/detail/components/ProjectSideMenu'
import {
getActualMonthsApi,
getCostMeasureslist,
getMeasureslist,
getSummarydata,
projectVolume,
pushProjectvolume,
saveBatch
} from '@/api/projectCostLedger'
import { cloneDeep } from 'lodash-es'
export default {
export default {
name: "MeasureItems",
props: {
// 项目ID
......@@ -264,6 +273,7 @@ export default {
//可访问data属性
created() {
this.init(this.comProjectId);
// this.createResizeObserver();
},
//计算集
computed: {
......@@ -271,6 +281,30 @@ export default {
},
//方法集
methods: {
getGDT(){
let gdt = document.querySelector('.el-table__body-wrapper')
let w1 = document.querySelector('.el-table__fixed-right-patch')
let w2 = document.querySelector('.el-table__fixed-right')
if(gdt){
let outheight = gdt.scrollHeight
let inheight = gdt.clientHeight
if(outheight>inheight){
if (w1) {
w1.setAttribute('style', `width: 16px;height:40px`)
}
if (w2) {
w2.setAttribute('style', `right: 16px;width:130px`)
}
}else{
if (w1) {
w1.setAttribute('style', `width: 0;height:40px`)
}
if (w2) {
w2.setAttribute('style', `right: 0;width:130px`)
}
}
}
},
tored({column}){
if(column.property=='quantity'){
return 'tored'
......@@ -342,6 +376,12 @@ export default {
const res = await getCostMeasureslist(param);
this.tableData = res.data;
this.isinput = false
// await this.$nextTick()
this.$nextTick(()=>{
setTimeout(()=>{
this.getGDT()
},500)
})
},
async init(detail = '') {
try {
......@@ -421,9 +461,10 @@ export default {
addinputs(){
let tables = JSON.parse(JSON.stringify(this.tableData))
tables.forEach(item=>{
item.planMeasureId = item.id
item.id = item.actualId
item.month = this.expenseDate
item.monthCostRate = item.monthCostRate==''?'':parseInt(item.monthCostRate.replace('%',''))
item.monthCostRate = item.monthCostRate?parseInt(item.monthCostRate.replace('%','')):null
})
saveBatch(JSON.stringify(tables)).then(res=>{
if(res.code == 200){
......@@ -482,12 +523,6 @@ export default {
height: 100%;
background: #fff;
padding: 16px;
.table-item {
margin-top: 16px;
}
::v-deep .el-scrollbar.el-table-horizontal-scrollbar {
display: none !important;
}
}
}
.search {
......
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