Commit 817e664e 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-中建一局二公司

# Conflicts:
#	dsk-operate-ui/src/views/projectCostLedger/detail/components/MeasureItems/index.vue
parents 19b4a81c fea76448
...@@ -67,6 +67,9 @@ user: ...@@ -67,6 +67,9 @@ user:
spring: spring:
application: application:
name: ${ruoyi.name} name: ${ruoyi.name}
jpa:
open-in-view: false
# 资源信息 # 资源信息
messages: messages:
# 国际化资源文件路径 # 国际化资源文件路径
...@@ -324,14 +327,16 @@ lock4j: ...@@ -324,14 +327,16 @@ lock4j:
management: management:
endpoints: endpoints:
enabled-by-default: false enabled-by-default: false
web:
exposure: # endpoints:
include: '*' # web:
endpoint: # exposure:
health: # include: '*'
show-details: ALWAYS # endpoint:
logfile: # health:
external-file: ./logs/sys-console.log # show-details: ALWAYS
# logfile:
# external-file: ./logs/sys-console.log
gv: gv:
img-path: D:\dsk\dsk-operate-sys\ img-path: D:\dsk\dsk-operate-sys\
......
...@@ -3,6 +3,7 @@ package com.dsk.cscec.controller; ...@@ -3,6 +3,7 @@ package com.dsk.cscec.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore; import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.dsk.common.annotation.Log; import com.dsk.common.annotation.Log;
...@@ -24,11 +25,13 @@ import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo; ...@@ -24,11 +25,13 @@ import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo; import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresImportVo; import com.dsk.cscec.domain.vo.CbCostMeasuresImportVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresItemVo; import com.dsk.cscec.domain.vo.CbCostMeasuresItemVo;
import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryVo;
import com.dsk.cscec.listener.ProjectCostMeasureImportListener; import com.dsk.cscec.listener.ProjectCostMeasureImportListener;
import com.dsk.cscec.service.CbProjectExpenseSummaryService; import com.dsk.cscec.service.CbProjectExpenseSummaryService;
import com.dsk.cscec.service.ICbCostMeasureService; import com.dsk.cscec.service.ICbCostMeasureService;
import com.dsk.system.domain.vo.SysUserImportVo; import com.dsk.system.domain.vo.SysUserImportVo;
import com.dsk.system.listener.SysUserImportListener; import com.dsk.system.listener.SysUserImportListener;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -63,6 +66,22 @@ public class CbCostMeasureController { ...@@ -63,6 +66,22 @@ public class CbCostMeasureController {
private CbProjectExpenseSummaryService cbProjectExpenseSummaryService; private CbProjectExpenseSummaryService cbProjectExpenseSummaryService;
/**
* 获取实际月份列表
*
* @param cbCostMeasureBo CB成本衡量范围
* @return {@link R}<{@link List}<{@link String}>>
*/
@SaIgnore
@GetMapping(value = "/actual/months")
public R<List<String>> actualMonths(CbCostMeasureActualBo cbCostMeasureBo) {
List<String> data = cbCostMeasureService.actualMonthList(cbCostMeasureBo);
if (ObjectUtil.isNull(data)) {
data = new ArrayList<>();
}
return R.ok(data);
}
/** /**
* 措施费一级大类 * 措施费一级大类
* 根据项目查询措施费一级大类 * 根据项目查询措施费一级大类
...@@ -91,8 +110,13 @@ public class CbCostMeasureController { ...@@ -91,8 +110,13 @@ public class CbCostMeasureController {
// @SaCheckPermission("cb:costmeasures:list") // @SaCheckPermission("cb:costmeasures:list")
@SaIgnore @SaIgnore
@GetMapping("/list") @GetMapping("/list")
public R<List<CbCostMeasureActualVo>> list(CbCostMeasureActualBo cbCostMeasure) { public R<List> list(CbCostMeasureActualBo cbCostMeasure) {
List<CbCostMeasureActualVo> data= cbCostMeasureService.selectDataList(cbCostMeasure); if(ObjectUtil.isNotEmpty(cbCostMeasure)&&cbCostMeasure.getId()==0){
Integer dataType=2;
List<CbProjectExpenseSummaryVo> dataList = cbCostMeasureService.getSummaryData(cbCostMeasure.getProjectId(),dataType,cbCostMeasure.getMonth());
return R.ok(dataList);
}
List<Tree<Long>> data= cbCostMeasureService.selectDataList(cbCostMeasure);
if (ObjectUtil.isNull(data)) { if (ObjectUtil.isNull(data)) {
data = new ArrayList<>(); data = new ArrayList<>();
} }
...@@ -133,6 +157,24 @@ public class CbCostMeasureController { ...@@ -133,6 +157,24 @@ public class CbCostMeasureController {
/**
* 获取上一次推送工程量
*
* @param measuresId 推送BO
* @return {@link R}<{@link List}<{@link CbCostMeasureActualVo}>>
*/
// @SaCheckPermission("cb:costmeasures:actual:push")
@SaIgnore
@GetMapping("/last/project/volume/{measuresId}")
public R<Object> lastProjectVolume(@PathVariable("measuresId") Long measuresId) {
Assert.notNull(measuresId,"措施费记录id不能为空!");
Object pushJson= cbCostMeasureService.lastProjectVolume(measuresId);
return R.ok("操作成功",pushJson);
}
/** /**
* 获取批量措施费列表 * 获取批量措施费列表
...@@ -200,10 +242,10 @@ public class CbCostMeasureController { ...@@ -200,10 +242,10 @@ public class CbCostMeasureController {
@Log(title = "措施费汇总获取") @Log(title = "措施费汇总获取")
// @SaCheckPermission("system:user:import") // @SaCheckPermission("system:user:import")
@PostMapping(value = "/summary/data") @PostMapping(value = "/summary/data")
public R<List<CbProjectExpenseSummary>> summaryData(Long projectId) throws Exception { public R<List<CbProjectExpenseSummaryVo>> summaryData(Long projectId,String month) throws Exception {
Integer dataType=2; Integer dataType=2;
List<CbProjectExpenseSummary> cbProjectExpenseSummaries = cbProjectExpenseSummaryService.queryCbSceneExpenseSummaryDataByType(projectId, dataType); List<CbProjectExpenseSummaryVo> dataList = cbCostMeasureService.getSummaryData(projectId,dataType,month);
return R.ok(cbProjectExpenseSummaries); return R.ok(dataList);
} }
......
...@@ -16,33 +16,33 @@ public class CbCostMeasureActualPushBo { ...@@ -16,33 +16,33 @@ public class CbCostMeasureActualPushBo {
/** /**
* 截止本月工程量 * 本月实际工程量
*/
private BigDecimal costEffective;
/**
* 本月实际工程量
*/ */
@TableField(value = "current_project_volume")
private BigDecimal currentProjectVolume; private BigDecimal currentProjectVolume;
/** /**
* 推送工程量 * 推送工程量
*/ */
@TableField(value = "submit_project_volume")
private BigDecimal submitProjectVolume; private BigDecimal submitProjectVolume;
/** /**
* 年月 * 年月
*/ */
@TableField(value = "`month`")
private String month; private String month;
/** /**
* 推送时间 * 推送时间
*/ */
@TableField(value = "push_time")
private Date pushTime; private Date pushTime;
/** /**
* 推送数据json * 推送数据json
*/ */
@TableField(value = "push_data_json")
private String pushDataJson; private String pushDataJson;
/** /**
......
...@@ -9,6 +9,7 @@ import lombok.Data; ...@@ -9,6 +9,7 @@ import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
public class CbCostMeasureActualVo { public class CbCostMeasureActualVo {
...@@ -17,6 +18,10 @@ public class CbCostMeasureActualVo { ...@@ -17,6 +18,10 @@ public class CbCostMeasureActualVo {
*/ */
private Long id; private Long id;
private Long parentId;
/** /**
* 序号 * 序号
*/ */
...@@ -138,6 +143,9 @@ public class CbCostMeasureActualVo { ...@@ -138,6 +143,9 @@ public class CbCostMeasureActualVo {
private Date pushTime; private Date pushTime;
private String pushDataJson;
/** /**
* 修改人 * 修改人
*/ */
...@@ -162,6 +170,10 @@ public class CbCostMeasureActualVo { ...@@ -162,6 +170,10 @@ public class CbCostMeasureActualVo {
@TableField(value = "update_time") @TableField(value = "update_time")
private Date updateTime; private Date updateTime;
private List<CbCostMeasureActualVo> childrens;
public static final String COL_ID = "id"; public static final String COL_ID = "id";
public static final String COL_PLAN_MEASURE_ID = "plan_measure_id"; public static final String COL_PLAN_MEASURE_ID = "plan_measure_id";
......
package com.dsk.cscec.domain.vo;
import com.baomidou.mybatisplus.annotation.*;
import com.dsk.common.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 项目费用汇总表
*/
@Data
public class CbProjectExpenseSummaryVo {
/**
* 主键ID
*/
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 项目文件ID
*/
private Long projectFileId;
/**
* 成本阶段(0:标前成本、1:标后成本、2:转固成本)
*/
private Integer cbStage;
/**
* 序号
*/
private String number;
/**
* 数据类型(2:措施项目、3:其他项目、4:现场经费)
*/
private Integer dataType;
/**
* 名称
*/
private String expenseName;
/**
* 数值
*/
private String expenseValue;
/**
* 占比
*/
private String proportion;
/**
* 本月工程量
*/
private BigDecimal monthsProjectQuantity;
}
\ No newline at end of file
...@@ -13,4 +13,6 @@ public interface CbCostMeasureActualMapper extends BaseMapper<CbCostMeasureActua ...@@ -13,4 +13,6 @@ public interface CbCostMeasureActualMapper extends BaseMapper<CbCostMeasureActua
int updateByPrimaryKeySelective(CbCostMeasureActual record); int updateByPrimaryKeySelective(CbCostMeasureActual record);
List<CbCostMeasureActualVo> selectDataList(CbCostMeasureActualBo costMeasureActualBo); List<CbCostMeasureActualVo> selectDataList(CbCostMeasureActualBo costMeasureActualBo);
List<CbCostMeasureActualVo> getMonthActualCostList(Long projectId, String month);
} }
\ No newline at end of file
...@@ -7,10 +7,13 @@ import com.dsk.cscec.domain.CbCostMeasure; ...@@ -7,10 +7,13 @@ import com.dsk.cscec.domain.CbCostMeasure;
import com.dsk.cscec.domain.CbQuantitySummary; import com.dsk.cscec.domain.CbQuantitySummary;
import com.dsk.cscec.domain.bo.CbCostMeasureActualBo; import com.dsk.cscec.domain.bo.CbCostMeasureActualBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo; import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface CbCostMeasureMapper extends BaseMapper<CbCostMeasure> { public interface CbCostMeasureMapper extends BaseMapper<CbCostMeasure> {
List<CbCostMeasureActualVo> selectListByProjectAndNo(CbCostMeasureActualBo cbCostMeasure); List<CbCostMeasureActualVo> selectListByProjectAndNo(CbCostMeasureActualBo cbCostMeasure);
List<String> actualMonthList(CbCostMeasureActualBo cbCostMeasureBo);
} }
\ No newline at end of file
...@@ -19,5 +19,6 @@ import java.util.Map; ...@@ -19,5 +19,6 @@ import java.util.Map;
*/ */
public interface ICbCostMeasureActualService extends IService<CbCostMeasureActual> { public interface ICbCostMeasureActualService extends IService<CbCostMeasureActual> {
List<CbCostMeasureActualVo> getMonthActualCostList(Long projectId, String month);
} }
package com.dsk.cscec.service; package com.dsk.cscec.service;
import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.entity.SysDictData;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.cscec.domain.CbCostMeasure; import com.dsk.cscec.domain.CbCostMeasure;
import com.dsk.cscec.domain.CbProjectExpenseSummary;
import com.dsk.cscec.domain.bo.CbCostMeasureActualBo; import com.dsk.cscec.domain.bo.CbCostMeasureActualBo;
import com.dsk.cscec.domain.bo.CbCostMeasureActualPushBo; import com.dsk.cscec.domain.bo.CbCostMeasureActualPushBo;
import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo; import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo; import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresItemVo; import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryVo;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
...@@ -29,7 +25,7 @@ public interface ICbCostMeasureService extends IService<CbCostMeasure> { ...@@ -29,7 +25,7 @@ public interface ICbCostMeasureService extends IService<CbCostMeasure> {
List<Map<String, Object>> listByLevel(Long projectId, int i); List<Map<String, Object>> listByLevel(Long projectId, int i);
List<CbCostMeasureActualVo> selectDataList(CbCostMeasureActualBo cbCostMeasure); List<Tree<Long>> selectDataList(CbCostMeasureActualBo cbCostMeasure);
void saveBatchCostMeasureActual(List<CbCostMeasureActualSaveBo> boList); void saveBatchCostMeasureActual(List<CbCostMeasureActualSaveBo> boList);
...@@ -40,5 +36,11 @@ public interface ICbCostMeasureService extends IService<CbCostMeasure> { ...@@ -40,5 +36,11 @@ public interface ICbCostMeasureService extends IService<CbCostMeasure> {
void parseCbCostMeasureFile(Long projectId); void parseCbCostMeasureFile(Long projectId);
boolean reparseCbCostMeasureFile(Long projectId,Long projectFileId); boolean reparseCbCostMeasureFile(Long projectId,Long projectFileId);
String lastProjectVolume(Long measuresId);
List<String> actualMonthList(CbCostMeasureActualBo cbCostMeasureBo);
List<CbProjectExpenseSummaryVo> getSummaryData(Long projectId, Integer dataType,String month);
} }
package com.dsk.cscec.service.impl; package com.dsk.cscec.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.file.FileNameUtil; import cn.hutool.core.io.file.FileNameUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.ReUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
...@@ -16,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -16,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.excel.ExcelResult; import com.dsk.common.excel.ExcelResult;
import com.dsk.common.helper.LoginHelper; import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.JsonUtils; import com.dsk.common.utils.JsonUtils;
import com.dsk.common.utils.TreeBuildUtils;
import com.dsk.common.utils.poi.ExcelUtil; import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.cscec.constant.CbProjectConstants; import com.dsk.cscec.constant.CbProjectConstants;
import com.dsk.cscec.domain.*; import com.dsk.cscec.domain.*;
...@@ -25,6 +31,7 @@ import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo; ...@@ -25,6 +31,7 @@ import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo; import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresImportVo; import com.dsk.cscec.domain.vo.CbCostMeasuresImportVo;
import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryImportVo; import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryImportVo;
import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryVo;
import com.dsk.cscec.listener.ProjectCostMeasureImportListener; import com.dsk.cscec.listener.ProjectCostMeasureImportListener;
import com.dsk.cscec.listener.ProjectCostMeasureSummaryImportListener; import com.dsk.cscec.listener.ProjectCostMeasureSummaryImportListener;
import com.dsk.cscec.service.*; import com.dsk.cscec.service.*;
...@@ -37,11 +44,10 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -37,11 +44,10 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.math.BigDecimal;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
...@@ -161,27 +167,53 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C ...@@ -161,27 +167,53 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
} }
@Override @Override
public List<CbCostMeasureActualVo> selectDataList(CbCostMeasureActualBo costMeasureActualBo) { public List<Tree<Long>> selectDataList(CbCostMeasureActualBo costMeasureActualBo) {
List<CbCostMeasureActualVo> dataList = new ArrayList<>(); List<CbCostMeasureActualVo> dataList = new ArrayList<>();
Assert.notNull(costMeasureActualBo.getProjectId(), "项目ID不能为空"); Assert.notNull(costMeasureActualBo.getProjectId(), "项目ID不能为空");
CbProjectRecord byId = cbProjectRecordService.getById(costMeasureActualBo.getProjectId()); checkProjectExist(costMeasureActualBo.getProjectId());
Assert.notNull(byId, "项目信息不能为空");
//查询项目某项措施费所有计划成本 //查询项目某项措施费所有计划成本
dataList = baseMapper.selectListByProjectAndNo(costMeasureActualBo); dataList = baseMapper.selectListByProjectAndNo(costMeasureActualBo);
// if (CollectionUtil.isEmpty(dataList)) {
// return dataList;
// }
// // 查询项目某项措施费某月所有实际成本
// List<CbCostMeasureActualVo> actualVoList= cbCostMeasureActualMapper.selectDataList(costMeasureActualBo);
// if (CollectionUtil.isEmpty(actualVoList)) {
// return dataList;
// }
// for (CbCostMeasureActualVo cbCostMeasureActualVo : actualVoList) {
//
// }
return dataList; //配置类
TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
treeNodeConfig.setIdKey("id");
treeNodeConfig.setParentIdKey("parentId");
treeNodeConfig.setChildrenKey("childrens");
//构建树形
List<Tree<Long>> trees = TreeUtil.build(dataList, costMeasureActualBo.getId(), treeNodeConfig, ((object, treeNode) -> {
treeNode.setId(object.getId());//id
treeNode.setParentId(object.getParentId());//父id
// 扩展属性 ...
treeNode.putExtra("itemContent", object.getItemContent());
treeNode.putExtra("number", object.getNumber());
treeNode.putExtra("workContent", object.getWorkContent());
treeNode.putExtra("unit", object.getUnit());
treeNode.putExtra("quantity", object.getQuantity());
treeNode.putExtra("unitPriceExcludingTax", object.getUnitPriceExcludingTax());
treeNode.putExtra("usageTime", object.getUsageTime());
treeNode.putExtra("amountExcludingTax", object.getAmountExcludingTax());
treeNode.putExtra("taxRate", object.getTaxRate());
treeNode.putExtra("amountIncludingTax", object.getAmountIncludingTax());
treeNode.putExtra("amortizationRatio", object.getAmortizationRatio());
treeNode.putExtra("amountIncludeTaxAmortized", object.getAmountIncludeTaxAmortized());
treeNode.putExtra("amountExcludeTaxAmortized", object.getAmountExcludeTaxAmortized());
treeNode.putExtra("taxAmount", object.getTaxAmount());
treeNode.putExtra("remarks", object.getRemarks());
treeNode.putExtra("costSubject", object.getCostSubject());
treeNode.putExtra("taxType", object.getTaxType());
treeNode.putExtra("planMeasureId", object.getPlanMeasureId());
treeNode.putExtra("monthCostRate", object.getMonthCostRate());
treeNode.putExtra("costEffective", object.getCostEffective());
treeNode.putExtra("currentProjectVolume", object.getCurrentProjectVolume());
treeNode.putExtra("submitProjectVolume", object.getSubmitProjectVolume());
treeNode.putExtra("month", object.getMonth());
treeNode.putExtra("pushTime", object.getPushTime());
treeNode.putExtra("pushDataJson", object.getPushDataJson());
treeNode.putExtra("createTime", object.getCreateTime());
}));
return trees;
} }
@Override @Override
...@@ -212,7 +244,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C ...@@ -212,7 +244,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
@SneakyThrows @SneakyThrows
@Override @Override
public List<String> importExcelSummaryData(InputStream inputStream, Long projectId,Long fileId, Integer dataType) { public List<String> importExcelSummaryData(InputStream inputStream, Long projectId, Long fileId, Integer dataType) {
CbProjectRecord byId = cbProjectRecordService.getById(projectId); CbProjectRecord byId = cbProjectRecordService.getById(projectId);
Assert.notNull(byId, "项目信息不能为空"); Assert.notNull(byId, "项目信息不能为空");
...@@ -256,7 +288,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C ...@@ -256,7 +288,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
if ("措施费".equals(prefix)) { if ("措施费".equals(prefix)) {
byte[] bytes = HttpUtil.downloadBytes(cbProjectFile.getFileOssUrl()); byte[] bytes = HttpUtil.downloadBytes(cbProjectFile.getFileOssUrl());
InputStream inputStream = new ByteArrayInputStream(bytes); InputStream inputStream = new ByteArrayInputStream(bytes);
List<String> errlist = importExcelSummaryData(inputStream, projectId,cbProjectFile.getId(), 2); List<String> errlist = importExcelSummaryData(inputStream, projectId, cbProjectFile.getId(), 2);
if (CollectionUtil.isNotEmpty(errlist)) { if (CollectionUtil.isNotEmpty(errlist)) {
cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL); cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
} else { } else {
...@@ -274,7 +306,8 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C ...@@ -274,7 +306,8 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
} }
} }
private void checkProjectExist(Long projectId){
private void checkProjectExist(Long projectId) {
CbProjectRecord byId = cbProjectRecordService.getById(projectId); CbProjectRecord byId = cbProjectRecordService.getById(projectId);
Assert.notNull(byId, "项目信息不能为空"); Assert.notNull(byId, "项目信息不能为空");
} }
...@@ -296,7 +329,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C ...@@ -296,7 +329,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
if ("措施费".equals(prefix)) { if ("措施费".equals(prefix)) {
byte[] bytes = HttpUtil.downloadBytes(cbProjectFile.getFileOssUrl()); byte[] bytes = HttpUtil.downloadBytes(cbProjectFile.getFileOssUrl());
InputStream inputStream = new ByteArrayInputStream(bytes); InputStream inputStream = new ByteArrayInputStream(bytes);
List<String> errlist = importExcelSummaryData(inputStream, projectId,projectFileId, 2); List<String> errlist = importExcelSummaryData(inputStream, projectId, projectFileId, 2);
if (CollectionUtil.isNotEmpty(errlist)) { if (CollectionUtil.isNotEmpty(errlist)) {
cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL); cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
} else { } else {
...@@ -319,6 +352,55 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C ...@@ -319,6 +352,55 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
return false; return false;
} }
@Override
public String lastProjectVolume(Long measuresId) {
LambdaQueryWrapper<CbCostMeasureActual> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(CbCostMeasureActual::getPlanMeasureId, measuresId)
.isNotNull(CbCostMeasureActual::getPushTime)
.orderByDesc(CbCostMeasureActual::getUpdateTime).last(" limit 1");
CbCostMeasureActual cbCostMeasureActual = cbCostMeasureActualService.getOne(lambdaQueryWrapper);
if (ObjectUtil.isNotEmpty(cbCostMeasureActual)) {
return cbCostMeasureActual.getPushDataJson();
}
return null;
}
@Override
public List<String> actualMonthList(CbCostMeasureActualBo cbCostMeasureBo) {
List<String> months = baseMapper.actualMonthList(cbCostMeasureBo);
return months;
}
@Override
public List<CbProjectExpenseSummaryVo> getSummaryData(Long projectId, Integer dataType, String month) {
List<CbProjectExpenseSummaryVo> dataList = new ArrayList<>();
List<CbProjectExpenseSummary> cbProjectExpenseSummaries = cbProjectExpenseSummaryService.queryCbSceneExpenseSummaryDataByType(projectId, dataType);
if (CollectionUtil.isEmpty(cbProjectExpenseSummaries)) {
return new ArrayList<>();
}
Map<String, BigDecimal> map = new HashMap<>();
//查询本月实际工程量
List<CbCostMeasureActualVo> monthActualCostList = cbCostMeasureActualService.getMonthActualCostList(projectId, month);
if (CollectionUtil.isNotEmpty(monthActualCostList)) {
map = monthActualCostList.stream()
.collect(Collectors.toMap(
CbCostMeasureActualVo::getItemContent, // 把CbCostMeasureActualVo属性提取为map的key
CbCostMeasureActualVo::getCostEffective // 把CbCostMeasureActualVo属性提取为map的value
));
}
for (CbProjectExpenseSummary cbProjectExpenseSummary : cbProjectExpenseSummaries) {
CbProjectExpenseSummaryVo summaryVo = BeanUtil.copyProperties(cbProjectExpenseSummary, CbProjectExpenseSummaryVo.class);
summaryVo.setMonthsProjectQuantity(map.get(cbProjectExpenseSummary.getExpenseName()));
dataList.add(summaryVo);
}
return dataList;
}
/** /**
* 根据当前序号、项目id、成本阶段查询父级信息 * 根据当前序号、项目id、成本阶段查询父级信息
......
...@@ -3,11 +3,14 @@ package com.dsk.cscec.service.impl; ...@@ -3,11 +3,14 @@ package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.cscec.domain.CbCostMeasure; import com.dsk.cscec.domain.CbCostMeasure;
import com.dsk.cscec.domain.CbCostMeasureActual; import com.dsk.cscec.domain.CbCostMeasureActual;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.mapper.CbCostMeasureActualMapper; import com.dsk.cscec.mapper.CbCostMeasureActualMapper;
import com.dsk.cscec.mapper.CbCostMeasureMapper; import com.dsk.cscec.mapper.CbCostMeasureMapper;
import com.dsk.cscec.service.ICbCostMeasureActualService; import com.dsk.cscec.service.ICbCostMeasureActualService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author tanyang * @author tanyang
* @create 2024-02-07 9:38 * @create 2024-02-07 9:38
...@@ -15,4 +18,8 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +18,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ICbCostMeasureActualServiceImpl extends ServiceImpl<CbCostMeasureActualMapper, CbCostMeasureActual> implements ICbCostMeasureActualService { public class ICbCostMeasureActualServiceImpl extends ServiceImpl<CbCostMeasureActualMapper, CbCostMeasureActual> implements ICbCostMeasureActualService {
@Override
public List<CbCostMeasureActualVo> getMonthActualCostList(Long projectId, String month) {
return baseMapper.getMonthActualCostList(projectId,month);
}
} }
...@@ -174,4 +174,14 @@ ...@@ -174,4 +174,14 @@
AND t.cb_stage=#{cbStage} AND t.cb_stage=#{cbStage}
AND t1.`month`=#{month} AND t1.`month`=#{month}
</select> </select>
<select id="getMonthActualCostList" resultType="com.dsk.cscec.domain.vo.CbCostMeasureActualVo">
SELECT t1.item_content, t.cost_effective
FROM cb_cost_measure_actual t
inner JOIN cb_cost_measure t1 ON t1.id=t.plan_measure_id
WHERE
t1.project_id=1
AND t1.parent_id=0
AND t.`month`='202406'
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
id, project_id, cb_stage, parent_id, `level`, `number`, `no`,item_content, work_content, id, project_id, cb_stage, parent_id, `level`, `number`, `no`,item_content, work_content,
unit, quantity, unit_price_excluding_tax, usage_time, amount_excluding_tax, tax_rate, unit, quantity, unit_price_excluding_tax, usage_time, amount_excluding_tax, tax_rate,
amount_including_tax, amortization_ratio, amount_exclude_tax_amortized, amount_include_tax_amortized, amount_including_tax, amortization_ratio, amount_exclude_tax_amortized, amount_include_tax_amortized,
tax_amount, remarks, cost_subject, tax_type, create_time, update_time tax_amount, remarks, cost_subject, tax_type,data_source, create_time, update_time
</sql> </sql>
...@@ -54,4 +54,15 @@ ...@@ -54,4 +54,15 @@
AND t.`no` like concat(#{id},'.%') AND t.`no` like concat(#{id},'.%')
ORDER BY id ASC ORDER BY id ASC
</select> </select>
<select id="actualMonthList" resultType="java.lang.String">
SELECT
t1.`month`
FROM cb_cost_measure t
inner JOIN cb_cost_measure_actual t1 ON t1.plan_measure_id=t.id
WHERE
t.project_id=#{projectId}
and t1.del_flag=0
GROUP BY t1.`month` ORDER BY t1.`month` desc
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -57,6 +57,14 @@ export function getProjectFileUploadDetail(projectId) { ...@@ -57,6 +57,14 @@ export function getProjectFileUploadDetail(projectId) {
}); });
} }
//根据项目文件导入数据
export function importData(projectId) {
return request({
url: '/cbProjectRecord/importData/'+projectId,
method: 'get',
});
}
//获取草稿箱列表 //获取草稿箱列表
export function getDraftDialogList(projectId) { export function getDraftDialogList(projectId) {
return request({ return request({
...@@ -78,7 +86,7 @@ export function deleteCbProjectFile(data) { ...@@ -78,7 +86,7 @@ export function deleteCbProjectFile(data) {
return request({ return request({
url: '/cbProjectFile/deleteCbProjectFile', url: '/cbProjectFile/deleteCbProjectFile',
method: 'Delete', method: 'Delete',
data:data data: data
}); });
} }
...@@ -160,28 +168,37 @@ export function pushProjectvolume(data) { ...@@ -160,28 +168,37 @@ export function pushProjectvolume(data) {
return request({ return request({
url: '/cb/cost/measures/push/project/volume', url: '/cb/cost/measures/push/project/volume',
method: 'post', method: 'post',
data:data data: data
}); });
} }
//措措施费-获取上一次推送工程量 //措措施费-获取上一次推送工程量
export function projectVolume(data) { export function projectVolume(data) {
return request({ return request({
url: '/cb/cost/measures/last/project/volume/'+data, url: '/cb/cost/measures/last/project/volume/' + data,
method: 'GET', method: 'GET',
}); });
} }
//措施费-获取实际成本月份列表 //措施费-获取实际成本月份列表
export function actualMonths(params) { export const getActualMonthsApi = (params = {}) => request({
return request({
url: '/cb/cost/measures/actual/months', url: '/cb/cost/measures/actual/months',
method: 'GET', method: 'get',
params params
});
//批量保存或修改每月措施费
export function saveBatch(data) {
return request({
url: '/cb/cost/measures/saveBatch',
method: 'post',
data:data,
}); });
} }
// 工料汇总 // 工料汇总
/** /**
...@@ -195,6 +212,17 @@ export const getFeedSummaryMenuTreeApi = (params = {}) => request({ ...@@ -195,6 +212,17 @@ export const getFeedSummaryMenuTreeApi = (params = {}) => request({
params params
}); });
/**
* 获取已记录月份集合
* @param {*} params
* @returns
*/
export const getFeedSummaryMonthListApi = (params = {}) => request({
url: "/cb/quantity/summary/monthList",
method: "get",
params
});
/** /**
* 获取科目月份列表 * 获取科目月份列表
* @param {{ * @param {{
......
<template>
<div class="dsk-skeleton-outer-container">
<el-skeleton :animated="true" class="dsk-skeleton-inner-container">
<template slot="template">
<template v-for="item of count">
<div :key="item">
<el-skeleton-item variant="text" style="width: 60%;" />
<el-skeleton-item variant="text" style="width: 100%;" />
<el-skeleton-item variant="text" style="width: 100%;" />
<el-skeleton-item variant="text" style="width: 100%;" />
</div>
</template>
</template>
</el-skeleton>
</div>
</template>
<script>
export default {
name: 'dskSkeleton',
data() {
return {
count: 0
};
},
created() {
this.getSkeletonCount();
},
methods: {
async getSkeletonCount() {
try {
await this.$nextTick();
const skeletonContainer = this.$el.querySelector(".dsk-skeleton-inner-container");
const height = skeletonContainer.offsetHeight;
// 160高度为一组
const group = Math.round(height / 160);
this.count = group;
} catch (error) {
}
}
}
}
</script>
<style lang="scss" scoped>
.dsk-skeleton-outer-container {
padding: 0px 16px;
background: #fff;
z-index: 999;
.dsk-skeleton-inner-container {
width: 100%;
height: 100%;
overflow: hidden;
}
}
.el-skeleton__item {
height: 20px;
border-radius: 0;
margin-top: 16px;
background: #f0f0f0;
}
.el-skeleton {
.el-skeleton__item:last-of-type {
/* margin-bottom: 16px; */
}
}
</style>
...@@ -3,11 +3,13 @@ ...@@ -3,11 +3,13 @@
<!-- tab列表 --> <!-- tab列表 -->
<div class="dsk-tab-items-container"> <div class="dsk-tab-items-container">
<div class="dsk-tab-items-container-inner"> <div class="dsk-tab-items-container-inner">
<div class="dsk-tab-item" v-for="item of tabs" :key="item.id" :class="{'tab-current' : item.value == currentValue}"> <div class="dsk-tab-item" v-for="item of tabs" :key="item.id"
<div class="dsk-tab-item-name" @click="tabChoose(item)">{{item.name}}</div> :class="{'tab-current' : item.value == currentValue,'tab-is-disabled' : item.disabled || comDisabled}">
<div class="dsk-tab-item-name" @click="item.disabled || comDisabled ? '' : tabChoose(item)">{{item.name}}</div>
</div> </div>
<!-- 下滑条 --> <!-- 下滑条 -->
<div class="dsk-tab-sliding-bar" v-if="tabs.length" :style="{width : `${silidingBarWidth}px`,transform : `translateX(${silidingBarLeft}px)`}"> <div class="dsk-tab-sliding-bar" v-if="tabs.length && this.showTabsSlidingbar && !comDisabled"
:style="{width : `${silidingBarWidth}px`,transform : `translateX(${silidingBarLeft}px)`}">
</div> </div>
</div> </div>
</div> </div>
...@@ -25,6 +27,10 @@ export default { ...@@ -25,6 +27,10 @@ export default {
required: true, required: true,
type: Array, type: Array,
default: () => [] default: () => []
},
disabled: {
type: Boolean,
default: false
} }
}, },
watch: { watch: {
...@@ -32,6 +38,12 @@ export default { ...@@ -32,6 +38,12 @@ export default {
handler(newValue) { handler(newValue) {
this.initSlidingBar(); this.initSlidingBar();
} }
},
// 全部禁用不显示滚动条
disabled: {
handler(newValue) {
this.comDisabled = newValue ? true : false;
}
} }
}, },
model: { model: {
...@@ -41,7 +53,8 @@ export default { ...@@ -41,7 +53,8 @@ export default {
data() { data() {
return { return {
silidingBarLeft: 0, silidingBarLeft: 0,
silidingBarWidth: 0 silidingBarWidth: 0,
comDisabled: this.disabled ? true : false
}; };
}, },
//可访问data属性 //可访问data属性
...@@ -50,7 +63,13 @@ export default { ...@@ -50,7 +63,13 @@ export default {
}, },
//计算集 //计算集
computed: { computed: {
showTabsSlidingbar() {
const current = this.tabs.find(item => item.value == this.currentValue);
if (current) {
return current.disabled ? false : true;
}
return false;
}
}, },
//方法集 //方法集
methods: { methods: {
...@@ -124,6 +143,13 @@ export default { ...@@ -124,6 +143,13 @@ export default {
font-weight: bold; font-weight: bold;
} }
} }
&.tab-is-disabled {
.dsk-tab-item-name {
color: #eee;
cursor: not-allowed;
}
}
} }
.dsk-tab-sliding-bar { .dsk-tab-sliding-bar {
......
...@@ -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" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive" <project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="currentNodeName"
@select="menuSelect"> @select="menuSelect">
<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="">
...@@ -17,8 +17,12 @@ ...@@ -17,8 +17,12 @@
<div class="right-table-list-container"> <div class="right-table-list-container">
<div class="project-table-list-header"> <div class="project-table-list-header">
<div class="project-table-list-haeder-left"> <div class="project-table-list-haeder-left">
<el-date-picker v-model="recordDate" type="month" placeholder="选择月" format="yyyy年MM月" value-format="yyyy-MM" <!-- <el-date-picker v-model="recordDate" type="month" placeholder="选择月" format="yyyy年MM月" value-format="yyyy-MM"
class="project-record-date" @change="timeChange"></el-date-picker> class="project-record-date" @change="timeChange"></el-date-picker> -->
<el-select v-model="recordDate" placeholder="请选择年月" class="project-month-select-options" clearable @change="monthChange">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div> </div>
<div class="project-table-list-haeder-right"> <div class="project-table-list-haeder-right">
<!-- 实体工程材料单位换算 --> <!-- 实体工程材料单位换算 -->
...@@ -29,16 +33,24 @@ ...@@ -29,16 +33,24 @@
<dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting> <dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting>
</div> </div>
</div> </div>
<!-- 数据列表部分 -->
<div class="project-feedsummary-list-container">
<dsk-skeleton v-if="tableLoading"></dsk-skeleton>
<table-list-com :tableData="tableDataList" v-else-if="!tableLoading" :tableDataTotal="total" :paging="false"></table-list-com>
</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu"; import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu";
import { getFeedSummaryMenuTreeApi, getFeedSummaryListApi } from "@/api/projectCostLedger"; import { getFeedSummaryMenuTreeApi, getFeedSummaryMonthListApi, getFeedSummaryListApi } from "@/api/projectCostLedger";
import DskTableHeaderSetting from "@/components/DskTableHeaderSetting"; import DskTableHeaderSetting from "@/components/DskTableHeaderSetting";
import DskSkeleton from "@/components/DskSkeleton";
import TableListCom from "@/components/TableListCom"; import TableListCom from "@/components/TableListCom";
import { v4 } from 'uuid'; import { v4 } from 'uuid';
import dayjs from "dayjs";
import { cloneDeep } from "lodash-es";
export default { export default {
name: "feedSummary", name: "feedSummary",
props: { props: {
...@@ -57,23 +69,22 @@ export default { ...@@ -57,23 +69,22 @@ export default {
watch: { watch: {
projectDetailInfo: { projectDetailInfo: {
handler(newValue) { handler(newValue) {
this.comProjectDetailInfo = newValue ? newValue : {}; this.comProjectDetailInfo = newValue ? cloneDeep(newValue) : {};
this.init(this.comProjectDetailInfo); this.init(this.comProjectDetailInfo);
}, },
deep: true, deep: true,
immediate: true
}, },
projectId: { projectId: {
handler(newValue) { handler(newValue) {
this.comProjectId = newValue; this.comProjectId = newValue;
}, }
immediate: true
} }
}, },
components: { components: {
ProjectSideMenu, ProjectSideMenu,
DskTableHeaderSetting, DskTableHeaderSetting,
TableListCom TableListCom,
DskSkeleton
}, },
data() { data() {
return { return {
...@@ -81,23 +92,35 @@ export default { ...@@ -81,23 +92,35 @@ export default {
nodeName: "name", nodeName: "name",
nodeValue: "name", nodeValue: "name",
}, },
comProjectDetailInfo: {}, comProjectDetailInfo: this.projectDetailInfo ? cloneDeep(this.projectDetailInfo) : {},
comProjectId: "", comProjectId: this.projectId,
defaultActive: "",
menuTreeList: [], menuTreeList: [],
// 加载数据列表
tableLoading: false,
total: 0,
// 列表表头 // 列表表头
formColum: [ formColum: [
{ label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() }, { label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() },
], ],
// 已记录月份集合
monthList: [],
// 源数据月份
originMonthList: [],
// 当前查询的数据月份 // 当前查询的数据月份
recordDate: "", recordDate: "",
// 历史查询月份
oldRecordDate: "",
// 当前选中子菜单的父类名称 // 当前选中子菜单的父类名称
currentParentName: "" currentParentName: "",
// 当前选中的成本科目
currentNodeName: "",
// 数据列表
tableDataList: []
}; };
}, },
//可访问data属性 //可访问data属性
created() { created() {
this.init(this.comProjectDetailInfo);
}, },
//计算集 //计算集
computed: { computed: {
...@@ -109,10 +132,64 @@ export default { ...@@ -109,10 +132,64 @@ export default {
try { try {
const { projectId, cbStage } = detail; const { projectId, cbStage } = detail;
if (!projectId) return; if (!projectId) return;
await this.getFeedSummaryMenuTree({ const params = {
projectId, projectId,
cbStage cbStage
}); };
await this.getFeedSummaryMenuTree(params);
await this.getFeedSummaryMonthList(params);
await this.initDefaultSetting();
} catch (error) {
console.log(error);
}
},
async initDefaultSetting() {
try {
const defaultCurrent = this.findMenuNode(this.menuTreeList, "结构劳务分包");
// 默认选中结构劳务分包
if (defaultCurrent) {
this.currentNodeName = defaultCurrent.name;
const params = this.createRequestConditions();
await this.getFeedSummaryList(params);
}
} catch (error) {
console.log(error);
}
},
createRequestConditions() {
const { projectId, cbStage } = this.comProjectDetailInfo;
const params = {
projectId,
cbStage
};
params["cbSubjectName"] = this.currentNodeName;
// 判断当月是否存在于server返回month集合中
const _now = dayjs(new Date().valueOf()).format("YYYYMM");
if (this.includeNowMonth(_now)) {
params["recordDate"] = _now;
}
return params;
},
// 返回当前月是否在server month集合中
includeNowMonth(time) {
return this.originMonthList.includes(time);
},
findMenuNode(tree, nodeName) {
for (const item of tree) {
if (item.name == nodeName) return item;
if (item.children instanceof Array) {
const result = this.findMenuNode(item.children, nodeName);
if (result) return result;
}
}
},
async getFeedSummaryList(params = {}) {
try {
const list = await getFeedSummaryListApi(params);
if (list.code == 200 && list.data instanceof Array) {
this.tableDataList = list.data;
this.total = list.data.length;
}
} catch (error) { } catch (error) {
} }
...@@ -120,7 +197,7 @@ export default { ...@@ -120,7 +197,7 @@ export default {
async getFeedSummaryMenuTree(params) { async getFeedSummaryMenuTree(params) {
try { try {
const result = await getFeedSummaryMenuTreeApi(params); const result = await getFeedSummaryMenuTreeApi(params);
if (result.code == 200) { if (result.code == 200 && result.data instanceof Array) {
const _tempArray = result.data; const _tempArray = result.data;
this.menuTreeList = _tempArray; this.menuTreeList = _tempArray;
} }
...@@ -128,19 +205,58 @@ export default { ...@@ -128,19 +205,58 @@ export default {
} }
}, },
async getFeedSummaryList(params = {}) { async getFeedSummaryMonthList(params) {
try { try {
const list = await getFeedSummaryListApi(params); const monthList = await getFeedSummaryMonthListApi(params);
if (list.code == 200 && list.data instanceof Array) { if (monthList.code == 200 && monthList.data instanceof Array) {
const data = monthList.data;
this.originMonthList = cloneDeep(data);
const _now = dayjs(new Date().valueOf()).format("YYYYMM");
this.recordDate = _now;
this.oldRecordDate = _now;
// 默认以当前月数据为准 若不包含当前月 需要手动push数据
if (!data.includes(_now)) {
data.push(_now);
data.push("202401");
data.push("202312");
}
this.monthList = data.map(item => {
return {
label: dayjs(item).format("YYYY年MM月"),
value: item
};
});
} }
} catch (error) { } catch (error) {
} }
}, },
monthChange(month) {
// 当前月
const _now = dayjs(new Date().valueOf()).format("YYYYMM");
// 请求列表参数
const params = this.createRequestConditions();
// 清空了年月默认选中当前月
if (!month) {
this.recordDate = _now;
// 如果命中的旧月份 等于当前月 说明清空的是当前月 不调用接口
if (this.oldRecordDate == _now) return;
} else {
// 正常选择
params["recordDate"] = month;
// 记录历史切换年月
this.oldRecordDate = month;
}
// 获取列表数据
this.getFeedSummaryList(params);
},
menuSelect(currentId, currentTemp) { menuSelect(currentId, currentTemp) {
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();
this.getFeedSummaryList(params);
}, },
getCurrentType(parent) { getCurrentType(parent) {
if (parent.level == 2) { if (parent.level == 2) {
...@@ -220,6 +336,29 @@ export default { ...@@ -220,6 +336,29 @@ export default {
display: none; display: none;
} }
} }
.project-month-select-options {
width: 140px;
.el-input__inner {
height: 32px;
line-height: 32px;
padding: 0px 12px;
border-radius: 2px;
border-color: #dcdfe6;
font-size: 14px;
color: #232323;
font-weight: 350;
}
.el-input__suffix {
right: 12px;
.el-input__icon {
line-height: 32px;
width: auto;
}
}
.el-input__prefix {
display: none;
}
}
} }
.project-table-list-haeder-right { .project-table-list-haeder-right {
...@@ -243,6 +382,11 @@ export default { ...@@ -243,6 +382,11 @@ export default {
} }
} }
} }
.project-feedsummary-list-container {
width: 100%;
height: calc(100% - 48px);
}
} }
} }
} }
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<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 ref="profitloss" :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive" @select="select"> <project-side-menu ref="profitloss" :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive"
@select="select">
<template slot="措施费-1"> <template slot="措施费-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_4.svg" alt=""> <img src="@/assets/images/projectCostLedger/icon_cost_detail_4.svg" alt="">
<div class="project-sub-menu-title-text">措施费</div> <div class="project-sub-menu-title-text">措施费</div>
...@@ -11,35 +12,17 @@ ...@@ -11,35 +12,17 @@
</div> </div>
<div class="profitloss"> <div class="profitloss">
<div class="search"> <div class="search">
<!--<el-date-picker size="small" style="width: 140px"--> <el-select v-model="expenseDate" @change="changetime" style="width: 140px;">
<!--v-model="expenseDate"--> <el-option v-for="item in dateoptions" :key="item.value" :label="item.label" :value="item.value">
<!--type="month"-->
<!--placeholder="选择月" @change="changetime"-->
<!--value-format="yyyy-MM"-->
<!--:picker-options="pickerOptions">-->
<!--</el-date-picker>-->
<el-select v-model="expenseDate">
<el-option
v-for="item in dateoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-button v-if="!isall" type="primary" size="small" @click="addcost">添加实际成本</el-button> <el-button v-if="!isall && !isinput" type="primary" size="small" @click="addcost">添加实际成本</el-button>
<el-button v-if="!isall && isinput" type="primary" size="small" @click="addinputs">保存</el-button>
</div> </div>
<!--汇总--> <!--汇总-->
<div class="table-item" v-if="isall"> <div class="table-item" v-if="isall">
<el-table <el-table element-loading-text="Loading" :data="tableData" row-key="id" v-horizontal-scroll="'hover'" default-expand-all
element-loading-text="Loading" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row :cell-class-name="tored" :header-cell-class-name="tored">
:data="tableData"
row-key="id"
v-horizontal-scroll="'hover'"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
border
highlight-current-row
>
<el-table-column label="序号" width="60" align="left" type="index"></el-table-column> <el-table-column label="序号" width="60" align="left" type="index"></el-table-column>
<el-table-column label="名称" width="220" prop="expenseName"> <el-table-column label="名称" width="220" prop="expenseName">
<template slot-scope="scope">{{scope.row.expenseName || '--'}}</template> <template slot-scope="scope">{{scope.row.expenseName || '--'}}</template>
...@@ -57,16 +40,8 @@ ...@@ -57,16 +40,8 @@
</div> </div>
<!--单条--> <!--单条-->
<div class="table-item" v-else> <div class="table-item" v-else>
<el-table <el-table element-loading-text="Loading" :data="tableData" row-key="id" v-horizontal-scroll="'hover'" default-expand-all
element-loading-text="Loading" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row :cell-class-name="tored1" :header-cell-class-name="tored1">
:data="tableData"
row-key="id"
v-horizontal-scroll="'hover'"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
border
highlight-current-row
>
<el-table-column label="序号" width="60" align="left" type="index" fixed="left"></el-table-column> <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"> <el-table-column label="清单内容" width="130" prop="itemContent" fixed="left">
<template slot-scope="scope">{{scope.row.itemContent || '--'}}</template> <template slot-scope="scope">{{scope.row.itemContent || '--'}}</template>
...@@ -114,15 +89,20 @@ ...@@ -114,15 +89,20 @@
<template slot-scope="scope">{{scope.row.taxType || '--'}}</template> <template slot-scope="scope">{{scope.row.taxType || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="本月发生成本比例" width="150" prop="monthCostRate"> <el-table-column label="本月发生成本比例" width="150" prop="monthCostRate">
<template slot-scope="scope">{{scope.row.monthCostRate || '--'}}</template> <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>
</el-table-column> </el-table-column>
<el-table-column label="成本合价" width="130" prop="costEffective"> <el-table-column label="成本合价" width="130" prop="costEffective">
<template slot-scope="scope">{{scope.row.costEffective || '--'}}</template> <template slot-scope="scope">{{scope.row.costEffective || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="本月工程量" width="130" prop="currentProjectVolume"> <el-table-column label="本月工程量" width="130" prop="currentProjectVolume">
<template slot-scope="scope">{{scope.row.currentProjectVolume || '--'}}</template> <template slot-scope="scope">
<template v-if="isinput"><el-input v-model="scope.row.currentProjectVolume "></el-input></template>
<template v-else>{{scope.row.currentProjectVolume || '--'}}</template>
</template>
</el-table-column> </el-table-column>
<el-table-column label="截止本月工程量" width="130" prop="currentProjectVolume"> <el-table-column label="截止本月工程量" width="130" prop="currentProjectVolume">
<template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template> <template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template>
...@@ -131,7 +111,6 @@ ...@@ -131,7 +111,6 @@
<template slot-scope="scope">{{scope.row.submitProjectVolume || '--'}}</template> <template slot-scope="scope">{{scope.row.submitProjectVolume || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="备注" width="130" prop="remarks"> <el-table-column label="备注" width="130" prop="remarks">
<template slot-scope="scope">{{scope.row.remarks || '--'}}</template> <template slot-scope="scope">{{scope.row.remarks || '--'}}</template>
</el-table-column> </el-table-column>
...@@ -148,10 +127,7 @@ ...@@ -148,10 +127,7 @@
</div> </div>
<!--推送工程量--> <!--推送工程量-->
<el-dialog <el-dialog class="pro-news" :visible.sync="dialogVisible" width="480px">
class="pro-news"
:visible.sync="dialogVisible"
width="480px">
<div class="poptitle"> <div class="poptitle">
<span>推送工程量</span> <span>推送工程量</span>
</div> </div>
...@@ -164,7 +140,9 @@ ...@@ -164,7 +140,9 @@
</el-form-item> </el-form-item>
<el-form-item label="需推送工程量" class="row"> <el-form-item label="需推送工程量" class="row">
<el-input type="text" placeholder="请输入需推送工程量" v-model="queryParam.submitProjectVolume"></el-input> <el-input type="text" placeholder="请输入需推送工程量" v-model="queryParam.submitProjectVolume"></el-input>
<span class="msgs" v-if="queryParam.submitProjectVolume>queryParam.currentProjectVolume"><font color="#FF3C3C">注:推送工程量不得大于实际产生的总工程量</font></span> <span class="msgs" v-if="queryParam.submitProjectVolume>queryParam.currentProjectVolume">
<font color="#FF3C3C">注:推送工程量不得大于实际产生的总工程量</font>
</span>
</el-form-item> </el-form-item>
<el-form-item label="IPM项目编码" class="row"> <el-form-item label="IPM项目编码" class="row">
<el-input type="text" placeholder="请输入IPM项目编码" v-model="queryParam.ipmProjectCode"></el-input> <el-input type="text" placeholder="请输入IPM项目编码" v-model="queryParam.ipmProjectCode"></el-input>
...@@ -175,27 +153,50 @@ ...@@ -175,27 +153,50 @@
<el-form-item label="IPM作业编码" class="row"> <el-form-item label="IPM作业编码" class="row">
<el-input type="text" placeholder="请输入IPM作业编码" v-model="queryParam.ipmBizCode"></el-input> <el-input type="text" placeholder="请输入IPM作业编码" v-model="queryParam.ipmBizCode"></el-input>
</el-form-item> </el-form-item>
</el-form > </el-form>
<div class="popbot"> <div class="popbot">
<div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div> <div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div>
<div class="btn btn_primary h32" @click="savepro">确定推送</div> <div class="btn btn_primary h32" @click="savepro">确定推送</div>
</div> </div>
</el-dialog> </el-dialog>
<!--添加实际成本-->
<el-dialog class="pro-news" :visible.sync="cbVisible" width="480px">
<div class="poptitle">
<span>填写实际成本</span>
</div>
<el-form class="popform" label-width="72px" style="height: 100px">
<el-form-item label="成本年份" class="row">
<el-date-picker size="small" style="width: 368px"
v-model="chooseDate"
type="month"
placeholder="选择月" @change="changeDate"
value-format="yyyy-MM"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-form>
<div class="popbot">
<div class="btn btn_cancel h32" @click="cbVisible = false">取消</div>
<div class="btn btn_primary h32" @click="inputnum">确定</div>
</div>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import ProjectSideMenu from '@/views/projectCostLedger/detail/components/ProjectSideMenu' import ProjectSideMenu from '@/views/projectCostLedger/detail/components/ProjectSideMenu';
import { import {
getCostMeasureslist, getCostMeasureslist,
getMeasureslist, getMeasureslist,
getSummarydata, getSummarydata,
projectVolume, projectVolume,
pushProjectvolume,actualMonths pushProjectvolume,
} from '@/api/projectCostLedger' getActualMonthsApi,saveBatch
} from '@/api/projectCostLedger';
import { cloneDeep } from "lodash-es";
export default { export default {
name: "MeasureItems", name: "MeasureItems",
props: { props: {
// 项目ID // 项目ID
...@@ -213,17 +214,15 @@ ...@@ -213,17 +214,15 @@
watch: { watch: {
projectDetailInfo: { projectDetailInfo: {
handler(newValue) { handler(newValue) {
this.comProjectDetailInfo = newValue ? newValue : {}; this.comProjectDetailInfo = newValue ? cloneDeep(newValue) : {};
this.init(this.projectId); this.init(newValue.projectId);
}, },
deep: true, deep: true
immediate: true
}, },
projectId: { projectId: {
handler(newValue) { handler(newValue) {
this.comProjectId = newValue; this.comProjectId = newValue;
}, }
immediate: true
} }
}, },
components: { components: {
...@@ -233,90 +232,122 @@ ...@@ -233,90 +232,122 @@
return { return {
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
let istrue = true let istrue = true;
let month = new Date().getMonth()+1 let month = new Date().getMonth() + 1;
let year = new Date().getFullYear() let year = new Date().getFullYear();
let times = (year+5)+'-'+ month + '-01 ' + '00:00:00' let times = (year + 5) + '-' + month + '-01 ' + '00:00:00';
istrue = new Date().getTime() < time.getTime() && time.getTime() < new Date(times).getTime() istrue = new Date().getTime() < time.getTime() && time.getTime() < new Date(times).getTime();
return !istrue return !istrue;
}, },
}, },
menuOptions: { menuOptions: {
nodeName: "itemContent", nodeName: "itemContent",
nodeValue: "id", nodeValue: "id",
}, },
comProjectDetailInfo: {}, comProjectDetailInfo: this.projectDetailInfo ? cloneDeep(this.projectDetailInfo) : {},
comProjectId: "", comProjectId: this.projectId,
defaultActive: "", defaultActive: "",
menuTreeList: [ menuTreeList: [
], ],
id: 0, id: 0,
expenseDate:'', expenseDate: '',
tableData:[], tableData: [],
isall:true,//是否汇总 isall: true,//是否汇总
dialogVisible:false, dialogVisible: false,
queryParam:{},//推送工程量数据 queryParam: {},//推送工程量数据
dateoptions:[], dateoptions: [],
cbVisible:false,
chooseDate:"",
isinput:false,//是否填写
}; };
}, },
//可访问data属性 //可访问data属性
created() { created() {
// let month = new Date().getMonth() +1 this.init(this.comProjectId);
// let year = new Date().getFullYear()
// this.expenseDate = year + (month>= 9? month:'0'+ month)
this.getactualMonths()
}, },
//计算集 //计算集
computed: { computed: {
}, },
//方法集 //方法集
methods: { methods: {
getactualMonths(){ tored({column}){
const formDatas = new FormData(); if(column.property=='quantity'){
formDatas.append("projectId", this.projectId); return 'tored'
formDatas.append("id", this.id); }
console.log(formDatas.get('projectId')) },
console.log(formDatas.get('id')) tored1({column}){
actualMonths(formDatas).then(res=>{ let arr = ['submitProjectVolume','suncurrentProjectVolume','currentProjectVolume','costEffective','monthCostRate']
if(arr.includes(column.property)&&this.isinput){
return 'tored'
}
},
async getactualMonths() {
try {
const params = {
projectId: this.comProjectId,
id: this.id
};
let res = await getActualMonthsApi(params);
let data = res.data let data = res.data
data.forEach(item=>{ let arr = []
item.value = item
item.label = item.substring(1,4)+'-'+item.substring(5,6) let month = new Date().getMonth() +1
}) let year = new Date().getFullYear()
if(data&&data.length>0) let thismonth = year + (month>= 9? month:'0'+ month)
this.expenseDate = data[0].value let hasmonth = false
}) data.forEach(item => {
if(item == thismonth){
hasmonth = true
}
let li = {value:item,label:item.substring(0, 4) + '-' + item.substring(4, 6)}
arr.push(li)
});
if(!hasmonth){
let li = {value:thismonth,label:thismonth.substring(0, 4) + '-' + thismonth.substring(4, 6)}
arr.unshift(li)
}
if (arr && arr.length > 0) {
this.expenseDate = arr[0].value;
}
this.dateoptions = arr
} catch (error) {
}
}, },
select(menuPath){ async select(menuPath) {
this.id = menuPath this.id = menuPath;
this.getactualMonths();
// let month = this.expenseDate.replace('-', ""); // let month = this.expenseDate.replace('-', "");
this.getDatas(menuPath)
},
async getDatas(menuPath){
let param = { let param = {
projectId:this.projectId, projectId: this.projectId,
id:this.id, id: this.id,
month:this.expenseDate month: this.expenseDate
} };
if(menuPath == 0){//费用汇总 if (menuPath == 0) {//费用汇总
this.isall = true this.isall = true;
const formData = new FormData(); // const formData = new FormData();
formData.append("projectId", this.projectId); // formData.append("projectId", this.projectId);
getSummarydata(formData).then(res=>{ // formData.append("month", this.expenseDate);
this.tableData = res.data // const res = await getSummarydata(formData);
}) // this.tableData = res.data;
} else {//各个子项 } else {//各个子项
this.isall = false this.isall = false;
getCostMeasureslist(param).then(res => { // const res = await getCostMeasureslist(param);
this.tableData = res.data // this.tableData = res.data;
})
} }
this.getactualMonths() const res = await getCostMeasureslist(param);
this.tableData = res.data;
this.isinput = false
}, },
async init(detail = '') { async init(detail = '') {
try { try {
const projectId = detail; const projectId = detail;
if (!projectId) return; if (!projectId) return;
await this.getFeedSummaryMenuTree(projectId); await this.getFeedSummaryMenuTree(projectId);
this.getactualMonths();
} catch (error) { } catch (error) {
} }
...@@ -325,74 +356,110 @@ ...@@ -325,74 +356,110 @@
try { try {
const result = await getMeasureslist(params); const result = await getMeasureslist(params);
if (result.code == 200) { if (result.code == 200) {
let arr = {} let arr = {};
arr.itemContent = '措施费' arr.itemContent = '措施费';
arr.id = 0 arr.id = 0;
let child = result.data let child = result.data;
let li = {} let li = {};
li.itemContent = '费用汇总' li.itemContent = '费用汇总';
li.id = 0 li.id = 0;
child.unshift(li) child.unshift(li);
arr.children = child arr.children = child;
const _tempArray = [arr]; const _tempArray = [arr];
this.menuTreeList = _tempArray; this.menuTreeList = _tempArray;
await this.$nextTick() await this.$nextTick();
this.$refs['profitloss'].$refs['customElMenu'].open(_tempArray[0].id) this.$refs['profitloss'].$refs['customElMenu'].open(_tempArray[0].id);
this.defaultActive = child[0].id this.defaultActive = child[0].id;
this.select(child[0].id) this.select(child[0].id);
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error);
} }
}, },
changetime(val){ changetime(val) {
this.select(this.id) this.getDatas(this.id)
}, },
//推送工作量 //推送工作量
pushwork(row){ pushwork(row) {
this.queryParam = { this.queryParam = {
id:row.id, id: row.id,
projectName:'', projectName: '',
submitProjectVolume:'', submitProjectVolume: '',
ipmProjectCode:'', ipmProjectCode: '',
ipmContractCode:'', ipmContractCode: '',
ipmBizCode:'', ipmBizCode: '',
} };
projectVolume(row.id).then(res=>{ projectVolume(row.id).then(res => {
if(res.data){ if (res.data) {
let datas = res.data let datas = res.data;
this.queryParam.currentProjectVolume = datas.currentProjectVolume this.queryParam.currentProjectVolume = datas.currentProjectVolume;
this.queryParam.ipmProjectCode = datas.ipmProjectCode this.queryParam.ipmProjectCode = datas.ipmProjectCode;
this.queryParam.ipmContractCode = datas.ipmContractCode this.queryParam.ipmContractCode = datas.ipmContractCode;
this.queryParam.ipmBizCode = datas.ipmBizCode this.queryParam.ipmBizCode = datas.ipmBizCode;
} }
}) });
this.dialogVisible = true this.dialogVisible = true;
}, },
//确认推送 //确认推送
savepro(){ savepro() {
pushProjectvolume(this.queryParam).then(res=>{ pushProjectvolume(this.queryParam).then(res => {
if (res.code == 200) {
this.$message.success(res.msg);
this.dialogVisible = false;
this.select(this.id);
} else {
this.$message.error(res.msg);
}
});
},
addcost() {
this.cbVisible = true
},
addinputs(){
this.tableData.forEach(item=>{
item.month = this.expenseDate
})
saveBatch(JSON.stringify(this.tableData)).then(res=>{
if(res.code == 200){ if(res.code == 200){
this.$message.success(res.msg) this.$message.success(res.msg)
this.dialogVisible = false this.isinput = false
this.select(this.id) this.getDatas(this.id)
}else{ }else{
this.$message.error(res.msg) this.$message.error(res.msg)
} }
}) })
},
addcost(){
}, },
changeDate(){
let choseDate = this.chooseDate.replace('-','')
let hasdate = false
this.dateoptions.forEach(item=>{
if(item.value == choseDate){
hasdate = true
}
})
if(!hasdate){
let li = {value:choseDate,label:this.chooseDate}
this.dateoptions.push(li)
this.expenseDate = choseDate
// arr.unshift(li)
}
}, },
inputnum(){
this.cbVisible = false
this.isinput = true
} }
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.feed-summary-container { .feed-summary-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
::v-deep .tored{
/*background: rgb(255,236,236) !important;*/
}
.feed-summary-inner { .feed-summary-inner {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -404,20 +471,20 @@ ...@@ -404,20 +471,20 @@
min-width: 220px; min-width: 220px;
height: 100%; height: 100%;
} }
.profitloss{ .profitloss {
width: calc(100% - 220px); width: calc(100% - 220px);
height: 100%; height: 100%;
background: #fff; background: #fff;
padding: 16px; padding: 16px;
.table-item{ .table-item {
margin-top: 16px; margin-top: 16px;
} }
} }
} }
.search{ .search {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
::v-deep .pro-news { ::v-deep .pro-news {
.el-dialog__body { .el-dialog__body {
padding: 24px 0 0; padding: 24px 0 0;
...@@ -458,7 +525,7 @@ ...@@ -458,7 +525,7 @@
.row { .row {
margin-bottom: 16px; margin-bottom: 16px;
position: relative; position: relative;
.checkcb{ .checkcb {
position: absolute; position: absolute;
left: -100px; left: -100px;
} }
...@@ -507,22 +574,22 @@ ...@@ -507,22 +574,22 @@
padding-top: 2px; padding-top: 2px;
} }
} }
.el-input-group--append{ .el-input-group--append {
position: relative; position: relative;
.el-input-group__append{ .el-input-group__append {
position: absolute; position: absolute;
right: 0; right: 0;
width: 76px; width: 76px;
top: 0; top: 0;
border: 0; border: 0;
background: none; background: none;
&:hover{ &:hover {
background: none !important; background: none !important;
} }
.pro-getbtn{ .pro-getbtn {
border-left: 1px solid #DCDFE6; border-left: 1px solid #dcdfe6;
height: 32px; height: 32px;
color: #0081FF; color: #0081ff;
line-height: 32px; line-height: 32px;
text-align: center; text-align: center;
} }
...@@ -531,7 +598,7 @@ ...@@ -531,7 +598,7 @@
} }
.popbot { .popbot {
border-top: 1px solid #EEEEEE; border-top: 1px solid #eeeeee;
text-align: right; text-align: right;
margin-top: 24px; margin-top: 24px;
padding: 16px 20px; padding: 16px 20px;
...@@ -540,12 +607,12 @@ ...@@ -540,12 +607,12 @@
border-radius: 2px; border-radius: 2px;
margin-left: 12px; margin-left: 12px;
padding: 0 24px; padding: 0 24px;
&.btn_disabled{ &.btn_disabled {
background: #8BD1FF; background: #8bd1ff;
} }
} }
} }
.msgs{ .msgs {
font-size: 12px; font-size: 12px;
line-height: 17px; line-height: 17px;
height: 17px; height: 17px;
...@@ -553,5 +620,5 @@ ...@@ -553,5 +620,5 @@
margin: 0 0 -4px; margin: 0 0 -4px;
} }
} }
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="project-cost-ledger-detail-inner"> <div class="project-cost-ledger-detail-inner">
<project-detail-header :current="current" :breadCrumbTree="createProjectBreadCrumbTree"></project-detail-header> <project-detail-header :current="current" :breadCrumbTree="createProjectBreadCrumbTree"></project-detail-header>
<!-- tab切换栏 --> <!-- tab切换栏 -->
<dsk-tab-toggle v-model="current" :tabs="toggleTabs" @tabToggle="tabToggle"></dsk-tab-toggle> <dsk-tab-toggle v-model="current" :tabs="toggleTabs" @tabToggle="tabToggle" :disabled="tabsDisabled"></dsk-tab-toggle>
<!-- tab切换组件容器 --> <!-- tab切换组件容器 -->
<div class="project-cost-ledger-detail-module"> <div class="project-cost-ledger-detail-module">
<!-- 放入组件 v-if current == ‘xxxx’ 详情变量 this.detailInfo 需要深度监听--> <!-- 放入组件 v-if current == ‘xxxx’ 详情变量 this.detailInfo 需要深度监听-->
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<direct-cost v-if="current == 'directCost'"></direct-cost> <direct-cost v-if="current == 'directCost'"></direct-cost>
<!-- 工料汇总 --> <!-- 工料汇总 -->
<feed-summary v-if="current == 'feedSummary'" :project-id="projectID" :project-detail-info="detailInfo"></feed-summary> <feed-summary v-if="current == 'feedSummary'" :project-id="projectId" :project-detail-info="detailInfo"></feed-summary>
<!--措施项目--> <!--措施项目-->
<measure-items v-if="current == 'measureItem'" :project-id="projectID" :project-detail-info="detailInfo"></measure-items> <measure-items v-if="current == 'measureItem'" :project-id="projectId" :project-detail-info="detailInfo"></measure-items>
<!-- 其他项目 --> <!-- 其他项目 -->
<other-projects v-if="current == 'otherItems'"></other-projects> <other-projects v-if="current == 'otherItems'"></other-projects>
<!-- 盈亏分析对比 --> <!-- 盈亏分析对比 -->
<profit-Loss v-if="current == 'profitAndLoss'" :project-id="projectID" :project-detail-info="detailInfo"></profit-Loss> <profit-Loss v-if="current == 'profitAndLoss'" :project-id="projectId" :project-detail-info="detailInfo"></profit-Loss>
</div> </div>
</div> </div>
...@@ -62,14 +62,15 @@ export default { ...@@ -62,14 +62,15 @@ export default {
}, },
data() { data() {
return { return {
projectID: "", projectId: "",
current: "", current: "",
// 详情信息变量 // 详情信息变量
detailInfo: { detailInfo: {
projectId: "1754425038355890177", projectId: "1754425038355890177",
cbStage: 0, cbStage: 0,
cbType:1 cbType: 1
}, },
tabsDisabled: false,
toggleTabs: [ toggleTabs: [
{ {
value: "basicEngineeringInformation", value: "basicEngineeringInformation",
...@@ -161,21 +162,24 @@ export default { ...@@ -161,21 +162,24 @@ export default {
}, },
async getProjectQuery() { async getProjectQuery() {
try { try {
this.tabsDisabled = true;
const { query } = this.$route; const { query } = this.$route;
// if (!query.projectID) return this.$message.error("缺少项目id"); // if (!query.projectId) return this.$message.error("缺少项目id");
this.projectID = query.projectID; this.projectId = query.projectId;
// 获取详情 保证详情获取完毕 再执行tab命中 进行生命周期
await this.getProjectDetail(query.projectId);
if (query.current) { if (query.current) {
this.current = query.current; this.current = query.current;
} else { } else {
// 默认命中工程项目信息 // 默认命中工程项目信息
this.current = "basicEngineeringInformation"; this.current = "basicEngineeringInformation";
}; };
await this.getProjectDetail(query.projectID); this.tabsDisabled = false;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
}, },
async getProjectDetail(projectID) { async getProjectDetail(projectId) {
try { try {
} catch (error) { } catch (error) {
......
...@@ -70,13 +70,13 @@ ...@@ -70,13 +70,13 @@
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<el-tooltip placement="top" v-if="scope.row.projectText.length>20"> <el-tooltip placement="top" v-if="scope.row.projectText.length>20">
<div class="renling"> <div class="renling">
<router-link v-if="scope.row.isGetProjectDetail" :to="`/projectCostLedger/detail?projectID=${scope.row.id}`" tag="a" <router-link v-if="scope.row.isGetProjectDetail" :to="`/projectCostLedger/detail?projectId=${scope.row.id}`" tag="a"
class="wordprimary" v-html="scope.row.projectName"></router-link> class="wordprimary" v-html="scope.row.projectName"></router-link>
<span v-else v-html="scope.row.projectName"></span> <span v-else v-html="scope.row.projectName"></span>
</div> </div>
</el-tooltip> </el-tooltip>
<div class="renling" v-else> <div class="renling" v-else>
<router-link v-if="scope.row.isGetProjectDetail" :to="`/projectCostLedger/detail?projectID=${scope.row.id}`" tag="a" <router-link v-if="scope.row.isGetProjectDetail" :to="`/projectCostLedger/detail?projectId=${scope.row.id}`" tag="a"
class="wordprimary" v-html="scope.row.projectName"></router-link> class="wordprimary" v-html="scope.row.projectName"></router-link>
<span v-else v-html="scope.row.projectName"></span> <span v-else v-html="scope.row.projectName"></span>
</div> </div>
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
<script> <script>
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
// import { getDicts } from '@/api/system/dict/data' // import { getDicts } from '@/api/system/dict/data'
import { deleteCbProjectFile, getProjectFileUploadDetail, uploadCbProjectFile } from '@/api/projectCostLedger/index' import { deleteCbProjectFile, getProjectFileUploadDetail, uploadCbProjectFile,importData } from '@/api/projectCostLedger/index'
export default { export default {
name: 'upload', name: 'upload',
...@@ -297,7 +297,28 @@ ...@@ -297,7 +297,28 @@
this.visible = true this.visible = true
this.$refs['ruleForm'].validate((valid) => { this.$refs['ruleForm'].validate((valid) => {
if (valid) { if (valid) {
importData(this.formdata.id).then(res=>{
})
this.issub = true this.issub = true
this.directExpense.forEach(item=>{
item.fileParseStatus = 1
})
this.quantitySummary.forEach(item=>{
item.fileParseStatus = 1
})
this.measureProject.forEach(item=>{
item.fileParseStatus = 1
})
this.otherProject.forEach(item=>{
item.fileParseStatus = 1
})
this.sceneExpense.forEach(item=>{
item.fileParseStatus = 1
})
this.cbSummary.forEach(item=>{
item.fileParseStatus = 1
})
} else { } else {
this.issub = false this.issub = false
} }
......
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