Commit 28152a13 authored by huangjie's avatar huangjie

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

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 61e974fc 44a08733
......@@ -5,10 +5,14 @@ import com.dsk.common.core.domain.R;
import com.dsk.common.helper.LoginHelper;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.bo.CbSceneExpenseMonthBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import com.dsk.cscec.service.CbSceneExpenseChildrenService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
......@@ -52,7 +56,15 @@ public class CbSceneExpenseChildrenController extends BaseController {
* 获取现场经费二级分类数据
*/
@GetMapping("/getChildrenData")
public R<List<CbSceneExpenseChildren>> getChildrenData(@Validated @RequestBody CbSceneExpenseChildrenDataBo childrenDataBo) {
public R<List<CbSceneExpenseChildren>> getChildrenData(@Validated CbSceneExpenseChildrenDataBo childrenDataBo) {
return R.ok(baseService.getChildrenData(childrenDataBo));
}
/**
* 获取现场经费已添加成本数据月份
*/
@GetMapping("/getMonthList/")
public R<List<String>> getMonthList(@Validated CbSceneExpenseMonthBo monthBo) {
return baseService.getMonthList(monthBo);
}
}
\ No newline at end of file
......@@ -130,9 +130,9 @@ public class CbDirectExpense extends BaseEntity implements Serializable {
@Excel(name = "盈亏率")
private String profitLossRatio;
/**
* 标准成本费用
* 标准费用项库
*/
@Excel(name = "标准成本费用")
@Excel(name = "标准费用项库")
private String standardCbItem;
/**
* 备注
......
package com.dsk.cscec.domain.bo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author sxk
* @date 2024.03.12
* @time 17:02
*/
@Data
public class CbSceneExpenseMonthBo {
/**
* 文件ID
*/
@NotNull(message = "文件ID不能为空")
private Long fileId;
/**
* 菜单层级
*/
@NotBlank(message = "菜单层级不能为空")
private Integer menuLevel;
}
package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表数据库访问层
......@@ -10,6 +14,14 @@ import com.dsk.cscec.domain.CbSceneExpenseChildren;
* @since 2024-02-22 09:58:57
*/
public interface CbSceneExpenseChildrenMapper extends BaseMapper<CbSceneExpenseChildren> {
/**
* 获取现场经费汇总已添加成本数据月份
*/
R<List<String>> getSceneExpenseSummaryMonthList(@Param("fileId") Long fileId, @Param("deleteFlagExist") Integer deleteFlagExist);
/**
* 获取现场经费二级分类已添加成本数据月份
*/
R<List<String>> getSceneExpenseChildrenMonthList(@Param("fileId") Long fileId, @Param("deleteFlagExist") Integer deleteFlagExist);
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.bo.CbSceneExpenseMonthBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import java.util.List;
......@@ -38,4 +40,12 @@ public interface CbSceneExpenseChildrenService extends IService<CbSceneExpenseCh
* @return 现场经费二级分类数据
*/
List<CbSceneExpenseChildren> getChildrenData(CbSceneExpenseChildrenDataBo childrenDataBo);
/**
* 获取已添加成本数据月份
*
* @param monthBo 查询体
* @return 月份集合
*/
R<List<String>> getMonthList(CbSceneExpenseMonthBo monthBo);
}
......@@ -5,7 +5,9 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.core.domain.R;
import com.dsk.common.excel.ExcelUtils;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.StringUtils;
import com.dsk.cscec.constant.CbProjectConstants;
import com.dsk.cscec.constant.CbSceneExpenseConstants;
......@@ -14,6 +16,7 @@ import com.dsk.cscec.domain.CbProjectRecord;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenImportBo;
import com.dsk.cscec.domain.bo.CbSceneExpenseMonthBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import com.dsk.cscec.mapper.CbProjectFileMapper;
import com.dsk.cscec.mapper.CbProjectRecordMapper;
......@@ -29,6 +32,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -198,6 +202,24 @@ public class CbSceneExpenseChildrenServiceImpl extends ServiceImpl<CbSceneExpens
.eq(CbSceneExpenseChildren::getProjectFileId, childrenDataBo.getFileId()));
}
/**
* 获取已添加成本数据月份
*
* @param monthBo 查询体
* @return 月份集合
*/
@Override
public R<List<String>> getMonthList(CbSceneExpenseMonthBo monthBo) {
//汇总和二级数据分开返
if (Objects.equals(monthBo.getMenuLevel(), CbSceneExpenseConstants.MENU_LEVEL1)) {
return baseMapper.getSceneExpenseSummaryMonthList(monthBo.getFileId(), CbProjectConstants.DELETE_FLAG_EXIST);
} else if (Objects.equals(monthBo.getMenuLevel(), CbSceneExpenseConstants.MENU_LEVEL2)) {
return baseMapper.getSceneExpenseChildrenMonthList(monthBo.getFileId(), CbProjectConstants.DELETE_FLAG_EXIST);
} else {
throw new ServiceException("菜单层级无效");
}
}
/**
* 校验项目是否存在
*
......
......@@ -50,9 +50,9 @@ public class PushMonitorRules implements Serializable {
private String timePeriodEnd;
/**
* 接收方式 手机:0 PC:1
* 接收方式 开:0 关:1
*/
private String receiveMode;
private Integer receiveMode;
/**
* 手机号码,多个逗号隔开
*/
......
package com.dsk.monitor.job;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsk.common.tenant.helper.TenantHelper;
import com.dsk.common.utils.DateUtils;
import com.dsk.common.utils.redis.RedisUtils;
import com.dsk.monitor.domain.dto.PushMonitorInfo;
import com.dsk.monitor.domain.dto.PushMonitorRules;
import com.dsk.monitor.domain.vo.ConditionVo;
......@@ -18,10 +20,8 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.time.Duration;
import java.util.*;
/**
* @ClassName PushScheduling
......@@ -42,9 +42,24 @@ public class PushScheduling {
@Resource
private PushMonitorRulesMapper rulesMapper;
/**
* 关闭推动
*/
private static final Integer IS_SWITCH = 1;
// @Scheduled(cron = "0 0/2 * * * ?")
@Scheduled(cron = "0 0 * * * ?")
public void receiveModePhone() throws Exception {
TenantHelper.setTenantId("1");
// 设置redisKey
String lockKey = "stockKey";
// 设置redisValue
String value = UUID.randomUUID().toString();
// 这里默认设置超时时间为30秒
boolean hasKey = RedisUtils.setObjectIfAbsent(lockKey, value, Duration.ofMillis(1000 * 30));
if (!hasKey) {
return ;
}
// 是否是周末
boolean isWeekend = DateUtil.isWeekend(new Date());
PushSettingHolidayVo holidayVo = new PushSettingHolidayVo();
......@@ -55,52 +70,91 @@ public class PushScheduling {
if (200 == settingHolidayCode) {
isWeekend = !settingHolidayData;
}
TenantHelper.setTenantId("1");
// 获取当前整点时间
Integer concurrentHour = DateUtils.getHour();
QueryWrapper<PushMonitorRules> queryWrapper = new QueryWrapper();
List<PushMonitorRules> detailList = rulesMapper.selectList(queryWrapper);
Integer timeStart = 0;
Integer timeEnd = 24;
for (PushMonitorRules detail : detailList) {
if (IS_SWITCH.equals(detail.getReceiveMode())) {
continue;
}
Integer pushFrequency = detail.getPushFrequency();
if (pushFrequency > 1) {
if (isWeekend) {
continue;
}
}
// 推送时段-起
String timePeriodStart = detail.getTimePeriodStart();
if (ObjectUtil.isNotEmpty(timePeriodStart)) {
timePeriodStart = timePeriodStart.substring(0,2);
if (timePeriodStart.contains("0")) {
timePeriodStart = timePeriodStart.substring(1,2);
}
timeStart = Integer.valueOf(timePeriodStart);
}
// 推送时段-止
String timePeriodEnd = detail.getTimePeriodEnd();
if (ObjectUtil.isNotEmpty(timePeriodEnd)) {
timePeriodEnd = timePeriodEnd.substring(0,2);
if (timePeriodEnd.contains("0")) {
timePeriodEnd = timePeriodEnd.substring(1,2);
}
Integer pushFrequency = detail.getPushFrequency();
if (pushFrequency > 1) {
if (isWeekend) {
continue;
timeEnd = Integer.valueOf(timePeriodEnd);
}
if (ObjectUtil.isNotEmpty(timePeriodStart) && ObjectUtil.isEmpty(timePeriodEnd)) {
if (concurrentHour >= timeStart) {
savePushMonitorInfo(detail);
}
}
if (ObjectUtil.isEmpty(timePeriodStart) && ObjectUtil.isNotEmpty(timePeriodEnd)) {
if (concurrentHour <= timeEnd) {
savePushMonitorInfo(detail);
}
}
Integer timeStart = Integer.valueOf(timePeriodStart);
Integer timeEnd = Integer.valueOf(timePeriodEnd);
if (ObjectUtil.isEmpty(timePeriodStart) && ObjectUtil.isEmpty(timePeriodEnd)) {
savePushMonitorInfo(detail);
}
if (ObjectUtil.isNotEmpty(timePeriodStart) && ObjectUtil.isNotEmpty(timePeriodEnd)) {
if (concurrentHour >= timeStart && concurrentHour <= timeEnd) {
savePushMonitorInfo(detail);
}
}
}
}
/***
*@Description: 查询并保存动态信息
*@Param:
*@return: void
*@Author: Dgm
*@date: 2024/3/17 14:30
*/
private void savePushMonitorInfo (PushMonitorRules detail) throws Exception {
PushMonitorDynamicPageVo pageVo = new PushMonitorDynamicPageVo();
pageVo.setUserId(detail.getUserId());
ConditionVo vo = new ConditionVo();
// 截止时间
vo.setEndTime(DateUtils.getDate());
vo.setEndTime(DateUtils.getTime());
vo.setBeginTime(DateUtils.format(DateUtils.addDays(new Date(),-1)));
// 监控维度
// 条件查询监控维度子级名称数组
vo.setDimension(getParamList(detail.getDimension()));
// 条件查询监控维度父级名称数组
vo.setParentDimension(getParamList((detail.getRiskType())));
vo.setUserId(detail.getUserId());
pageVo.setCondition(vo);;
Map<String, Object> resMap = monitorService.companyDynamicPageScheduled(pageVo);
Integer code = MapUtils.getInteger(resMap, "code", 300);
Map data = MapUtils.getMap(resMap, "data", null);
if (200 != code) {
continue;
return;
}
Integer count = MapUtils.getInteger(data, "totalCount", 0);
if (count > 0 ) {
SendMessageUtil.sendMessage(detail.getPhones(), count.toString());
// SendMessageUtil.sendMessage(detail.getPhones(), getContent(count));
}
if (count > 0) {
PushMonitorInfo pushMonitorInfo = new PushMonitorInfo();
......@@ -109,12 +163,24 @@ public class PushScheduling {
monitorInfoMapper.insert(pushMonitorInfo);
}
}
public static List<String> getParamList(String dimension) {
List<String> getParamList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(dimension)) {
getParamList = Arrays.asList(dimension.split(","));
}
return getParamList;
}
public List<String> getParamList(String dimension) {
List<String> getParamList = Arrays.asList(dimension.split(","));
return getParamList;
/**
*@Description: 组装推送信息
*@Param:
*@return: java.lang.String
*@Author: Dgm
*@date: 2024/3/16 14:05
*/
private String getContent (Integer number) {
return "您监控的企业发生".concat(number.toString()).concat("条风险动态。");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.CbSceneExpenseChildrenMapper">
<!--获取现场经费汇总已添加成本数据月份-->
<select id="getSceneExpenseSummaryMonthList" resultType="java.util.List">
</select>
<!--获取现场经费二级分类已添加成本数据月份-->
<select id="getSceneExpenseChildrenMonthList" resultType="java.util.List">
</select>
</mapper>
......@@ -44,7 +44,6 @@
placeholder="起始时间"
v-model="startTime"
@change="startChangeTime"
:clearable="false"
:picker-options="{
start: '00:00',
step: '01:00',
......@@ -55,7 +54,6 @@
<el-time-select
placeholder="结束时间"
v-model="endTime"
:clearable="false"
:picker-options="{
start: '00:00',
step: '01:00',
......@@ -69,9 +67,11 @@
<div class="m-main">
<div class="main-item">
<div class="label">接收方式</div>
<el-radio-group v-model="queryParams.receiveMode">
<!--<el-radio v-model="queryParams.radio" label="1">全部</el-radio>-->
<el-radio v-model="queryParams.receiveMode" label="0">手机短信</el-radio>
<el-radio label="0" @click.native.prevent="clickRadio()">手机短信</el-radio>
<!--<el-radio v-model="queryParams.radio" label="3">PC</el-radio>-->
</el-radio-group>
</div>
<div class="main-item" style="line-height: 32px;">
<div class="label">手机号码</div>
......@@ -177,6 +177,9 @@
this.endTime = ""
},
handleAdd(){
if(this.queryParams.receiveMode === '0' && !this.queryParams.phones){
return this.$message.warning('手机号码不能为空');
}
let params={
pushFrequency:Number(this.queryParams.pushFrequency),
riskType:'',
......@@ -220,6 +223,9 @@
changeTime(val){
console.log(val)
},
clickRadio(){
this.queryParams.receiveMode = this.queryParams.receiveMode === '0' ? '1' : '0'
},
}
}
</script>
......
<template>
<el-dialog :visible.sync="dialogVisible" width="720px" append-to-body class="dialogVisible" title="单位换算">
<el-tabs v-model="currentList" @tab-click="handleClickTab">
<el-tab-pane
:key="index"
v-for="(item, index) in toggleTabs"
:label="item.name"
:name="item.value"
>
{{item.content}}
</el-tab-pane>
<div class="detail-cont-tab">
<div class="select">
<el-select v-model="type1" placeholder="请选择">
<el-option v-for="(item,index) in typeList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select>
<i class="el-icon-sort icon"></i>
<el-select v-model="type2" placeholder="请选择">
<el-option v-for="(item,index) in typeList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select>
</div>
<el-table
:data="tableData"
default-expand-all
border
highlight-current-row
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="50">
</el-table-column>
<el-table-column label="序号" width="50" align="left">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="成本科目" width="190" prop="cbSubjectName"></el-table-column>
<el-table-column label="物料验收系统本月用料" width="195">
<template slot-scope="scope">
<span v-if="scope.row.quantities">{{scope.row.quantities}} {{scope.row.quantitiesUnit}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="换算后本月用料" prop="hsyl"></el-table-column>
</el-table>
</div>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose()">取消</el-button>
<el-button type="primary">保存结果</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: "unitConversion",
props: {
isVisible: {
type: Boolean,
default: false
},
dataList: {
type: Array,
default: () => []
},
},
data() {
return {
dialogVisible:this.isVisible,
currentList: "type1",
toggleTabs:[
{
value: "type1",
name: "长度",
},
{
value: "type2",
name: "面积",
},
{
value: "type3",
name: "重量",
},
{
value: "type4",
name: "体积",
},
// {
// value: "type4",
// name: "质量",
// },
// {
// value: "type5",
// name: "密度",
// },
],
type1:'',
type2:'',
typeList:[
{
dictLabel:'千米',
dictValue:'km'
},
{
dictLabel:'米',
dictValue:'m'
},
{
dictLabel:'分米',
dictValue:'dm'
},
{
dictLabel:'厘米',
dictValue:'cm'
},
{
dictLabel:'毫米',
dictValue:'mm'
},
{
dictLabel:'微米',
dictValue:'μm'
},
],
tableData:this.dataList,
tableList:[]
};
},
//可访问data属性
created() {
console.log(this.dataList)
},
//计算集
computed: {
},
//方法集
methods: {
handleClose () {
this.$emit('refresh')
},
handleClickTab(v){
this.type1='';
this.type2='';
if(v.label === '长度'){
this.typeList=[
{
dictLabel:'千米',
dictValue:'km'
},
{
dictLabel:'米',
dictValue:'m'
},
{
dictLabel:'分米',
dictValue:'dm'
},
{
dictLabel:'厘米',
dictValue:'cm'
},
{
dictLabel:'毫米',
dictValue:'mm'
},
{
dictLabel:'微米',
dictValue:'μm'
},
]
}
if(v.label === '面积'){
this.typeList=[
{
dictLabel:'平方千米',
dictValue:'km²'
},
{
dictLabel:'公顷',
dictValue:'ha'
},
{
dictLabel:'公亩',
dictValue:'a'
},
{
dictLabel:'平方米',
dictValue:'m²'
},
{
dictLabel:'平方分米',
dictValue:'dm²'
},
{
dictLabel:'平方厘米',
dictValue:'cm²'
},
{
dictLabel:'平方毫米',
dictValue:'mm²'
},
]
}
if(v.label === '体积'){
this.typeList=[
{
dictLabel:'吨',
dictValue:'T'
},
{
dictLabel:'千克',
dictValue:'kg'
},
{
dictLabel:'克',
dictValue:'g'
},
]
}
if(v.label === '体积'){
this.typeList=[
{
dictLabel:'立方千米',
dictValue:'km³'
},
{
dictLabel:'立方米',
dictValue:'m³'
},
{
dictLabel:'立方分米',
dictValue:'dm³'
},
{
dictLabel:'立方厘米',
dictValue:'cm³'
},
{
dictLabel:'立方毫米',
dictValue:'mm³'
},
{
dictLabel:'升',
dictValue:'L'
},
{
dictLabel:'分升',
dictValue:'dL'
},
{
dictLabel:'厘升',
dictValue:'cL'
},
{
dictLabel:'毫升',
dictValue:'mL'
},
{
dictLabel:'微升',
dictValue:'μL'
},
]
}
},
handleSelectionChange(val) {
console.log(val)
this.tableList=val;
}
},
}
</script>
<style lang="scss" scoped>
.dialogVisible{
::v-deep .el-dialog {
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
margin-top:0 !important;
.el-dialog__body{
flex:1;
overflow: auto;
padding:0;
border-top: 1px solid #EEEEEE;
border-bottom: 1px solid #EEEEEE;
.select{
margin-bottom: 16px;
}
.el-input{
width: 316px !important;
}
.el-tabs__nav-wrap{
padding: 0 16px;
}
.el-tabs__header{
margin: 0;
}
.detail-cont-tab{
padding: 24px 20px;
.icon{
transform: rotate(90deg);
color:#0081FF;
margin: 0 16px;
}
}
}
.el-dialog__footer{
padding: 16px 20px;
}
}
}
</style>
......@@ -82,6 +82,9 @@
<!-- 填写实际成本触发 -->
<add-actual-cost v-model="showAddActualCost" :project-create-time="projectDetailInfo.createTime" @timeSelect="timeSelect"></add-actual-cost>
<!-- 单位换算弹窗 -->
<unit-conversion v-if="showUnitConversion" :isVisible="showUnitConversion" :dataList="unitConversionList" @refresh="handleDialogVisible()"></unit-conversion>
</div>
</template>
<script>
......@@ -92,6 +95,7 @@ import DskSkeleton from "@/components/DskSkeleton";
import CustomTable from "@/components/CustomTable";
import EntityMaterialsTable from "@/components/CustomTable";
import AddActualCost from "./components/AddActualCost";
import unitConversion from "./components/unitConversion";
import { v4 } from 'uuid';
import dayjs from "dayjs";
import { cloneDeep } from "lodash-es";
......@@ -156,7 +160,8 @@ export default {
CustomTable,
EntityMaterialsTable,
DskSkeleton,
AddActualCost
AddActualCost,
unitConversion
},
data() {
const amountCheckValidator = (rule, value, callback) => {
......@@ -248,7 +253,11 @@ export default {
{ trigger: ["change"], validator: amountCheckValidator }
]
},
statisticsTimer: null
statisticsTimer: null,
// 单位换算弹窗
showUnitConversion:false,
//单位换算数据
unitConversionList:[]
};
},
//可访问data属性
......@@ -476,17 +485,56 @@ export default {
},
async getFeedSummaryConversionNotice(params) {
const data = await getFeedSummaryConversionNotice(params);
if (data.data == 500) {
// const data = {
// "code": 200,
// "msg": "系统检测到您近期未进行物料单位换算,请立即进行换算。",
// "data": [
// {
// "id": "1763389258189500519",
// "cbSubjectName": "钢筋",
// "companyNo": "FG-002-010025",
// "orgNo": "",
// "cbName": "热轧带肋钢筋HRB400E",
// "jobContent": "20mm 定尺12m",
// "calculationRule": "",
// "unit": "吨",
// "materialDescription": "",
// "guidePrice": "",
// "bidUnitPrice": 3513.27,
// "unitPriceDifference": null,
// "quantity": 0.317,
// "combinedPrice": 1113.70659,
// "combinedPriceTax": 1115.154424,
// "brandName": "",
// "bidSource": "请在此处填写",
// "remark": "",
// "quantities": 123123.0,
// "quantitiesUnit": "T",
// "conversionQuantities": null,
// "conversionUnit": null,
// "purchaseUnitPrice": null,
// "createTime": "2024-03-05 16:55:54",
// "totalQuantities": null,
// "actualId": "11111111",
// "pushQuantities": null,
// "ipmProjectCode": null,
// "ipmContractCode": null,
// "ipmJobCode": null
// }
// ]
// };
if (data.data) {
this.$confirm('系统检测到您近一月未进行物料单位换算,是否立即进行换算?', '温馨提示', {
confirmButtonText: '立即换算',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.unitConversionList=data.data;
this.showUnitConversion=true;
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
message: '已取消换算'
});
});
} else if (data.data instanceof Array) {
......@@ -665,7 +713,11 @@ export default {
return `can-edit-column-${property}`;
}
return "";
}
},
//关闭单位换算弹窗
handleDialogVisible () {
this.showUnitConversion = false
},
},
}
</script>
......
......@@ -55,52 +55,7 @@
</div>
</div>
<el-dialog :visible.sync="dialogVisible" width="720px" append-to-body class="dialogVisible" title="单位换算">
<el-tabs v-model="currentList" @tab-click="handleClickTab">
<el-tab-pane
:key="index"
v-for="(item, index) in toggleTabs"
:label="item.name"
:name="item.value"
>
{{item.content}}
</el-tab-pane>
<div class="detail-cont-tab">
<div class="select">
<el-select v-model="type1" placeholder="请选择">
<el-option v-for="(item,index) in typeList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select>
<i class="el-icon-sort icon"></i>
<el-select v-model="type2" placeholder="请选择">
<el-option v-for="(item,index) in typeList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
</el-select>
</div>
<el-table
:data="tableData1"
default-expand-all
border
highlight-current-row
>
<el-table-column
type="selection"
width="50">
</el-table-column>
<el-table-column label="序号" width="50" align="left">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="成本科目" width="190" prop="cbkm"></el-table-column>
<el-table-column label="物料验收系统本月用料" width="195" prop="wlyl"></el-table-column>
<el-table-column label="换算后本月用料" prop="hsyl"></el-table-column>
</el-table>
</div>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible=false">取消</el-button>
<el-button type="primary">保存结果</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
......@@ -154,7 +109,7 @@ export default {
pageNum:1,
pageSize:10,
},
defaultActive: "费用汇总",
defaultActive: "",
menuTreeList: [
{
id: "1",
......@@ -164,62 +119,12 @@ export default {
],
menuOptions: {
nodeName: "itemContent",
nodeValue: "menuId",
nodeValue: "id",
children : "children"
},
dialogVisible:false,
currentList: "type1",
toggleTabs:[
{
value: "type1",
name: "长度",
},
{
value: "type2",
name: "面积",
},
{
value: "type3",
name: "体积",
},
// {
// value: "type4",
// name: "质量",
// },
// {
// value: "type5",
// name: "密度",
// },
],
tableData1:[],
tableDataTotal1:0,
type1:'',
type2:'',
typeList:[
{
dictLabel:'千米',
dictValue:'千米'
},
{
dictLabel:'米',
dictValue:'米'
},
{
dictLabel:'分米',
dictValue:'分米'
},
{
dictLabel:'厘米',
dictValue:'厘米'
},
{
dictLabel:'毫米',
dictValue:'毫米'
},
{
dictLabel:'微米',
dictValue:'微米'
},
],
};
},
watch: {
......@@ -251,26 +156,27 @@ export default {
},
//方法集
methods: {
async getProjectOtherStatistics(params) {
async getProjectOtherMenuTreeApi(params) {
try {
const result = await getProjectOtherStatistics(params);
const result = await getProjectOtherMenuTreeApi(params);
if (result.code == 200) {
const _dataArray = result.data;
this.tableDataTotal=_dataArray.length;
this.tableData = _dataArray;
const _tempArray = result.data;
_tempArray.unshift({id:"11",itemContent:"费用汇总"});
this.menuTreeList[0].children = _tempArray;
this.defaultActive='11';
this.getProjectOtherStatistics(this.comProjectDetailInfo.projectId)
}
} catch (error) {
}
},
async getProjectOtherMenuTreeApi(params) {
async getProjectOtherStatistics(params) {
try {
const result = await getProjectOtherMenuTreeApi(params);
const result = await getProjectOtherStatistics(params);
if (result.code == 200) {
const _tempArray = result.data;
_tempArray.unshift({id:"11",itemContent:"费用汇总"});
this.menuTreeList[0].children = _tempArray;
this.getProjectOtherStatistics(this.comProjectDetailInfo.projectId)
const _dataArray = result.data;
this.tableDataTotal=_dataArray.length;
this.tableData = _dataArray;
}
} catch (error) {
......@@ -297,118 +203,7 @@ export default {
sortChange(){
},
handleClickTab(v){
this.type1='';
this.type2='';
if(v.label === '长度'){
this.typeList=[
{
dictLabel:'千米',
dictValue:'千米'
},
{
dictLabel:'米',
dictValue:'米'
},
{
dictLabel:'分米',
dictValue:'分米'
},
{
dictLabel:'厘米',
dictValue:'厘米'
},
{
dictLabel:'毫米',
dictValue:'毫米'
},
{
dictLabel:'微米',
dictValue:'微米'
},
]
}
if(v.label === '面积'){
this.typeList=[
{
dictLabel:'平方千米',
dictValue:'平方千米'
},
{
dictLabel:'公顷',
dictValue:'公顷'
},
{
dictLabel:'公亩',
dictValue:'公亩'
},
{
dictLabel:'平方米',
dictValue:'平方米'
},
{
dictLabel:'平方分米',
dictValue:'平方分米'
},
{
dictLabel:'平方厘米',
dictValue:'平方厘米'
},
{
dictLabel:'平方毫米',
dictValue:'平方毫米'
},
]
}
if(v.label === '体积'){
this.typeList=[
{
dictLabel:'立方千米',
dictValue:'立方千米'
},
{
dictLabel:'立方米',
dictValue:'立方米'
},
{
dictLabel:'立方分米',
dictValue:'立方分米'
},
{
dictLabel:'立方厘米',
dictValue:'立方厘米'
},
{
dictLabel:'立方毫米',
dictValue:'立方毫米'
},
{
dictLabel:'升',
dictValue:'升'
},
{
dictLabel:'分升',
dictValue:'分升'
},
{
dictLabel:'毫升',
dictValue:'毫升'
},
{
dictLabel:'微升',
dictValue:'微升'
},
{
dictLabel:'厘升',
dictValue:'厘升'
},
{
dictLabel:'公石',
dictValue:'公石'
},
]
}
},
},
}
</script>
......@@ -436,43 +231,4 @@ export default {
padding: 16px;
}
}
.dialogVisible{
::v-deep .el-dialog {
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
margin-top:0 !important;
.el-dialog__body{
flex:1;
overflow: auto;
padding:0;
border-top: 1px solid #EEEEEE;
border-bottom: 1px solid #EEEEEE;
.select{
margin-bottom: 16px;
}
.el-input{
width: 316px !important;
}
.el-tabs__nav-wrap{
padding: 0 16px;
}
.el-tabs__header{
margin: 0;
}
.detail-cont-tab{
padding: 24px 20px;
.icon{
transform: rotate(90deg);
color:#0081FF;
margin: 0 16px;
}
}
}
.el-dialog__footer{
padding: 16px 20px;
}
}
}
</style>
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