计划交集管控
This commit is contained in:
parent
476bbed2a6
commit
ee60c94396
@ -20,6 +20,8 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMap
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.service.bgmasterline.BgMasterLineService;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -74,6 +76,8 @@ public class PgMasterController {
|
||||
private BgMasterLineMapper bgMasterLineMapper;
|
||||
@Resource
|
||||
private ProcedureMapper procedureMapper;
|
||||
@Resource
|
||||
private AdminUserMapper adminUserMapper;
|
||||
|
||||
|
||||
@GetMapping("/getBomMx")
|
||||
@ -180,31 +184,165 @@ public class PgMasterController {
|
||||
}else {
|
||||
LambdaQueryWrapper<TaskDispatchDetailDO> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDO.getId());
|
||||
wrapper1.eq(TaskDispatchDetailDO::getCheckYn,0);
|
||||
wrapper1.eq(TaskDispatchDetailDO::getTestYn,"Y");
|
||||
wrapper1.eq(TaskDispatchDetailDO::getCheckYn, 0);
|
||||
wrapper1.eq(TaskDispatchDetailDO::getTestYn, "Y");
|
||||
List<TaskDispatchDetailDO> list = taskDispatchDetailMapper.selectList(wrapper1);
|
||||
if (ObjectUtil.isNotEmpty( list)){
|
||||
if (list.size()==detailDOS.size()){
|
||||
return error(400,"零件已全部检验完成");
|
||||
}else{
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
if (list.size() == detailDOS.size()) {
|
||||
return error(400, "零件已全部检验完成");
|
||||
} else {
|
||||
Map<Long, String> userNameMap = new HashMap<>();
|
||||
Map<Long, String> procedureNameMap = new HashMap<>();
|
||||
List<TaskDispatchDetailDO> collect1 = detailDOS.stream().filter(item -> item.getProcedureStatus() != 2).collect(Collectors.toList());
|
||||
List<Long> collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<ProcedureDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(ProcedureDO::getId, collect);
|
||||
List<ProcedureDO> procedureDOS = procedureMapper.selectList(lambdaQueryWrapper);
|
||||
// 转换为 Map<id, name>
|
||||
Map<Long, String> procedureNameMap = procedureDOS.stream()
|
||||
List<Long> collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(collect)) {
|
||||
LambdaQueryWrapper<ProcedureDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(ProcedureDO::getId, collect);
|
||||
List<ProcedureDO> procedureDOS = procedureMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
// 转换为 Map<id, name>
|
||||
procedureNameMap = procedureDOS.stream()
|
||||
.collect(Collectors.toMap(
|
||||
ProcedureDO::getId,
|
||||
ProcedureDO::getName,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
}
|
||||
|
||||
List<Long> collectOwer = collect1.stream().map(TaskDispatchDetailDO::getOwner).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(collectOwer)) {
|
||||
LambdaQueryWrapper<AdminUserDO> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.in(AdminUserDO::getId, collectOwer);
|
||||
List<AdminUserDO> userDOS = adminUserMapper.selectList(queryWrapper2);
|
||||
userNameMap = userDOS.stream()
|
||||
.collect(Collectors.toMap(
|
||||
AdminUserDO::getId,
|
||||
AdminUserDO::getNickname,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
}
|
||||
|
||||
List<TaskDispatchDetailDO> collect2 = collect1.stream().filter(item -> item.getReportProcess() == 1).collect(Collectors.toList());
|
||||
List<TaskDispatchDetailDO> collect3 = collect1.stream().filter(item -> item.getReportProcess() != 1).collect(Collectors.toList());
|
||||
return error(400,"该零件没有报工完成,请联系报工人员!");
|
||||
// 1. 遍历 collect2(正在报工的)
|
||||
StringBuilder messageBuilder = new StringBuilder("该零件");
|
||||
for (TaskDispatchDetailDO item : collect2) {
|
||||
Long procedureId = item.getProcedureId(); // 获取工序ID
|
||||
Long ownerId = item.getOwner(); // 获取负责人ID
|
||||
|
||||
// 从map中获取名称
|
||||
String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序");
|
||||
String ownerName = "";
|
||||
if (item.getDispatchType() == 1) {
|
||||
ownerName = userNameMap.getOrDefault(ownerId, "未知负责人");
|
||||
} else {
|
||||
ownerName = item.getPostId();
|
||||
}
|
||||
// 拼接消息
|
||||
messageBuilder.append(String.format("%s工序正在报工,没有结束,负责人%s,",
|
||||
procedureName, ownerName));
|
||||
}
|
||||
|
||||
// 2. 遍历 collect3(没有报工的)
|
||||
for (TaskDispatchDetailDO item : collect3) {
|
||||
Long procedureId = item.getProcedureId(); // 获取工序ID
|
||||
Long ownerId = item.getOwner(); // 获取负责人ID
|
||||
|
||||
// 从map中获取名称
|
||||
String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序");
|
||||
String ownerName = "";
|
||||
if (item.getDispatchType() == 1) {
|
||||
ownerName = userNameMap.getOrDefault(ownerId, "未知负责人");
|
||||
} else {
|
||||
ownerName = item.getPostId();
|
||||
}
|
||||
// 拼接消息
|
||||
messageBuilder.append(String.format("%s工序没有报工,负责人%s,",
|
||||
procedureName, ownerName));
|
||||
}
|
||||
|
||||
String fullMessage = messageBuilder.toString();
|
||||
if (fullMessage.endsWith(",")) {
|
||||
fullMessage = fullMessage.substring(0, fullMessage.length() - 1);
|
||||
}
|
||||
return error(411, fullMessage);
|
||||
}
|
||||
}else{
|
||||
return error(400,"该零件没有报工完成,请联系报工人员!");
|
||||
} else {
|
||||
Map<Long, String> userNameMap = new HashMap<>();
|
||||
Map<Long, String> procedureNameMap = new HashMap<>();
|
||||
List<TaskDispatchDetailDO> collect1 = detailDOS.stream().filter(item -> item.getProcedureStatus() != 2).collect(Collectors.toList());
|
||||
List<Long> collect = collect1.stream().map(TaskDispatchDetailDO::getProcedureId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(collect)) {
|
||||
LambdaQueryWrapper<ProcedureDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(ProcedureDO::getId, collect);
|
||||
List<ProcedureDO> procedureDOS = procedureMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
// 转换为 Map<id, name>
|
||||
procedureNameMap = procedureDOS.stream()
|
||||
.collect(Collectors.toMap(
|
||||
ProcedureDO::getId,
|
||||
ProcedureDO::getName,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
}
|
||||
|
||||
List<Long> collectOwer = collect1.stream().map(TaskDispatchDetailDO::getOwner).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(collectOwer)) {
|
||||
LambdaQueryWrapper<AdminUserDO> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.in(AdminUserDO::getId, collectOwer);
|
||||
List<AdminUserDO> userDOS = adminUserMapper.selectList(queryWrapper2);
|
||||
userNameMap = userDOS.stream()
|
||||
.collect(Collectors.toMap(
|
||||
AdminUserDO::getId,
|
||||
AdminUserDO::getNickname,
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
}
|
||||
|
||||
List<TaskDispatchDetailDO> collect2 = collect1.stream().filter(item -> item.getReportProcess() == 1).collect(Collectors.toList());
|
||||
List<TaskDispatchDetailDO> collect3 = collect1.stream().filter(item -> item.getReportProcess() != 1).collect(Collectors.toList());
|
||||
// 1. 遍历 collect2(正在报工的)
|
||||
StringBuilder messageBuilder = new StringBuilder("该零件");
|
||||
for (TaskDispatchDetailDO item : collect2) {
|
||||
Long procedureId = item.getProcedureId(); // 获取工序ID
|
||||
Long ownerId = item.getOwner(); // 获取负责人ID
|
||||
|
||||
// 从map中获取名称
|
||||
String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序");
|
||||
String ownerName = "";
|
||||
if (item.getDispatchType() == 1) {
|
||||
ownerName = userNameMap.getOrDefault(ownerId, "未知负责人");
|
||||
} else {
|
||||
ownerName = item.getPostId();
|
||||
}
|
||||
// 拼接消息
|
||||
messageBuilder.append(String.format("%s工序正在报工,没有结束,负责人%s,",
|
||||
procedureName, ownerName));
|
||||
}
|
||||
|
||||
// 2. 遍历 collect3(没有报工的)
|
||||
for (TaskDispatchDetailDO item : collect3) {
|
||||
Long procedureId = item.getProcedureId(); // 获取工序ID
|
||||
Long ownerId = item.getOwner(); // 获取负责人ID
|
||||
|
||||
// 从map中获取名称
|
||||
String procedureName = procedureNameMap.getOrDefault(procedureId, "未知工序");
|
||||
String ownerName = "";
|
||||
if (item.getDispatchType() == 1) {
|
||||
ownerName = userNameMap.getOrDefault(ownerId, "未知负责人");
|
||||
} else {
|
||||
ownerName = item.getPostId();
|
||||
}
|
||||
// 拼接消息
|
||||
messageBuilder.append(String.format("%s工序没有报工,负责人%s,",
|
||||
procedureName, ownerName));
|
||||
}
|
||||
|
||||
String fullMessage = messageBuilder.toString();
|
||||
if (fullMessage.endsWith(",")) {
|
||||
fullMessage = fullMessage.substring(0, fullMessage.length() - 1);
|
||||
}
|
||||
return error(411, fullMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,5 +150,10 @@ public class PlanSubController {
|
||||
ExcelUtils.write(response, "生产计划子项目.xls", "数据", PlanSubRespVO.class,
|
||||
BeanUtils.toBean(list, PlanSubRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/verification")
|
||||
@Operation(summary = "创建生产计划子项目")
|
||||
@PreAuthorize("@ss.hasPermission('heli:plan-sub:create')")
|
||||
public CommonResult verification(@RequestBody List<PlanSubSaveReqVO> list) {
|
||||
return planSubService.verification(list);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,4 +79,6 @@ public interface PlanSubService {
|
||||
PageResult<PlanSubDO> getPlanSubPage(PlanSubPageReqVO pageReqVO);
|
||||
|
||||
Integer getSearchRlT(PlanSubDetailRespVO pageReqVO);
|
||||
|
||||
CommonResult verification(List<PlanSubSaveReqVO> list);
|
||||
}
|
||||
|
||||
@ -665,4 +665,138 @@ public class PlanSubServiceImpl implements PlanSubService {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult verification(List<PlanSubSaveReqVO> list) {
|
||||
HashSet<String> userIds = new HashSet<>();
|
||||
for (PlanSubSaveReqVO planSubSaveReqVO : list) {
|
||||
if (planSubSaveReqVO.getTwoDimOwner() != null) {
|
||||
userIds.add(planSubSaveReqVO.getTwoDimOwner());
|
||||
}
|
||||
if (planSubSaveReqVO.getThreeDimOwner() != null) {
|
||||
userIds.add(planSubSaveReqVO.getThreeDimOwner());
|
||||
}
|
||||
if (planSubSaveReqVO.getBlankOwner() != null) {
|
||||
userIds.add(planSubSaveReqVO.getBlankOwner());
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
List<PlanSubDetailDO> planSubDetailDOS = planSubDetailMapper.selectExistList(userIds);
|
||||
// checkForConflicts(list, planSubDetailDOS);
|
||||
|
||||
// 为了提高查询效率,将 list2 按 Owner 转换为 Map
|
||||
Map<Long, List<PlanSubDetailDO>> tasksByOwner = new HashMap<>();
|
||||
for (PlanSubDetailDO task : planSubDetailDOS) {
|
||||
tasksByOwner.computeIfAbsent(task.getTwoDimOwner(), k -> new ArrayList<>()).add(task);
|
||||
}
|
||||
|
||||
// 将每个工艺任务拆分成独立的任务项,方便统一检查
|
||||
List<TaskItem> allNewItems = new ArrayList<>();
|
||||
for (PlanSubSaveReqVO task : list) {
|
||||
if (!task.isHasSaveInBlankDetail() && task.getBlankOwner() != null && task.getStartBlankDate() != null && task.getBlankDate() != null) {
|
||||
allNewItems.add(new TaskItem(Long.valueOf(task.getBlankOwner()), task.getStartBlankDate(), task.getBlankDate(), "毛坯",task.getName()));
|
||||
}
|
||||
if (!task.isHasSaveIn2DDetail() && task.getTwoDimOwner() != null && task.getStartTwoDimDate() != null && task.getTwoDimDate() != null) {
|
||||
allNewItems.add(new TaskItem(Long.valueOf(task.getTwoDimOwner()), task.getStartTwoDimDate(), task.getTwoDimDate(), "2D",task.getName()));
|
||||
}
|
||||
if (!task.isHasSaveIn3DDetail() && task.getThreeDimOwner() != null && task.getStartThreeDimDate() != null && task.getThreeDimDate() != null) {
|
||||
allNewItems.add(new TaskItem(Long.valueOf(task.getThreeDimOwner()), task.getStartThreeDimDate(), task.getThreeDimDate(), "3D",task.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
// 对所有新任务项进行两两比较
|
||||
for (int i = 0; i < allNewItems.size(); i++) {
|
||||
TaskItem item1 = allNewItems.get(i);
|
||||
for (int j = i + 1; j < allNewItems.size(); j++) {
|
||||
TaskItem item2 = allNewItems.get(j);
|
||||
// 只检查同一个责任人负责的任务
|
||||
if (item1.owner.equals(item2.owner)) {
|
||||
if (hasOverlap(item1.start, item1.end, item2.start, item2.end)) {
|
||||
return CommonResult.success(item1.projectName+" "+item1.type+item1.start.toString().substring(0,10)+" -"+item1.end.toString().substring(0,10)+"跟"+item1.projectName+" "+item1.type+" "+item2.start.toString().substring(0,10)+item2.end.toString().substring(0,10)+"存在交集,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (PlanSubSaveReqVO newTask : list) {
|
||||
// 检查毛坯任务
|
||||
if (!newTask.isHasSaveInBlankDetail() && newTask.getBlankOwner() != null){
|
||||
Long owner = Long.valueOf(newTask.getBlankOwner());
|
||||
// 2. 检查 list1 与 list2 之间的时间冲突
|
||||
if (ObjectUtil.isEmpty(owner)|| ObjectUtil.isEmpty(newTask.getStartBlankDate()) || ObjectUtil.isEmpty(newTask.getBlankDate())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<PlanSubDetailDO> existingTasksForOwner = tasksByOwner.get(owner);
|
||||
if (existingTasksForOwner == null) {
|
||||
continue;
|
||||
}
|
||||
for (PlanSubDetailDO existingTask : existingTasksForOwner) {
|
||||
if (hasOverlap(newTask.getStartBlankDate(), newTask.getBlankDate(), existingTask.getStartTwoDimDate(), existingTask.getTwoDimDate())) {
|
||||
String typeName = "";
|
||||
if ("BLUEPRINT_3D".equals(existingTask.getSubType())){
|
||||
typeName = "3D";
|
||||
}else if ("BLUEPRINT_2D".equals(existingTask.getSubType())){
|
||||
typeName = "2D";
|
||||
}else if ("BLUEPRINT_WORKBLANK".equals(existingTask.getSubType())){
|
||||
typeName = "毛坯";
|
||||
}
|
||||
return CommonResult.success(newTask.getName()+" 毛坯 "+newTask.getStartBlankDate().toString().substring(0,10)+" -"+ newTask.getBlankDate().toString().substring(0,10)+"跟"+existingTask.getName()+" "+typeName+" "+existingTask.getStartTwoDimDate().toString().substring(0,10)+" -"+existingTask.getTwoDimDate().toString().substring(0,10)+"存在交集,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 检查2D任务
|
||||
if (!newTask.isHasSaveIn2DDetail() && newTask.getTwoDimOwner() != null){
|
||||
Long owner = Long.valueOf(newTask.getTwoDimOwner());
|
||||
// 2. 检查 list1 与 list2 之间的时间冲突
|
||||
if (ObjectUtil.isEmpty(owner)|| ObjectUtil.isEmpty(newTask.getStartTwoDimDate()) || ObjectUtil.isEmpty(newTask.getTwoDimDate())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<PlanSubDetailDO> existingTasksForOwner = tasksByOwner.get(owner);
|
||||
if (existingTasksForOwner == null) {
|
||||
continue;
|
||||
}
|
||||
for (PlanSubDetailDO existingTask : existingTasksForOwner) {
|
||||
if (hasOverlap(newTask.getStartTwoDimDate(), newTask.getTwoDimDate(), existingTask.getStartTwoDimDate(), existingTask.getTwoDimDate())) {
|
||||
String typeName = "";
|
||||
if ("BLUEPRINT_3D".equals(existingTask.getSubType())){
|
||||
typeName = "3D";
|
||||
}else if ("BLUEPRINT_2D".equals(existingTask.getSubType())){
|
||||
typeName = "2D";
|
||||
}else if ("BLUEPRINT_WORKBLANK".equals(existingTask.getSubType())){
|
||||
typeName = "毛坯";
|
||||
}
|
||||
return CommonResult.success(newTask.getName()+" 2D "+newTask.getStartTwoDimDate().toString().substring(0,10)+" -"+ newTask.getTwoDimDate().toString().substring(0,10)+"跟"+existingTask.getName()+" "+typeName+" "+existingTask.getStartTwoDimDate().toString().substring(0,10)+" -"+existingTask.getTwoDimDate().toString().substring(0,10)+"存在交集,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 检查3D任务
|
||||
if (!newTask.isHasSaveIn3DDetail() && newTask.getThreeDimOwner() != null){
|
||||
Long owner = Long.valueOf(newTask.getThreeDimOwner());
|
||||
// 2. 检查 list1 与 list2 之间的时间冲突
|
||||
if (ObjectUtil.isEmpty(owner)|| ObjectUtil.isEmpty(newTask.getStartThreeDimDate()) || ObjectUtil.isEmpty(newTask.getThreeDimDate())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<PlanSubDetailDO> existingTasksForOwner = tasksByOwner.get(owner);
|
||||
if (existingTasksForOwner == null) {
|
||||
continue;
|
||||
}
|
||||
for (PlanSubDetailDO existingTask : existingTasksForOwner) {
|
||||
if (hasOverlap(newTask.getStartThreeDimDate(), newTask.getThreeDimDate(), existingTask.getStartTwoDimDate(), existingTask.getTwoDimDate())) {
|
||||
String typeName = "";
|
||||
if ("BLUEPRINT_3D".equals(existingTask.getSubType())){
|
||||
typeName = "3D";
|
||||
}else if ("BLUEPRINT_2D".equals(existingTask.getSubType())){
|
||||
typeName = "2D";
|
||||
}else if ("BLUEPRINT_WORKBLANK".equals(existingTask.getSubType())){
|
||||
typeName = "毛坯";
|
||||
}
|
||||
return CommonResult.success(newTask.getName()+" 3D "+newTask.getStartThreeDimDate().toString().substring(0,10)+" -"+ newTask.getThreeDimDate().toString().substring(0,10)+"跟"+existingTask.getName()+" "+typeName+" "+existingTask.getStartTwoDimDate().toString().substring(0,10)+" -"+existingTask.getTwoDimDate().toString().substring(0,10)+"存在交集,请确认!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,6 +163,6 @@ public class TaskInReportServiceImpl implements TaskInReportService {
|
||||
updateWrapper.eq(TaskDispatchDetailDO::getId, taskInReport.getDispatchDetailId());
|
||||
updateWrapper.set(TaskDispatchDetailDO::getInReportProcess, 1);
|
||||
taskDispatchDetailMapper.update(updateWrapper);
|
||||
return null;
|
||||
return CommonResult.success( true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,3 +86,6 @@ export const deletePlanSub = async (id: number) => {
|
||||
export const exportPlanSub = async (params) => {
|
||||
return await request.download({ url: `/heli/plan-sub/export-excel`, params })
|
||||
}
|
||||
export const verification = async (data) => {
|
||||
return await request.post({ url: `/heli/plan-sub/verification`, data })
|
||||
}
|
||||
|
||||
@ -878,7 +878,7 @@
|
||||
class="!w-265px"
|
||||
v-model="row.twoDimOwner"
|
||||
clearable
|
||||
@change="handleSelectedUser7($index)"
|
||||
@change="handleUser7($index)"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
@ -1551,6 +1551,21 @@ const handleDateChange = async (
|
||||
const timeDiff = Math.abs(date2.getTime() - date1.getTime())
|
||||
const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24))
|
||||
const tianshu = diffDays + 1
|
||||
if (startBlankDate&&blankDate&&ownder){
|
||||
var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs);
|
||||
if (!(newVar==true)){
|
||||
console.log(11)
|
||||
message.error(newVar);
|
||||
if (type == 'end') {
|
||||
rowData[endField] = null
|
||||
} else {
|
||||
rowData[startField] = null
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getSearchRlTs = async (
|
||||
@ -2804,7 +2819,6 @@ const handleSelectedUser6 = async (currentIndex) => {
|
||||
if (!formData.value.projectPlanSubs[currentIndex].startBlankDate) {
|
||||
for (var i = 0; i < formData.value.projectPlanSubs.length; i++) {
|
||||
var item = formData.value.projectPlanSubs[i]
|
||||
console.log(item.blankOwner)
|
||||
if (item.blankOwner != null && item.blankOwner == userId) {
|
||||
if (item.blankDate != null) {
|
||||
if (maxBeginDate == null) {
|
||||
@ -2850,6 +2864,14 @@ const handleSelectedUser6 = async (currentIndex) => {
|
||||
formData.value.projectPlanSubs[currentIndex].startBlankDate = maxDateDO.maxTime
|
||||
}
|
||||
}
|
||||
if (formData.value.projectPlanSubs[currentIndex].blankOwner && formData.value.projectPlanSubs[currentIndex].startBlankDate && formData.value.projectPlanSubs[currentIndex].blankDate) {
|
||||
var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs);
|
||||
if (!(newVar == true)) {
|
||||
message.error(newVar);
|
||||
formData.value.projectPlanSubs[currentIndex].blankOwner = null
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
// 设备型号
|
||||
const handleSelectedequip = (scope, newValue: any) => {
|
||||
@ -2862,7 +2884,7 @@ const handleSelectedequip = (scope, newValue: any) => {
|
||||
}
|
||||
}
|
||||
// 2D负责人
|
||||
const handleSelectedUser7 = async (currentIndex) => {
|
||||
const handleUser7 = async (currentIndex) => {
|
||||
var userId = formData.value.projectPlanSubs[currentIndex].twoDimOwner
|
||||
var maxBeginDate = null
|
||||
if (!formData.value.projectPlanSubs[currentIndex].startTwoDimDate) {
|
||||
@ -2913,6 +2935,14 @@ const handleSelectedUser7 = async (currentIndex) => {
|
||||
formData.value.projectPlanSubs[currentIndex].startTwoDimDate = maxDateDO.maxTime
|
||||
}
|
||||
}
|
||||
if (formData.value.projectPlanSubs[currentIndex].twoDimOwner&&formData.value.projectPlanSubs[currentIndex].startTwoDimDate&&formData.value.projectPlanSubs[currentIndex].twoDimDate){
|
||||
var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs);
|
||||
if (!(newVar==true)){
|
||||
message.error(newVar);
|
||||
formData.value.projectPlanSubs[currentIndex].twoDimOwner = null
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
// 3D负责人
|
||||
const handleSelectedUser8 = async (currentIndex) => {
|
||||
@ -2966,6 +2996,14 @@ const handleSelectedUser8 = async (currentIndex) => {
|
||||
formData.value.projectPlanSubs[currentIndex].startThreeDimDate = maxDateDO.maxTime
|
||||
}
|
||||
}
|
||||
if (formData.value.projectPlanSubs[currentIndex].threeDimOwner&&formData.value.projectPlanSubs[currentIndex].startThreeDimDate&&formData.value.projectPlanSubs[currentIndex].threeDimDate){
|
||||
var newVar = await PlanSubApi.verification(formData.value.projectPlanSubs);
|
||||
if (!(newVar==true)){
|
||||
message.error(newVar);
|
||||
formData.value.projectPlanSubs[currentIndex].threeDimOwner = null
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
// 责任人
|
||||
const handleSelectedUser9 = (currentIndex, newValue: any) => {
|
||||
|
||||
@ -223,6 +223,19 @@ const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
if (queryParams.designDate && typeof queryParams.designDate === 'number') {
|
||||
// 检查是否是合理的时间戳(在1970-01-01之后的时间戳)
|
||||
const timestamp = queryParams.designDate;
|
||||
const dateObj = new Date(timestamp);
|
||||
// 验证日期有效性
|
||||
if (!isNaN(dateObj.getTime())) {
|
||||
const year = dateObj.getFullYear();
|
||||
const month = String(dateObj.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(dateObj.getDate()).padStart(2, '0');
|
||||
queryParams.designDate = `${year}-${month}-${day}`;
|
||||
}
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ProcessDesignApi.getProcessDesignPages(queryParams)
|
||||
|
||||
@ -98,7 +98,7 @@ const categoryList = ref([
|
||||
path: "productionInReport",
|
||||
name: "下料报工",
|
||||
auth: false,
|
||||
imgUrl: "/static/images/productionReport.png",
|
||||
imgUrl: "/static/images/productionInReport.png",
|
||||
defaultImgUrl: "/static/images/approveOrder-default.png",
|
||||
},
|
||||
]);
|
||||
|
||||
@ -196,13 +196,19 @@
|
||||
if (val){
|
||||
length.value = parseFloat(val).toFixed(2)
|
||||
var newPrice = await getCompositionAPI(detailInfo.value.compositionId);
|
||||
console.log(newPrice)
|
||||
console.log(newPrice.price)
|
||||
if (newPrice.price!=detailInfo.value.price){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: '单价有调整,请刷新界面',
|
||||
})
|
||||
}
|
||||
if (matType.value == '1' || matType.value == '3') {
|
||||
if (widht.value > 0 && hight.value > 0) {
|
||||
var rawResult = length.value * widht.value * hight.value * detailInfo.value.density / 1000000;
|
||||
weight.value = rawResult.toFixed(2)
|
||||
var price = weight.value * detailInfo.value.price;
|
||||
// var price = weight.value * detailInfo.value.price;
|
||||
var price = weight.value * newPrice.price;
|
||||
reportPrice.value = price.toFixed(2)
|
||||
}
|
||||
} else if (matType.value=='2'){
|
||||
@ -214,20 +220,37 @@
|
||||
const CONSTANT_FACTOR = 3.14 / 1000000;
|
||||
var rawResult = CONSTANT_FACTOR * radiusSquared * hight.value * detailInfo.value.density;
|
||||
weight.value = rawResult.toFixed(2)
|
||||
var price = weight.value * detailInfo.value.price;
|
||||
// var price = weight.value * detailInfo.value.price;
|
||||
var price = weight.value * newPrice.price;
|
||||
reportPrice.value = price.toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const handleMatTypeChange=(val)=>{
|
||||
if (val){
|
||||
if (val=='2'){
|
||||
widht.value=''
|
||||
}
|
||||
}
|
||||
}
|
||||
const handleWidhtChange =async (val) => {
|
||||
if (val){
|
||||
widht.value=parseFloat(val).toFixed(2)
|
||||
var newPrice = await getCompositionAPI(detailInfo.value.compositionId);
|
||||
if (newPrice.price!=detailInfo.value.price){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: '单价有调整,请刷新界面',
|
||||
})
|
||||
}
|
||||
if (matType.value=='1'||matType.value=='3'){
|
||||
if (length.value>0&&hight.value>0){
|
||||
var rawResult = length.value*widht.value*hight.value*detailInfo.value.density/1000000;
|
||||
weight.value= rawResult.toFixed(2)
|
||||
var price = weight.value * detailInfo.value.price;
|
||||
// var price = weight.value * detailInfo.value.price;
|
||||
var price = weight.value * newPrice.price;
|
||||
reportPrice.value= price.toFixed(2)
|
||||
}
|
||||
}
|
||||
@ -236,11 +259,20 @@
|
||||
const handleHightChange =async (val) => {
|
||||
if (val){
|
||||
hight.value=parseFloat(val).toFixed(2)
|
||||
var newPrice = await getCompositionAPI(detailInfo.value.compositionId);
|
||||
if (newPrice.price!=detailInfo.value.price){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: '单价有调整,请刷新界面',
|
||||
})
|
||||
}
|
||||
if (matType.value=='1'||matType.value=='3'){
|
||||
if (widht.value>0&&length.value>0){
|
||||
var rawResult = length.value*widht.value*hight.value*detailInfo.value.density/1000000;
|
||||
weight.value= rawResult.toFixed(2)
|
||||
var price = weight.value * detailInfo.value.price;
|
||||
// var price = weight.value * detailInfo.value.price;
|
||||
var price = weight.value * newPrice.price;
|
||||
reportPrice.value= price.toFixed(2)
|
||||
}
|
||||
}else if (matType.value=='2') {
|
||||
@ -252,7 +284,8 @@
|
||||
const CONSTANT_FACTOR = 3.14 / 1000000;
|
||||
var rawResult = CONSTANT_FACTOR * radiusSquared * hight.value * detailInfo.value.density;
|
||||
weight.value= rawResult.toFixed(2)
|
||||
var price = weight.value * detailInfo.value.price;
|
||||
// var price = weight.value * detailInfo.value.price;
|
||||
var price = weight.value * newPrice.price;
|
||||
reportPrice.value= price.toFixed(2)
|
||||
}
|
||||
}
|
||||
@ -261,8 +294,17 @@
|
||||
}
|
||||
const handleWeightChange =async (val) => {
|
||||
if (val){
|
||||
var newPrice = await getCompositionAPI(detailInfo.value.compositionId);
|
||||
if (newPrice.price!=detailInfo.value.price){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: '单价有调整,请刷新界面',
|
||||
})
|
||||
}
|
||||
weight.value=parseFloat(val).toFixed(2)
|
||||
var price = weight.value * detailInfo.value.price;
|
||||
// var price = weight.value * detailInfo.value.price;
|
||||
var price = weight.value * newPrice.price;
|
||||
reportPrice.value= price.toFixed(2)
|
||||
}
|
||||
}
|
||||
@ -434,7 +476,7 @@
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>物料类型:</view>
|
||||
<uni-data-select class="val" v-model="matType" clearable
|
||||
:localdata="unitDict" placeholder="请选择物料类型">
|
||||
:localdata="unitDict" placeholder="请选择物料类型" @change="handleMatTypeChange">
|
||||
</uni-data-select>
|
||||
<view class="unit" ></view>
|
||||
</view>
|
||||
@ -446,7 +488,7 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>宽度:</view>
|
||||
<uni-easyinput class="val" type="number" v-model="widht" clearable @change="handleWidhtChange" @clear="onClear('widht')"
|
||||
<uni-easyinput class="val" type="number" v-model="widht" :disabled="matType=='2'" clearable @change="handleWidhtChange" @clear="onClear('widht')"
|
||||
placeholder="请输入宽度"></uni-easyinput>
|
||||
<view class="unit" >mm</view>
|
||||
</view>
|
||||
@ -454,7 +496,7 @@
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>高度:</view>
|
||||
<uni-easyinput class="val" type="number" v-model="hight" clearable @change="handleHightChange" @clear="onClear('hight')"
|
||||
placeholder="请输入高度" :disabled="matType=='2'"></uni-easyinput>
|
||||
placeholder="请输入高度" ></uni-easyinput>
|
||||
<view class="unit" >mm</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
// export const serviceDomain = 'https://nxhs.cjyx.cc'
|
||||
// export const serviceDomain = 'https://star.hz-hl.com'
|
||||
// export const serviceDomain = 'https://star.hz-hl.com'
|
||||
// export const serviceDomain = 'http://222.71.165.187:9010'
|
||||
// export const serviceDomain = 'http://localhost:8080'
|
||||
export const serviceDomain = 'https://nxhs.cjyx.cc'
|
||||
export const serviceDomain = 'http://localhost:8080'
|
||||
// export const serviceDomain = 'https://nxhs.cjyx.cc'
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB |
BIN
mes-ui/mini-app/src/static/images/productionInReport.png
Normal file
BIN
mes-ui/mini-app/src/static/images/productionInReport.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@ -96,7 +96,15 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
||||
loginStore.clearInfo()
|
||||
uni.navigateTo({ url: '/pages/login/login' })
|
||||
reject(res)
|
||||
} else {
|
||||
} else if (res.data?.code === 411){
|
||||
const msg = (res.data as Data<T>).msg
|
||||
uni.showModal({
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
title: msg || '请求错误',
|
||||
})
|
||||
reject(res)
|
||||
}else {
|
||||
const msg = (res.data as Data<T>).msg
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user