Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
bceffcf10f
@ -109,7 +109,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE = new ErrorCode(1_009_005, "任务不满足操作条件");
|
ErrorCode TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE = new ErrorCode(1_009_005, "任务不满足操作条件");
|
||||||
ErrorCode TASK_DISPATCH_TASK_IS_OVER = new ErrorCode(1_009_007, "报工数量已完成");
|
ErrorCode TASK_DISPATCH_TASK_IS_OVER = new ErrorCode(1_009_007, "报工数量已完成");
|
||||||
ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工");
|
ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工");
|
||||||
ErrorCode TASK_REPORT_OTHER_PERSON_NO_SUBMIT = new ErrorCode(1_009_008, "其他人员尚未报工,无法结束生产");
|
ErrorCode TASK_REPORT_OTHER_PERSON_NO_SUBMIT = new ErrorCode(1_009_020, "其他人员尚未报工,无法结束生产");
|
||||||
/*************质量管理***********/
|
/*************质量管理***********/
|
||||||
ErrorCode UNQUALIFIED_NOTIFICATION_NOT_EXISTS = new ErrorCode(1_010_001, "品质异常通知单审核不存在");
|
ErrorCode UNQUALIFIED_NOTIFICATION_NOT_EXISTS = new ErrorCode(1_010_001, "品质异常通知单审核不存在");
|
||||||
ErrorCode QUALITY_FEEDBACK_NOT_EXISTS = new ErrorCode(1_010_002, "客户反馈质量不存在");
|
ErrorCode QUALITY_FEEDBACK_NOT_EXISTS = new ErrorCode(1_010_002, "客户反馈质量不存在");
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress;
|
package com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
@ -138,6 +138,8 @@ public class TaskDispatchDetailDO extends BaseDO {
|
|||||||
private String procdureName;
|
private String procdureName;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String type;
|
private String type;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String ownerName;
|
||||||
/**
|
/**
|
||||||
* 预计工时
|
* 预计工时
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatch
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -58,6 +59,12 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
|||||||
}
|
}
|
||||||
return dateRange;
|
return dateRange;
|
||||||
}
|
}
|
||||||
|
default List<TaskDispatchDetailDO> selectListByDeitalOwnerId(Long detailOwnerId){
|
||||||
|
MPJLambdaWrapper<TaskDispatchDetailDO> query = new MPJLambdaWrapper<>();
|
||||||
|
query.selectAll(TaskDispatchDetailDO.class)
|
||||||
|
.select("a.nickname as ownerName").leftJoin(AdminUserDO.class,"a",AdminUserDO::getId,TaskDispatchDetailDO::getOwner).eq(TaskDispatchDetailDO::getDetailOwnerId,detailOwnerId);
|
||||||
|
return selectList(query);
|
||||||
|
}
|
||||||
/*public static void main(String[] args) {
|
/*public static void main(String[] args) {
|
||||||
// 示例:假设传入的时间戳代表 2024 年 2 月 11 日
|
// 示例:假设传入的时间戳代表 2024 年 2 月 11 日
|
||||||
LocalDate exampleDate = LocalDate.of(2025, 2, 13);
|
LocalDate exampleDate = LocalDate.of(2025, 2, 13);
|
||||||
@ -133,7 +140,10 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
|||||||
}
|
}
|
||||||
default int updateByOwner(TaskDispatchDetailOwnerDO taskDispatchDetailOwnerDO, Set<String> owner){
|
default int updateByOwner(TaskDispatchDetailOwnerDO taskDispatchDetailOwnerDO, Set<String> owner){
|
||||||
UpdateWrapper<TaskDispatchDetailDO> wrapper = new UpdateWrapper();
|
UpdateWrapper<TaskDispatchDetailDO> wrapper = new UpdateWrapper();
|
||||||
wrapper.eq("detail_owner_id",taskDispatchDetailOwnerDO.getId()).in("owner",owner);
|
wrapper.eq("detail_owner_id",taskDispatchDetailOwnerDO.getId());
|
||||||
|
if (CollUtil.isNotEmpty(owner)){
|
||||||
|
wrapper.in("owner",owner);
|
||||||
|
}
|
||||||
if (taskDispatchDetailOwnerDO.getProcedureId() != null) {
|
if (taskDispatchDetailOwnerDO.getProcedureId() != null) {
|
||||||
wrapper.set("procedure_id", taskDispatchDetailOwnerDO.getProcedureId());
|
wrapper.set("procedure_id", taskDispatchDetailOwnerDO.getProcedureId());
|
||||||
}
|
}
|
||||||
|
@ -568,7 +568,10 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
.ne(TaskReportDO::getAmount, 0);
|
.ne(TaskReportDO::getAmount, 0);
|
||||||
}});
|
}});
|
||||||
int historyReportAmount = historyReportList.stream().mapToInt(TaskReportDO::getAmount).sum();
|
int historyReportAmount = historyReportList.stream().mapToInt(TaskReportDO::getAmount).sum();
|
||||||
if (!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
// if (!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
|
// throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
|
// }
|
||||||
|
if ( taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -587,10 +590,16 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
.ne(TaskReportDO::getAmount, 0);
|
.ne(TaskReportDO::getAmount, 0);
|
||||||
}});
|
}});
|
||||||
int historyReportAmount = historyReportList.stream().mapToInt(TaskReportDO::getAmount).sum();
|
int historyReportAmount = historyReportList.stream().mapToInt(TaskReportDO::getAmount).sum();
|
||||||
if (!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
// if (!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
|
// throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
|
// }
|
||||||
|
// if(!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
||||||
|
// throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
||||||
|
// }
|
||||||
|
if ( taskDispatchDetailDO.getAmount() <= historyReportAmount){
|
||||||
throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
throw exception(TASK_DISPATCH_TASK_IS_OVER);
|
||||||
}
|
}
|
||||||
if(!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
if( taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
||||||
throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -643,37 +652,48 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
|
|
||||||
taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
||||||
//装配看看是不是多人,如果是多人,判断一下
|
//装配看看是不是多人,如果是多人,判断一下
|
||||||
|
boolean allReport = true;
|
||||||
|
HashMap<Long,TaskDispatchDetailDO> dispatchDetailDOHashMap = new HashMap<>();
|
||||||
|
|
||||||
|
String msg = "";
|
||||||
if (taskDispatchDO.getDispatchType().equals("ASSEMBLE")){
|
if (taskDispatchDO.getDispatchType().equals("ASSEMBLE")){
|
||||||
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectList(new LambdaQueryWrapperX<TaskDispatchDetailDO>().eq(TaskDispatchDetailDO::getDetailOwnerId, taskDispatchDetailDO.getDetailOwnerId()));
|
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectListByDeitalOwnerId(taskDispatchDetailDO.getDetailOwnerId());
|
||||||
List<Long> dispatchDetailId = new ArrayList<>();
|
|
||||||
for (TaskDispatchDetailDO dispatchDetailDO : taskDispatchDetailDOS) {
|
for (TaskDispatchDetailDO dispatchDetailDO : taskDispatchDetailDOS) {
|
||||||
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) && !(dispatchDetailDO.getProcedureStatus() == TaskDispatchProcedureStatusEnum.COMPLETED.getCode())){
|
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) && !(dispatchDetailDO.getProcedureStatus() == TaskDispatchProcedureStatusEnum.COMPLETED.getCode())){
|
||||||
dispatchDetailId.add(dispatchDetailDO.getId());
|
dispatchDetailDOHashMap.put(dispatchDetailDO.getId(),dispatchDetailDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean allReport = true;
|
if (CollUtil.isNotEmpty(dispatchDetailDOHashMap)){
|
||||||
if (CollUtil.isNotEmpty(dispatchDetailId)){
|
List<HashMap<Long, Long>> hashMaps = taskDispatchDetailMapper.sumAssembleReport(new ArrayList<>(dispatchDetailDOHashMap.keySet()));
|
||||||
List<HashMap<Long, Long>> hashMaps = taskDispatchDetailMapper.sumAssembleReport(dispatchDetailId);
|
|
||||||
HashMap<Long,Long> reportMap = new HashMap<>();
|
HashMap<Long,Long> reportMap = new HashMap<>();
|
||||||
for (HashMap<Long, Long> hashMap : hashMaps) {
|
for (HashMap<Long, Long> hashMap : hashMaps) {
|
||||||
reportMap.putAll(hashMap);
|
reportMap.put(hashMap.get("detailId"),hashMap.get("amount"));
|
||||||
}
|
}
|
||||||
|
for (Long l : dispatchDetailDOHashMap.keySet()) {
|
||||||
for (Long l : dispatchDetailId) {
|
|
||||||
if (!reportMap.containsKey(l)){
|
if (!reportMap.containsKey(l)){
|
||||||
|
msg = msg + dispatchDetailDOHashMap.get(l).getOwnerName() + ",";
|
||||||
allReport = false;
|
allReport = false;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!msg.equals("")){
|
||||||
|
msg = msg.substring(0,msg.length()-1) + "还没有报工,请确认";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allReport){
|
if (!allReport){
|
||||||
throw exception(TASK_REPORT_OTHER_PERSON_NO_SUBMIT);
|
throw exception(new ErrorCode(1_009_019,msg));
|
||||||
}
|
}
|
||||||
if (allReport){
|
if (allReport){
|
||||||
TaskDispatchDetailOwnerDO taskDispatchDetailOwnerDO = taskDispatchDetailOwnerMapper.selectById(taskDispatchDetailDO.getDetailOwnerId());
|
TaskDispatchDetailOwnerDO taskDispatchDetailOwnerDO = taskDispatchDetailOwnerMapper.selectById(taskDispatchDetailDO.getDetailOwnerId());
|
||||||
taskDispatchDetailOwnerDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
taskDispatchDetailOwnerDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
||||||
taskDispatchDetailOwnerMapper.updateById(taskDispatchDetailOwnerDO);
|
taskDispatchDetailOwnerMapper.updateById(taskDispatchDetailOwnerDO);
|
||||||
|
TaskDispatchDetailOwnerDO ownerDO = new TaskDispatchDetailOwnerDO();
|
||||||
|
ownerDO.setId(taskDispatchDetailOwnerDO.getId());
|
||||||
|
ownerDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
||||||
|
taskDispatchDetailMapper.updateByOwner(ownerDO,null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//子项目装配是否完成
|
//子项目装配是否完成
|
||||||
@ -700,9 +720,13 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(productionList)){
|
if (CollUtil.isNotEmpty(productionList)){
|
||||||
|
if (CollUtil.isNotEmpty(dispatchDetailDOHashMap)){
|
||||||
|
productionList = productionList.stream().filter((e -> !dispatchDetailDOHashMap.keySet().contains(e.getId()))).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
for (TaskDispatchDetailDO dispatchDetailDO : productionList) {
|
for (TaskDispatchDetailDO dispatchDetailDO : productionList) {
|
||||||
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) &&
|
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) && dispatchDetailDO.getProcedureStatus() !=TaskDispatchProcedureStatusEnum.COMPLETED.getCode()){
|
||||||
dispatchDetailDO.getProcedureStatus() !=TaskDispatchProcedureStatusEnum.COMPLETED.getCode()){
|
|
||||||
//如果其他的有未完成的
|
//如果其他的有未完成的
|
||||||
isProjectSubAssembleOver = false;
|
isProjectSubAssembleOver = false;
|
||||||
break;
|
break;
|
||||||
@ -718,9 +742,11 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
|||||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){
|
if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){
|
||||||
pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId());
|
pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId());
|
||||||
}else if (taskDispatchDO.getDispatchType().equals("ASSEMBLE") && isProjectSubAssembleOver){
|
}else if (taskDispatchDO.getDispatchType().equals("ASSEMBLE") && isProjectSubAssembleOver ){
|
||||||
|
|
||||||
zjPgMasterService.insertZjList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getProjectSubId());
|
zjPgMasterService.insertZjList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getProjectSubId());
|
||||||
}
|
}
|
||||||
// // TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectById(taskDispatchDetailDO.getDispatchId());
|
// // TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectById(taskDispatchDetailDO.getDispatchId());
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
GROUP BY t.id
|
GROUP BY t.id
|
||||||
</select>
|
</select>
|
||||||
<select id="sumAssembleReport" parameterType="java.util.List">
|
<select id="sumAssembleReport" parameterType="java.util.List">
|
||||||
select t.dispatch_detail_id,count(t.id) from pro_task_report t where t.dispatch_detail_id in
|
select t.dispatch_detail_id as detailId,count(t.id) as amount from pro_task_report t where t.dispatch_detail_id in
|
||||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
@ -314,6 +314,7 @@ v-for="dict in userInit" :key="dict.id"
|
|||||||
readonly
|
readonly
|
||||||
:disabled="detailDisabled || row.beginProduce != 0 "
|
:disabled="detailDisabled || row.beginProduce != 0 "
|
||||||
@click.prevent="handleClick(row.owners,$index)"
|
@click.prevent="handleClick(row.owners,$index)"
|
||||||
|
:title="row.ownerNames"
|
||||||
>
|
>
|
||||||
<template #append
|
<template #append
|
||||||
><el-button
|
><el-button
|
||||||
|
@ -121,7 +121,7 @@ const getList = async () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
// 清除选中状态
|
// 清除选中状态
|
||||||
try {
|
try {
|
||||||
postList.value = [];
|
// postList.value = [];
|
||||||
list.value = []
|
list.value = []
|
||||||
var hasSet = new Set;
|
var hasSet = new Set;
|
||||||
const data = await UserApi.getUserPage(queryParams)
|
const data = await UserApi.getUserPage(queryParams)
|
||||||
@ -150,8 +150,12 @@ const getList = async () => {
|
|||||||
beforeOwnerList.value.forEach(item =>{
|
beforeOwnerList.value.forEach(item =>{
|
||||||
list.value.forEach(item1 =>{
|
list.value.forEach(item1 =>{
|
||||||
if(item == item1.id){
|
if(item == item1.id){
|
||||||
multipleSelection.value.push(item1);
|
var id = multipleSelection.value. some(item2 => item2.id === item)
|
||||||
|
if(!id){
|
||||||
|
multipleSelection.value.push(item1);
|
||||||
|
}
|
||||||
multipleTable.value.toggleRowSelection(item1, true)
|
multipleTable.value.toggleRowSelection(item1, true)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -160,13 +164,29 @@ const getList = async () => {
|
|||||||
}else{
|
}else{
|
||||||
total.value = 0
|
total.value = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
hasSet.forEach(item =>{
|
if(!arrayEmpty(multipleSelection.value)){
|
||||||
postList.value.push({
|
let seenIds = new Set();
|
||||||
label:item,
|
let uniqueItems = multipleSelection.value.filter(item => {
|
||||||
value:item
|
// 如果 id 已经出现过,返回 false,否则返回 true
|
||||||
})
|
if (seenIds.has(item.id)) {
|
||||||
})
|
return false;
|
||||||
|
} else {
|
||||||
|
seenIds.add(item.id);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
multipleSelection.value = uniqueItems
|
||||||
|
}
|
||||||
|
// if(arrayEmpty(postList.value)){
|
||||||
|
// hasSet.forEach(item =>{
|
||||||
|
// postList.value.push({
|
||||||
|
// label:item,
|
||||||
|
// value:item
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
list.value = []
|
list.value = []
|
||||||
total.value = 0
|
total.value = 0
|
||||||
@ -300,6 +320,15 @@ const faindex =ref()
|
|||||||
const open = async (owners,index) => {
|
const open = async (owners,index) => {
|
||||||
multipleSelection.value=[]
|
multipleSelection.value=[]
|
||||||
console.log(owners)
|
console.log(owners)
|
||||||
|
postList.value = []
|
||||||
|
postList.value.push({
|
||||||
|
label:'4',
|
||||||
|
value:'4'
|
||||||
|
})
|
||||||
|
postList.value.push({
|
||||||
|
label:'5',
|
||||||
|
value:'5'
|
||||||
|
})
|
||||||
beforeOwnerList.value = owners;
|
beforeOwnerList.value = owners;
|
||||||
faindex.value=index
|
faindex.value=index
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
@ -11,28 +11,30 @@ const dictInfo = userStore?.dictInfo || []
|
|||||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||||
const userId = userStore.userInfo.userId
|
const userId = userStore.userInfo.userId
|
||||||
|
|
||||||
const isShowStart = computed(() => {
|
const isShowStart = ref(false)
|
||||||
let flag = true
|
const isShowEnd = ref(false)
|
||||||
if (historyList.value.length) {
|
// const isShowStart = computed(() => {
|
||||||
const obj = historyList.value[0]
|
// let flag = true
|
||||||
if (!obj?.endTime) {
|
// if (historyList.value.length) {
|
||||||
flag = false
|
// const obj = historyList.value[0]
|
||||||
}
|
// if (!obj?.endTime) {
|
||||||
}
|
// flag = false
|
||||||
return flag
|
// }
|
||||||
})
|
// }
|
||||||
const isShowEnd = computed(() => {
|
// return flag
|
||||||
let flag = true
|
// })
|
||||||
if (historyList.value.length) {
|
// const isShowEnd = computed(() => {
|
||||||
const obj = historyList.value[0]
|
// let flag = true
|
||||||
if (obj?.endTime) {
|
// if (historyList.value.length) {
|
||||||
flag = false
|
// const obj = historyList.value[0]
|
||||||
}
|
// if (obj?.endTime) {
|
||||||
} else {
|
// flag = false
|
||||||
flag = false
|
// }
|
||||||
}
|
// } else {
|
||||||
return flag
|
// flag = false
|
||||||
})
|
// }
|
||||||
|
// return flag
|
||||||
|
// })
|
||||||
const amount = ref(null)
|
const amount = ref(null)
|
||||||
const workTime = ref(null)
|
const workTime = ref(null)
|
||||||
// 详情数据
|
// 详情数据
|
||||||
@ -56,28 +58,42 @@ const getData = async () => {
|
|||||||
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
|
||||||
// e.endTimeStr = '2025-01-13 00:00'
|
// e.endTimeStr = '2025-01-13 00:00'
|
||||||
})
|
})
|
||||||
// if (data.list[0]) {
|
if (data.list[0]) {
|
||||||
// formObj.value = data.list[0]
|
// 将字符串转换为Date对象
|
||||||
// const time = formObj.value.endTime - formObj.value.startTime //时间差秒
|
formObj.value = data.list[0]
|
||||||
// console.log(time)
|
const endTime= new Date(formObj.value.endTimeStr);
|
||||||
// const leave1 = time % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
|
const startTime = new Date(formObj.value.startTimeStr);
|
||||||
// workTime.value = Math.floor(leave1 / (3600 * 1000))
|
// 计算两个日期之间的毫秒差
|
||||||
// }
|
const timeDifferenceInMs = endTime - startTime;
|
||||||
// if (data.list[0]) {
|
|
||||||
// // 将字符串转换为Date对象
|
// 将毫秒差转换为小时
|
||||||
// formObj.value = data.list[0]
|
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||||
// const endTime= new Date(formObj.value.endTimeStr);
|
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||||
// const startTime = new Date(formObj.value.startTimeStr);
|
if ("Y"==detailInfo.value.isOutsourcing){
|
||||||
|
|
||||||
// // 计算两个日期之间的毫秒差
|
}else {
|
||||||
// const timeDifferenceInMs = endTime - startTime;
|
workTime.value = roundedTimeDifference;
|
||||||
|
}
|
||||||
// // 将毫秒差转换为小时
|
|
||||||
// const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
}
|
||||||
// const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
|
||||||
// workTime.value = roundedTimeDifference;
|
|
||||||
// }
|
|
||||||
historyList.value = data.list
|
historyList.value = data.list
|
||||||
|
isShowEnd.value = true;
|
||||||
|
isShowStart.value = true
|
||||||
|
if (historyList.value.length) {
|
||||||
|
const obj = historyList.value[0]
|
||||||
|
console.log('s')
|
||||||
|
if (!obj?.amount) {
|
||||||
|
isShowStart.value= false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (historyList.value.length) {
|
||||||
|
const obj = historyList.value[0]
|
||||||
|
if (obj?.amount) {
|
||||||
|
isShowEnd.value = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
isShowEnd.value = false
|
||||||
|
}
|
||||||
if(historyList.value!=null&&historyList.value.length>0){
|
if(historyList.value!=null&&historyList.value.length>0){
|
||||||
var totalAmount = detailInfo.value.amount;
|
var totalAmount = detailInfo.value.amount;
|
||||||
var beforeAmount = detailInfo.value.totalReportAmount
|
var beforeAmount = detailInfo.value.totalReportAmount
|
||||||
@ -88,6 +104,7 @@ const getData = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
@ -107,27 +124,28 @@ const getDetailData = async (id) => {
|
|||||||
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD HH:mm');
|
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD HH:mm');
|
||||||
data.endTime = formatDate(data.endTime, 'YYYY-MM-DD HH:mm'); // 去掉了末尾的空格
|
data.endTime = formatDate(data.endTime, 'YYYY-MM-DD HH:mm'); // 去掉了末尾的空格
|
||||||
|
|
||||||
const endTime = new Date(data.endTime);
|
// const endTime = new Date(data.endTime);
|
||||||
const startTime = new Date(data.startTime);
|
// const startTime = new Date(data.startTime);
|
||||||
// // 计算两个日期之间的毫秒差
|
// // // 计算两个日期之间的毫秒差
|
||||||
const timeDifferenceInMs = endTime - startTime;
|
// const timeDifferenceInMs = endTime - startTime;
|
||||||
// // 将毫秒差转换为小时
|
// // // 将毫秒差转换为小时
|
||||||
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
// const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||||
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
// const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||||
workTime.value = roundedTimeDifference;
|
// workTime.value = roundedTimeDifference;
|
||||||
// 单位枚举
|
// 单位枚举
|
||||||
const lineObj = unitDictData.find((q) => q.value == data.unit) || {}
|
const lineObj = unitDictData.find((q) => q.value == data.unit) || {}
|
||||||
data.unit = lineObj.label
|
data.unit = lineObj.label
|
||||||
detailInfo.value = data || {}
|
detailInfo.value = data || {}
|
||||||
isLoading.value = false
|
isLoading.value = false
|
||||||
}
|
}
|
||||||
|
const popupShow = ref(false)
|
||||||
onLoad(async (options: any) => {
|
onLoad(async (options: any) => {
|
||||||
await getDetailData(options.id)
|
await getDetailData(options.id)
|
||||||
await getData()
|
await getData()
|
||||||
const obj = historyList.value[0]
|
const obj = historyList.value[0]
|
||||||
// 最新的报工是否完成
|
// 最新的报工是否完成
|
||||||
if (obj && obj?.workTime == null && obj.endTime) {
|
if (obj && obj?.workTime == null && obj.endTime) {
|
||||||
popup.value?.open()
|
popupShow.value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -138,8 +156,12 @@ const handleComplate = async () => {
|
|||||||
id: detailInfo.value?.id,
|
id: detailInfo.value?.id,
|
||||||
active: 'FINISH',
|
active: 'FINISH',
|
||||||
}
|
}
|
||||||
const data = await postOperateAPI(params)
|
try {
|
||||||
isLoading.value = false
|
const data = await postOperateAPI(params);
|
||||||
|
} catch (error) {
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url,
|
url,
|
||||||
@ -147,6 +169,7 @@ const handleComplate = async () => {
|
|||||||
}
|
}
|
||||||
// 提交报工
|
// 提交报工
|
||||||
const handleOk = async (active) => {
|
const handleOk = async (active) => {
|
||||||
|
console.log(amount.value)
|
||||||
const params = {
|
const params = {
|
||||||
id: detailInfo.value?.id,
|
id: detailInfo.value?.id,
|
||||||
active: 'SUBMIT',
|
active: 'SUBMIT',
|
||||||
@ -178,10 +201,11 @@ const handleStop = async () => {
|
|||||||
active: 'END',
|
active: 'END',
|
||||||
}
|
}
|
||||||
const data = await postOperateAPI(params)
|
const data = await postOperateAPI(params)
|
||||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
await getData()
|
||||||
uni.redirectTo({
|
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||||
url,
|
// uni.redirectTo({
|
||||||
})
|
// url,
|
||||||
|
// })
|
||||||
popup.value?.open()
|
popup.value?.open()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -256,8 +280,8 @@ const handleStop = async () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="action" v-if="detailInfo.procedureStatus !== 2">
|
<view class="action" v-if="detailInfo.procedureStatus !== 2">
|
||||||
<view class="action-item start" v-if="isShowStart" @click="handleStart">开始生产</view>
|
<view class="action-item start" v-if="isShowStart" @click="handleStart">开始生产</view>
|
||||||
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
||||||
<!-- <view class="action-item finish" v-if="isShowFinish" @click="handleComplate">生产完成</view> -->
|
<!-- <view class="action-item finish" v-if="isShowFinish" @click="handleComplate">生产完成</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -270,20 +294,20 @@ const handleStop = async () => {
|
|||||||
<view class="cont">
|
<view class="cont">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label">开始生产时间:</view>
|
<view class="label">开始生产时间:</view>
|
||||||
<view class="val">{{ detailInfo.startTime }}</view>
|
<view class="val">{{ formObj.startTimeStr }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label">结束生产时间:</view>
|
<view class="label">结束生产时间:</view>
|
||||||
<view class="val">{{ detailInfo.endTime }}</view>
|
<view class="val">{{ formObj.endTimeStr }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
<view class="label"><span class="star">*</span>本次报工工时:</view>
|
||||||
<uni-easyinput class="val" type="digit" v-model="amount" placeholder="请输入本次报工工时"></uni-easyinput>
|
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>
|
||||||
<view class="unit">时</view>
|
<view class="unit">时</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
<view class="label"><span class="star">*</span>本次报工数量:</view>
|
||||||
<uni-easyinput class="val" type="number" v-model="workTime" placeholder="请输入本次报工数量"></uni-easyinput>
|
<uni-easyinput class="val" type="number" v-model="amount" placeholder="请输入本次报工数量"></uni-easyinput>
|
||||||
<view class="unit"> {{ detailInfo.unit }}</view>
|
<view class="unit"> {{ detailInfo.unit }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user