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:
spring:
application:
name: ${ruoyi.name}
jpa:
open-in-view: false
# 资源信息
messages:
# 国际化资源文件路径
......@@ -324,14 +327,16 @@ lock4j:
management:
endpoints:
enabled-by-default: false
web:
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
logfile:
external-file: ./logs/sys-console.log
# endpoints:
# web:
# exposure:
# include: '*'
# endpoint:
# health:
# show-details: ALWAYS
# logfile:
# external-file: ./logs/sys-console.log
gv:
img-path: D:\dsk\dsk-operate-sys\
......
......@@ -3,6 +3,7 @@ package com.dsk.cscec.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.dsk.common.annotation.Log;
......@@ -24,11 +25,13 @@ import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresImportVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresItemVo;
import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryVo;
import com.dsk.cscec.listener.ProjectCostMeasureImportListener;
import com.dsk.cscec.service.CbProjectExpenseSummaryService;
import com.dsk.cscec.service.ICbCostMeasureService;
import com.dsk.system.domain.vo.SysUserImportVo;
import com.dsk.system.listener.SysUserImportListener;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
......@@ -63,6 +66,22 @@ public class CbCostMeasureController {
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 {
// @SaCheckPermission("cb:costmeasures:list")
@SaIgnore
@GetMapping("/list")
public R<List<CbCostMeasureActualVo>> list(CbCostMeasureActualBo cbCostMeasure) {
List<CbCostMeasureActualVo> data= cbCostMeasureService.selectDataList(cbCostMeasure);
public R<List> list(CbCostMeasureActualBo 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)) {
data = new ArrayList<>();
}
......@@ -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 {
@Log(title = "措施费汇总获取")
// @SaCheckPermission("system:user:import")
@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;
List<CbProjectExpenseSummary> cbProjectExpenseSummaries = cbProjectExpenseSummaryService.queryCbSceneExpenseSummaryDataByType(projectId, dataType);
return R.ok(cbProjectExpenseSummaries);
List<CbProjectExpenseSummaryVo> dataList = cbCostMeasureService.getSummaryData(projectId,dataType,month);
return R.ok(dataList);
}
......
......@@ -16,33 +16,33 @@ public class CbCostMeasureActualPushBo {
/**
* 截止本月工程量
* 本月实际工程量
*/
private BigDecimal costEffective;
/**
* 本月实际工程量
*/
@TableField(value = "current_project_volume")
private BigDecimal currentProjectVolume;
/**
* 推送工程量
*/
@TableField(value = "submit_project_volume")
private BigDecimal submitProjectVolume;
/**
* 年月
*/
@TableField(value = "`month`")
private String month;
/**
* 推送时间
*/
@TableField(value = "push_time")
private Date pushTime;
/**
* 推送数据json
*/
@TableField(value = "push_data_json")
private String pushDataJson;
/**
......
......@@ -9,6 +9,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class CbCostMeasureActualVo {
......@@ -17,6 +18,10 @@ public class CbCostMeasureActualVo {
*/
private Long id;
private Long parentId;
/**
* 序号
*/
......@@ -138,6 +143,9 @@ public class CbCostMeasureActualVo {
private Date pushTime;
private String pushDataJson;
/**
* 修改人
*/
......@@ -162,6 +170,10 @@ public class CbCostMeasureActualVo {
@TableField(value = "update_time")
private Date updateTime;
private List<CbCostMeasureActualVo> childrens;
public static final String COL_ID = "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
int updateByPrimaryKeySelective(CbCostMeasureActual record);
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;
import com.dsk.cscec.domain.CbQuantitySummary;
import com.dsk.cscec.domain.bo.CbCostMeasureActualBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CbCostMeasureMapper extends BaseMapper<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;
*/
public interface ICbCostMeasureActualService extends IService<CbCostMeasureActual> {
List<CbCostMeasureActualVo> getMonthActualCostList(Long projectId, String month);
}
package com.dsk.cscec.service;
import cn.hutool.core.lang.tree.Tree;
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.CbProjectExpenseSummary;
import com.dsk.cscec.domain.bo.CbCostMeasureActualBo;
import com.dsk.cscec.domain.bo.CbCostMeasureActualPushBo;
import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresItemVo;
import org.springframework.web.multipart.MultipartFile;
import com.dsk.cscec.domain.vo.CbProjectExpenseSummaryVo;
import java.io.InputStream;
import java.util.List;
......@@ -29,7 +25,7 @@ public interface ICbCostMeasureService extends IService<CbCostMeasure> {
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);
......@@ -40,5 +36,11 @@ public interface ICbCostMeasureService extends IService<CbCostMeasure> {
void parseCbCostMeasureFile(Long projectId);
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;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.file.FileNameUtil;
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.ReUtil;
import cn.hutool.http.HttpUtil;
......@@ -16,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.excel.ExcelResult;
import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.JsonUtils;
import com.dsk.common.utils.TreeBuildUtils;
import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.cscec.constant.CbProjectConstants;
import com.dsk.cscec.domain.*;
......@@ -25,6 +31,7 @@ import com.dsk.cscec.domain.bo.CbCostMeasureActualSaveBo;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.domain.vo.CbCostMeasuresImportVo;
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.ProjectCostMeasureSummaryImportListener;
import com.dsk.cscec.service.*;
......@@ -37,11 +44,10 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Slf4j
@Service
......@@ -161,27 +167,53 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
}
@Override
public List<CbCostMeasureActualVo> selectDataList(CbCostMeasureActualBo costMeasureActualBo) {
public List<Tree<Long>> selectDataList(CbCostMeasureActualBo costMeasureActualBo) {
List<CbCostMeasureActualVo> dataList = new ArrayList<>();
Assert.notNull(costMeasureActualBo.getProjectId(), "项目ID不能为空");
CbProjectRecord byId = cbProjectRecordService.getById(costMeasureActualBo.getProjectId());
Assert.notNull(byId, "项目信息不能为空");
checkProjectExist(costMeasureActualBo.getProjectId());
//查询项目某项措施费所有计划成本
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
......@@ -212,7 +244,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
@SneakyThrows
@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);
Assert.notNull(byId, "项目信息不能为空");
......@@ -256,7 +288,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
if ("措施费".equals(prefix)) {
byte[] bytes = HttpUtil.downloadBytes(cbProjectFile.getFileOssUrl());
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)) {
cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
} else {
......@@ -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);
Assert.notNull(byId, "项目信息不能为空");
}
......@@ -296,7 +329,7 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
if ("措施费".equals(prefix)) {
byte[] bytes = HttpUtil.downloadBytes(cbProjectFile.getFileOssUrl());
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)) {
cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
} else {
......@@ -319,6 +352,55 @@ public class CbCostMeasureServiceImpl extends ServiceImpl<CbCostMeasureMapper, C
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、成本阶段查询父级信息
......
......@@ -3,11 +3,14 @@ package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.cscec.domain.CbCostMeasure;
import com.dsk.cscec.domain.CbCostMeasureActual;
import com.dsk.cscec.domain.vo.CbCostMeasureActualVo;
import com.dsk.cscec.mapper.CbCostMeasureActualMapper;
import com.dsk.cscec.mapper.CbCostMeasureMapper;
import com.dsk.cscec.service.ICbCostMeasureActualService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author tanyang
* @create 2024-02-07 9:38
......@@ -15,4 +18,8 @@ import org.springframework.stereotype.Service;
@Service
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 @@
AND t.cb_stage=#{cbStage}
AND t1.`month`=#{month}
</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>
\ No newline at end of file
......@@ -36,7 +36,7 @@
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,
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>
......@@ -54,4 +54,15 @@
AND t.`no` like concat(#{id},'.%')
ORDER BY id ASC
</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>
\ No newline at end of file
......@@ -57,6 +57,14 @@ export function getProjectFileUploadDetail(projectId) {
});
}
//根据项目文件导入数据
export function importData(projectId) {
return request({
url: '/cbProjectRecord/importData/'+projectId,
method: 'get',
});
}
//获取草稿箱列表
export function getDraftDialogList(projectId) {
return request({
......@@ -78,7 +86,7 @@ export function deleteCbProjectFile(data) {
return request({
url: '/cbProjectFile/deleteCbProjectFile',
method: 'Delete',
data:data
data: data
});
}
......@@ -160,28 +168,37 @@ export function pushProjectvolume(data) {
return request({
url: '/cb/cost/measures/push/project/volume',
method: 'post',
data:data
data: data
});
}
//措措施费-获取上一次推送工程量
export function projectVolume(data) {
return request({
url: '/cb/cost/measures/last/project/volume/'+data,
url: '/cb/cost/measures/last/project/volume/' + data,
method: 'GET',
});
}
//措施费-获取实际成本月份列表
export function actualMonths(params) {
export const getActualMonthsApi = (params = {}) => request({
url: '/cb/cost/measures/actual/months',
method: 'get',
params
});
//批量保存或修改每月措施费
export function saveBatch(data) {
return request({
url: '/cb/cost/measures/actual/months',
method: 'GET',
params
url: '/cb/cost/measures/saveBatch',
method: 'post',
data:data,
});
}
// 工料汇总
/**
......@@ -195,6 +212,17 @@ export const getFeedSummaryMenuTreeApi = (params = {}) => request({
params
});
/**
* 获取已记录月份集合
* @param {*} params
* @returns
*/
export const getFeedSummaryMonthListApi = (params = {}) => request({
url: "/cb/quantity/summary/monthList",
method: "get",
params
});
/**
* 获取科目月份列表
* @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 @@
<!-- tab列表 -->
<div class="dsk-tab-items-container">
<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-name" @click="tabChoose(item)">{{item.name}}</div>
<div class="dsk-tab-item" v-for="item of tabs" :key="item.id"
: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 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>
......@@ -25,6 +27,10 @@ export default {
required: true,
type: Array,
default: () => []
},
disabled: {
type: Boolean,
default: false
}
},
watch: {
......@@ -32,6 +38,12 @@ export default {
handler(newValue) {
this.initSlidingBar();
}
},
// 全部禁用不显示滚动条
disabled: {
handler(newValue) {
this.comDisabled = newValue ? true : false;
}
}
},
model: {
......@@ -41,7 +53,8 @@ export default {
data() {
return {
silidingBarLeft: 0,
silidingBarWidth: 0
silidingBarWidth: 0,
comDisabled: this.disabled ? true : false
};
},
//可访问data属性
......@@ -50,7 +63,13 @@ export default {
},
//计算集
computed: {
showTabsSlidingbar() {
const current = this.tabs.find(item => item.value == this.currentValue);
if (current) {
return current.disabled ? false : true;
}
return false;
}
},
//方法集
methods: {
......@@ -124,6 +143,13 @@ export default {
font-weight: bold;
}
}
&.tab-is-disabled {
.dsk-tab-item-name {
color: #eee;
cursor: not-allowed;
}
}
}
.dsk-tab-sliding-bar {
......
......@@ -2,7 +2,7 @@
<div class="feed-summary-container">
<div class="feed-summary-inner">
<div class="left-side-menu">
<project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive"
<project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="currentNodeName"
@select="menuSelect">
<template slot="房建类成本科目-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_2.svg" alt="">
......@@ -17,8 +17,12 @@
<div class="right-table-list-container">
<div class="project-table-list-header">
<div class="project-table-list-haeder-left">
<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>
<!-- <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> -->
<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 class="project-table-list-haeder-right">
<!-- 实体工程材料单位换算 -->
......@@ -29,16 +33,24 @@
<dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting>
</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>
</template>
<script>
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 DskSkeleton from "@/components/DskSkeleton";
import TableListCom from "@/components/TableListCom";
import { v4 } from 'uuid';
import dayjs from "dayjs";
import { cloneDeep } from "lodash-es";
export default {
name: "feedSummary",
props: {
......@@ -57,23 +69,22 @@ export default {
watch: {
projectDetailInfo: {
handler(newValue) {
this.comProjectDetailInfo = newValue ? newValue : {};
this.comProjectDetailInfo = newValue ? cloneDeep(newValue) : {};
this.init(this.comProjectDetailInfo);
},
deep: true,
immediate: true
},
projectId: {
handler(newValue) {
this.comProjectId = newValue;
},
immediate: true
}
}
},
components: {
ProjectSideMenu,
DskTableHeaderSetting,
TableListCom
TableListCom,
DskSkeleton
},
data() {
return {
......@@ -81,23 +92,35 @@ export default {
nodeName: "name",
nodeValue: "name",
},
comProjectDetailInfo: {},
comProjectId: "",
defaultActive: "",
comProjectDetailInfo: this.projectDetailInfo ? cloneDeep(this.projectDetailInfo) : {},
comProjectId: this.projectId,
menuTreeList: [],
// 加载数据列表
tableLoading: false,
total: 0,
// 列表表头
formColum: [
{ label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() },
],
// 已记录月份集合
monthList: [],
// 源数据月份
originMonthList: [],
// 当前查询的数据月份
recordDate: "",
// 历史查询月份
oldRecordDate: "",
// 当前选中子菜单的父类名称
currentParentName: ""
currentParentName: "",
// 当前选中的成本科目
currentNodeName: "",
// 数据列表
tableDataList: []
};
},
//可访问data属性
created() {
this.init(this.comProjectDetailInfo);
},
//计算集
computed: {
......@@ -109,10 +132,64 @@ export default {
try {
const { projectId, cbStage } = detail;
if (!projectId) return;
await this.getFeedSummaryMenuTree({
const params = {
projectId,
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) {
}
......@@ -120,7 +197,7 @@ export default {
async getFeedSummaryMenuTree(params) {
try {
const result = await getFeedSummaryMenuTreeApi(params);
if (result.code == 200) {
if (result.code == 200 && result.data instanceof Array) {
const _tempArray = result.data;
this.menuTreeList = _tempArray;
}
......@@ -128,19 +205,58 @@ export default {
}
},
async getFeedSummaryList(params = {}) {
async getFeedSummaryMonthList(params) {
try {
const list = await getFeedSummaryListApi(params);
if (list.code == 200 && list.data instanceof Array) {
const monthList = await getFeedSummaryMonthListApi(params);
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) {
}
},
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) {
this.currentNodeName = currentId;
const parentName = currentTemp.parent ? this.getCurrentType(currentTemp.parent) : currentId;
if (parentName) this.currentParentName = parentName;
// 请求数据列表
const params = this.createRequestConditions();
this.getFeedSummaryList(params);
},
getCurrentType(parent) {
if (parent.level == 2) {
......@@ -220,6 +336,29 @@ export default {
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 {
......@@ -243,6 +382,11 @@ export default {
}
}
}
.project-feedsummary-list-container {
width: 100%;
height: calc(100% - 48px);
}
}
}
}
......
......@@ -2,7 +2,8 @@
<div class="feed-summary-container">
<div class="feed-summary-inner">
<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">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_4.svg" alt="">
<div class="project-sub-menu-title-text">措施费</div>
......@@ -11,35 +12,17 @@
</div>
<div class="profitloss">
<div class="search">
<!--<el-date-picker size="small" style="width: 140px"-->
<!--v-model="expenseDate"-->
<!--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-select v-model="expenseDate" @change="changetime" style="width: 140px;">
<el-option v-for="item in dateoptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</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 class="table-item" v-if="isall">
<el-table
element-loading-text="Loading"
:data="tableData"
row-key="id"
v-horizontal-scroll="'hover'"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
border
highlight-current-row
>
<el-table element-loading-text="Loading" :data="tableData" row-key="id" v-horizontal-scroll="'hover'" default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" border highlight-current-row :cell-class-name="tored" :header-cell-class-name="tored">
<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>
......@@ -57,16 +40,8 @@
</div>
<!--单条-->
<div class="table-item" v-else>
<el-table
element-loading-text="Loading"
:data="tableData"
row-key="id"
v-horizontal-scroll="'hover'"
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
border
highlight-current-row
>
<el-table element-loading-text="Loading" :data="tableData" row-key="id" v-horizontal-scroll="'hover'" default-expand-all
: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>
......@@ -114,15 +89,20 @@
<template slot-scope="scope">{{scope.row.taxType || '--'}}</template>
</el-table-column>
<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 label="成本合价" width="130" prop="costEffective">
<template slot-scope="scope">{{scope.row.costEffective || '--'}}</template>
</el-table-column>
<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 label="截止本月工程量" width="130" prop="currentProjectVolume">
<template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template>
......@@ -131,7 +111,6 @@
<template slot-scope="scope">{{scope.row.submitProjectVolume || '--'}}</template>
</el-table-column>
<el-table-column label="备注" width="130" prop="remarks">
<template slot-scope="scope">{{scope.row.remarks || '--'}}</template>
</el-table-column>
......@@ -140,7 +119,7 @@
</el-table-column>
<el-table-column label="操作" width="130" fixed="right">
<template slot-scope="scope">
<span class="wordprimary" @click="pushwork(scope.row)">推送工程量</span>
<span class="wordprimary" @click="pushwork(scope.row)">推送工程量</span>
</template>
</el-table-column>
</el-table>
......@@ -148,10 +127,7 @@
</div>
<!--推送工程量-->
<el-dialog
class="pro-news"
:visible.sync="dialogVisible"
width="480px">
<el-dialog class="pro-news" :visible.sync="dialogVisible" width="480px">
<div class="poptitle">
<span>推送工程量</span>
</div>
......@@ -164,7 +140,9 @@
</el-form-item>
<el-form-item label="需推送工程量" class="row">
<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 label="IPM项目编码" class="row">
<el-input type="text" placeholder="请输入IPM项目编码" v-model="queryParam.ipmProjectCode"></el-input>
......@@ -175,383 +153,472 @@
<el-form-item label="IPM作业编码" class="row">
<el-input type="text" placeholder="请输入IPM作业编码" v-model="queryParam.ipmBizCode"></el-input>
</el-form-item>
</el-form >
</el-form>
<div class="popbot">
<div class="btn btn_cancel h32" @click="dialogVisible = false">取消</div>
<div class="btn btn_primary h32" @click="savepro">确定推送</div>
</div>
</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>
</template>
<script>
import ProjectSideMenu from '@/views/projectCostLedger/detail/components/ProjectSideMenu'
import {
getCostMeasureslist,
getMeasureslist,
getSummarydata,
projectVolume,
pushProjectvolume,actualMonths
} from '@/api/projectCostLedger'
import ProjectSideMenu from '@/views/projectCostLedger/detail/components/ProjectSideMenu';
import {
getCostMeasureslist,
getMeasureslist,
getSummarydata,
projectVolume,
pushProjectvolume,
getActualMonthsApi,saveBatch
} from '@/api/projectCostLedger';
import { cloneDeep } from "lodash-es";
export default {
name: "MeasureItems",
props: {
// 项目ID
projectId: {
type: String,
required: true,
default: ""
export default {
name: "MeasureItems",
props: {
// 项目ID
projectId: {
type: String,
required: true,
default: ""
},
// 详情信息
projectDetailInfo: {
type: Object,
default: () => ({})
}
},
watch: {
projectDetailInfo: {
handler(newValue) {
this.comProjectDetailInfo = newValue ? cloneDeep(newValue) : {};
this.init(newValue.projectId);
},
// 详情信息
projectDetailInfo: {
type: Object,
default: () => ({})
}
deep: true
},
watch: {
projectDetailInfo: {
handler(newValue) {
this.comProjectDetailInfo = newValue ? newValue : {};
this.init(this.projectId);
projectId: {
handler(newValue) {
this.comProjectId = newValue;
}
}
},
components: {
ProjectSideMenu
},
data() {
return {
pickerOptions: {
disabledDate(time) {
let istrue = true;
let month = new Date().getMonth() + 1;
let year = new Date().getFullYear();
let times = (year + 5) + '-' + month + '-01 ' + '00:00:00';
istrue = new Date().getTime() < time.getTime() && time.getTime() < new Date(times).getTime();
return !istrue;
},
deep: true,
immediate: true
},
projectId: {
handler(newValue) {
this.comProjectId = newValue;
},
immediate: true
menuOptions: {
nodeName: "itemContent",
nodeValue: "id",
},
comProjectDetailInfo: this.projectDetailInfo ? cloneDeep(this.projectDetailInfo) : {},
comProjectId: this.projectId,
defaultActive: "",
menuTreeList: [
],
id: 0,
expenseDate: '',
tableData: [],
isall: true,//是否汇总
dialogVisible: false,
queryParam: {},//推送工程量数据
dateoptions: [],
cbVisible:false,
chooseDate:"",
isinput:false,//是否填写
};
},
//可访问data属性
created() {
this.init(this.comProjectId);
},
//计算集
computed: {
},
//方法集
methods: {
tored({column}){
if(column.property=='quantity'){
return 'tored'
}
},
components: {
ProjectSideMenu
tored1({column}){
let arr = ['submitProjectVolume','suncurrentProjectVolume','currentProjectVolume','costEffective','monthCostRate']
if(arr.includes(column.property)&&this.isinput){
return 'tored'
}
},
data() {
return {
pickerOptions: {
disabledDate(time) {
let istrue = true
let month = new Date().getMonth()+1
let year = new Date().getFullYear()
let times = (year+5)+'-'+ month + '-01 ' + '00:00:00'
istrue = new Date().getTime() < time.getTime() && time.getTime() < new Date(times).getTime()
return !istrue
},
},
menuOptions: {
nodeName: "itemContent",
nodeValue: "id",
},
comProjectDetailInfo: {},
comProjectId: "",
defaultActive: "",
menuTreeList: [
],
id: 0,
expenseDate:'',
tableData:[],
isall:true,//是否汇总
dialogVisible:false,
queryParam:{},//推送工程量数据
dateoptions:[],
};
async getactualMonths() {
try {
const params = {
projectId: this.comProjectId,
id: this.id
};
let res = await getActualMonthsApi(params);
let data = res.data
let arr = []
let month = new Date().getMonth() +1
let year = new Date().getFullYear()
let thismonth = year + (month>= 9? month:'0'+ month)
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) {
}
},
//可访问data属性
created() {
// let month = new Date().getMonth() +1
// let year = new Date().getFullYear()
// this.expenseDate = year + (month>= 9? month:'0'+ month)
this.getactualMonths()
async select(menuPath) {
this.id = menuPath;
this.getactualMonths();
// let month = this.expenseDate.replace('-', "");
this.getDatas(menuPath)
},
async getDatas(menuPath){
let param = {
projectId: this.projectId,
id: this.id,
month: this.expenseDate
};
if (menuPath == 0) {//费用汇总
this.isall = true;
// const formData = new FormData();
// formData.append("projectId", this.projectId);
// formData.append("month", this.expenseDate);
// const res = await getSummarydata(formData);
// this.tableData = res.data;
} else {//各个子项
this.isall = false;
// const res = await getCostMeasureslist(param);
// this.tableData = res.data;
}
const res = await getCostMeasureslist(param);
this.tableData = res.data;
this.isinput = false
},
async init(detail = '') {
try {
const projectId = detail;
if (!projectId) return;
await this.getFeedSummaryMenuTree(projectId);
this.getactualMonths();
} catch (error) {
//计算集
computed: {
}
},
//方法集
methods: {
getactualMonths(){
const formDatas = new FormData();
formDatas.append("projectId", this.projectId);
formDatas.append("id", this.id);
console.log(formDatas.get('projectId'))
console.log(formDatas.get('id'))
actualMonths(formDatas).then(res=>{
let data = res.data
data.forEach(item=>{
item.value = item
item.label = item.substring(1,4)+'-'+item.substring(5,6)
})
if(data&&data.length>0)
this.expenseDate = data[0].value
})
},
select(menuPath){
this.id = menuPath
// let month = this.expenseDate.replace('-', "");
let param = {
projectId:this.projectId,
id:this.id,
month:this.expenseDate
async getFeedSummaryMenuTree(params) {
try {
const result = await getMeasureslist(params);
if (result.code == 200) {
let arr = {};
arr.itemContent = '措施费';
arr.id = 0;
let child = result.data;
let li = {};
li.itemContent = '费用汇总';
li.id = 0;
child.unshift(li);
arr.children = child;
const _tempArray = [arr];
this.menuTreeList = _tempArray;
await this.$nextTick();
this.$refs['profitloss'].$refs['customElMenu'].open(_tempArray[0].id);
this.defaultActive = child[0].id;
this.select(child[0].id);
}
} catch (error) {
console.log(error);
}
},
changetime(val) {
this.getDatas(this.id)
},
//推送工作量
pushwork(row) {
this.queryParam = {
id: row.id,
projectName: '',
submitProjectVolume: '',
ipmProjectCode: '',
ipmContractCode: '',
ipmBizCode: '',
};
projectVolume(row.id).then(res => {
if (res.data) {
let datas = res.data;
this.queryParam.currentProjectVolume = datas.currentProjectVolume;
this.queryParam.ipmProjectCode = datas.ipmProjectCode;
this.queryParam.ipmContractCode = datas.ipmContractCode;
this.queryParam.ipmBizCode = datas.ipmBizCode;
}
if(menuPath == 0){//费用汇总
this.isall = true
const formData = new FormData();
formData.append("projectId", this.projectId);
getSummarydata(formData).then(res=>{
this.tableData = res.data
})
} else {//各个子项
this.isall = false
getCostMeasureslist(param).then(res => {
this.tableData = res.data
})
});
this.dialogVisible = true;
},
//确认推送
savepro() {
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);
}
this.getactualMonths()
},
async init(detail = '') {
try {
const projectId = detail;
if (!projectId) return;
await this.getFeedSummaryMenuTree(projectId);
} catch (error) {
});
},
addcost() {
this.cbVisible = true
},
addinputs(){
this.tableData.forEach(item=>{
item.month = this.expenseDate
})
saveBatch(JSON.stringify(this.tableData)).then(res=>{
if(res.code == 200){
this.$message.success(res.msg)
this.isinput = false
this.getDatas(this.id)
}else{
this.$message.error(res.msg)
}
},
async getFeedSummaryMenuTree(params) {
try {
const result = await getMeasureslist(params);
if (result.code == 200) {
let arr = {}
arr.itemContent = '措施费'
arr.id = 0
let child = result.data
let li = {}
li.itemContent = '费用汇总'
li.id = 0
child.unshift(li)
arr.children = child
const _tempArray = [arr];
this.menuTreeList = _tempArray;
await this.$nextTick()
this.$refs['profitloss'].$refs['customElMenu'].open(_tempArray[0].id)
this.defaultActive = child[0].id
this.select(child[0].id)
}
} catch (error) {
console.log(error)
}
},
changetime(val){
this.select(this.id)
},
//推送工作量
pushwork(row){
this.queryParam = {
id:row.id,
projectName:'',
submitProjectVolume:'',
ipmProjectCode:'',
ipmContractCode:'',
ipmBizCode:'',
})
},
changeDate(){
let choseDate = this.chooseDate.replace('-','')
let hasdate = false
this.dateoptions.forEach(item=>{
if(item.value == choseDate){
hasdate = true
}
projectVolume(row.id).then(res=>{
if(res.data){
let datas = res.data
this.queryParam.currentProjectVolume = datas.currentProjectVolume
this.queryParam.ipmProjectCode = datas.ipmProjectCode
this.queryParam.ipmContractCode = datas.ipmContractCode
this.queryParam.ipmBizCode = datas.ipmBizCode
}
})
this.dialogVisible = true
},
//确认推送
savepro(){
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(){
},
})
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>
<style lang="scss" scoped>
.feed-summary-container {
.feed-summary-container {
width: 100%;
height: 100%;
::v-deep .tored{
/*background: rgb(255,236,236) !important;*/
}
.feed-summary-inner {
width: 100%;
height: 100%;
display: flex;
align-items: center;
.feed-summary-inner {
width: 100%;
.left-side-menu {
width: 220px;
min-width: 220px;
height: 100%;
display: flex;
align-items: center;
.left-side-menu {
width: 220px;
min-width: 220px;
height: 100%;
}
.profitloss{
width: calc(100% - 220px);
height: 100%;
background: #fff;
padding: 16px;
.table-item{
margin-top: 16px;
}
}
}
.search{
display: flex;
justify-content: space-between;
}
::v-deep .pro-news {
.el-dialog__body {
padding: 24px 0 0;
.profitloss {
width: calc(100% - 220px);
height: 100%;
background: #fff;
padding: 16px;
.table-item {
margin-top: 16px;
}
}
}
.search {
display: flex;
justify-content: space-between;
}
::v-deep .pro-news {
.el-dialog__body {
padding: 24px 0 0;
}
.el-dialog__headerbtn {
top: 20px;
right: 20px;
z-index: 3;
}
.el-dialog__headerbtn {
top: 20px;
right: 20px;
z-index: 3;
}
.poptitle {
line-height: 56px;
border-bottom: 1px solid #eee;
height: 56px;
position: absolute;
top: 0;
left: 0;
width: 100%;
.poptitle {
line-height: 56px;
border-bottom: 1px solid #eee;
height: 56px;
position: absolute;
top: 0;
left: 0;
width: 100%;
> span {
padding-left: 20px;
font-weight: bold;
font-size: 16px;
color: #232323;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
width: 385px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
> span {
padding-left: 20px;
font-weight: bold;
font-size: 16px;
color: #232323;
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
width: 385px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.popform {
padding: 24px 20px 0;
.popform {
padding: 24px 20px 0;
.row {
margin-bottom: 16px;
position: relative;
.checkcb{
position: absolute;
left: -100px;
}
.el-form-item__label {
font-weight: 400;
opacity: 0.8;
padding: 0;
font-size: 14px;
color: #232323;
padding-right: 16px;
}
.el-input,
.el-textarea,
.el-select {
display: inline-block;
width: 320px;
.row {
margin-bottom: 16px;
position: relative;
.checkcb {
position: absolute;
left: -100px;
}
.el-form-item__label {
font-weight: 400;
opacity: 0.8;
padding: 0;
font-size: 14px;
color: #232323;
padding-right: 16px;
}
.el-input__inner,
.el-textarea__inner {
width: 100%;
height: 32px;
border-radius: 0px;
.el-input,
.el-textarea,
.el-select {
display: inline-block;
width: 320px;
&:hover {
border-color: #0081ff;
}
}
.el-input__inner,
.el-textarea__inner {
width: 100%;
height: 32px;
border-radius: 0px;
.el-textarea__inner {
height: 90px;
font-family: inherit;
color: #000;
&:hover {
border-color: #0081ff;
}
}
.el-input__suffix {
height: 32px;
}
.el-textarea__inner {
height: 90px;
font-family: inherit;
color: #000;
}
.el-input__icon {
line-height: 32px;
}
.el-input__suffix {
height: 32px;
}
.el-form-item__error {
padding-top: 2px;
.el-input__icon {
line-height: 32px;
}
}
.el-input-group--append{
position: relative;
.el-input-group__append{
position: absolute;
right: 0;
width: 76px;
top: 0;
border: 0;
background: none;
&:hover{
background: none !important;
}
.pro-getbtn{
border-left: 1px solid #DCDFE6;
height: 32px;
color: #0081FF;
line-height: 32px;
text-align: center;
}
.el-form-item__error {
padding-top: 2px;
}
}
.el-input-group--append {
position: relative;
.el-input-group__append {
position: absolute;
right: 0;
width: 76px;
top: 0;
border: 0;
background: none;
&:hover {
background: none !important;
}
.pro-getbtn {
border-left: 1px solid #dcdfe6;
height: 32px;
color: #0081ff;
line-height: 32px;
text-align: center;
}
}
}
}
.popbot {
border-top: 1px solid #EEEEEE;
text-align: right;
margin-top: 24px;
padding: 16px 20px;
.popbot {
border-top: 1px solid #eeeeee;
text-align: right;
margin-top: 24px;
padding: 16px 20px;
.btn {
border-radius: 2px;
margin-left: 12px;
padding: 0 24px;
&.btn_disabled{
background: #8BD1FF;
}
.btn {
border-radius: 2px;
margin-left: 12px;
padding: 0 24px;
&.btn_disabled {
background: #8bd1ff;
}
}
.msgs{
font-size: 12px;
line-height: 17px;
height: 17px;
display: block;
margin: 0 0 -4px;
}
}
.msgs {
font-size: 12px;
line-height: 17px;
height: 17px;
display: block;
margin: 0 0 -4px;
}
}
}
</style>
......@@ -3,7 +3,7 @@
<div class="project-cost-ledger-detail-inner">
<project-detail-header :current="current" :breadCrumbTree="createProjectBreadCrumbTree"></project-detail-header>
<!-- 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切换组件容器 -->
<div class="project-cost-ledger-detail-module">
<!-- 放入组件 v-if current == ‘xxxx’ 详情变量 this.detailInfo 需要深度监听-->
......@@ -15,16 +15,16 @@
<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>
<!-- 盈亏分析对比 -->
<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>
......@@ -62,14 +62,15 @@ export default {
},
data() {
return {
projectID: "",
projectId: "",
current: "",
// 详情信息变量
detailInfo: {
projectId: "1754425038355890177",
cbStage: 0,
cbType:1
cbType: 1
},
tabsDisabled: false,
toggleTabs: [
{
value: "basicEngineeringInformation",
......@@ -161,21 +162,24 @@ export default {
},
async getProjectQuery() {
try {
this.tabsDisabled = true;
const { query } = this.$route;
// if (!query.projectID) return this.$message.error("缺少项目id");
this.projectID = query.projectID;
// if (!query.projectId) return this.$message.error("缺少项目id");
this.projectId = query.projectId;
// 获取详情 保证详情获取完毕 再执行tab命中 进行生命周期
await this.getProjectDetail(query.projectId);
if (query.current) {
this.current = query.current;
} else {
// 默认命中工程项目信息
this.current = "basicEngineeringInformation";
};
await this.getProjectDetail(query.projectID);
this.tabsDisabled = false;
} catch (error) {
console.log(error);
}
},
async getProjectDetail(projectID) {
async getProjectDetail(projectId) {
try {
} catch (error) {
......
......@@ -70,13 +70,13 @@
<div style="display:flex;align-items:center">
<el-tooltip placement="top" v-if="scope.row.projectText.length>20">
<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>
<span v-else v-html="scope.row.projectName"></span>
</div>
</el-tooltip>
<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>
<span v-else v-html="scope.row.projectName"></span>
</div>
......
......@@ -243,7 +243,7 @@
<script>
import { getToken } from '@/utils/auth'
// 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 {
name: 'upload',
......@@ -297,7 +297,28 @@
this.visible = true
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
importData(this.formdata.id).then(res=>{
})
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 {
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