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_IS_OVER = new ErrorCode(1_009_007, "报工数量已完成");
|
||||
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 QUALITY_FEEDBACK_NOT_EXISTS = new ErrorCode(1_010_002, "客户反馈质量不存在");
|
||||
|
@ -1,10 +1,9 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
@ -138,6 +138,8 @@ public class TaskDispatchDetailDO extends BaseDO {
|
||||
private String procdureName;
|
||||
@TableField(exist = false)
|
||||
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.taskdispatchdetailowner.TaskDispatchDetailOwnerDO;
|
||||
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 org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -58,6 +59,12 @@ public interface TaskDispatchDetailMapper extends BaseMapperX<TaskDispatchDetail
|
||||
}
|
||||
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) {
|
||||
// 示例:假设传入的时间戳代表 2024 年 2 月 11 日
|
||||
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){
|
||||
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) {
|
||||
wrapper.set("procedure_id", taskDispatchDetailOwnerDO.getProcedureId());
|
||||
}
|
||||
|
@ -568,7 +568,10 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
.ne(TaskReportDO::getAmount, 0);
|
||||
}});
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -587,10 +590,16 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
.ne(TaskReportDO::getAmount, 0);
|
||||
}});
|
||||
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);
|
||||
}
|
||||
if(!taskDispatchDO.getDispatchType().equals("ASSEMBLE") && taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
||||
if( taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){
|
||||
throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS);
|
||||
}
|
||||
}
|
||||
@ -643,37 +652,48 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
|
||||
taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
||||
//装配看看是不是多人,如果是多人,判断一下
|
||||
boolean allReport = true;
|
||||
HashMap<Long,TaskDispatchDetailDO> dispatchDetailDOHashMap = new HashMap<>();
|
||||
|
||||
String msg = "";
|
||||
if (taskDispatchDO.getDispatchType().equals("ASSEMBLE")){
|
||||
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectList(new LambdaQueryWrapperX<TaskDispatchDetailDO>().eq(TaskDispatchDetailDO::getDetailOwnerId, taskDispatchDetailDO.getDetailOwnerId()));
|
||||
List<Long> dispatchDetailId = new ArrayList<>();
|
||||
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectListByDeitalOwnerId(taskDispatchDetailDO.getDetailOwnerId());
|
||||
for (TaskDispatchDetailDO dispatchDetailDO : taskDispatchDetailDOS) {
|
||||
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(dispatchDetailId)){
|
||||
List<HashMap<Long, Long>> hashMaps = taskDispatchDetailMapper.sumAssembleReport(dispatchDetailId);
|
||||
if (CollUtil.isNotEmpty(dispatchDetailDOHashMap)){
|
||||
List<HashMap<Long, Long>> hashMaps = taskDispatchDetailMapper.sumAssembleReport(new ArrayList<>(dispatchDetailDOHashMap.keySet()));
|
||||
HashMap<Long,Long> reportMap = new HashMap<>();
|
||||
for (HashMap<Long, Long> hashMap : hashMaps) {
|
||||
reportMap.putAll(hashMap);
|
||||
reportMap.put(hashMap.get("detailId"),hashMap.get("amount"));
|
||||
}
|
||||
|
||||
for (Long l : dispatchDetailId) {
|
||||
for (Long l : dispatchDetailDOHashMap.keySet()) {
|
||||
if (!reportMap.containsKey(l)){
|
||||
msg = msg + dispatchDetailDOHashMap.get(l).getOwnerName() + ",";
|
||||
allReport = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!msg.equals("")){
|
||||
msg = msg.substring(0,msg.length()-1) + "还没有报工,请确认";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!allReport){
|
||||
throw exception(TASK_REPORT_OTHER_PERSON_NO_SUBMIT);
|
||||
throw exception(new ErrorCode(1_009_019,msg));
|
||||
}
|
||||
if (allReport){
|
||||
TaskDispatchDetailOwnerDO taskDispatchDetailOwnerDO = taskDispatchDetailOwnerMapper.selectById(taskDispatchDetailDO.getDetailOwnerId());
|
||||
taskDispatchDetailOwnerDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode());
|
||||
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(dispatchDetailDOHashMap)){
|
||||
productionList = productionList.stream().filter((e -> !dispatchDetailDOHashMap.keySet().contains(e.getId()))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
for (TaskDispatchDetailDO dispatchDetailDO : productionList) {
|
||||
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) &&
|
||||
dispatchDetailDO.getProcedureStatus() !=TaskDispatchProcedureStatusEnum.COMPLETED.getCode()){
|
||||
if (!dispatchDetailDO.getId().equals(taskDispatchDetailDO.getId()) && dispatchDetailDO.getProcedureStatus() !=TaskDispatchProcedureStatusEnum.COMPLETED.getCode()){
|
||||
|
||||
//如果其他的有未完成的
|
||||
isProjectSubAssembleOver = false;
|
||||
break;
|
||||
@ -718,9 +742,11 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
||||
}
|
||||
}
|
||||
|
||||
if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){
|
||||
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());
|
||||
}
|
||||
// // TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectById(taskDispatchDetailDO.getDispatchId());
|
||||
|
@ -103,7 +103,7 @@
|
||||
GROUP BY t.id
|
||||
</select>
|
||||
<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=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
@ -314,6 +314,7 @@ v-for="dict in userInit" :key="dict.id"
|
||||
readonly
|
||||
:disabled="detailDisabled || row.beginProduce != 0 "
|
||||
@click.prevent="handleClick(row.owners,$index)"
|
||||
:title="row.ownerNames"
|
||||
>
|
||||
<template #append
|
||||
><el-button
|
||||
|
@ -121,7 +121,7 @@ const getList = async () => {
|
||||
loading.value = true
|
||||
// 清除选中状态
|
||||
try {
|
||||
postList.value = [];
|
||||
// postList.value = [];
|
||||
list.value = []
|
||||
var hasSet = new Set;
|
||||
const data = await UserApi.getUserPage(queryParams)
|
||||
@ -150,8 +150,12 @@ const getList = async () => {
|
||||
beforeOwnerList.value.forEach(item =>{
|
||||
list.value.forEach(item1 =>{
|
||||
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)
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -160,13 +164,29 @@ const getList = async () => {
|
||||
}else{
|
||||
total.value = 0
|
||||
}
|
||||
|
||||
hasSet.forEach(item =>{
|
||||
postList.value.push({
|
||||
label:item,
|
||||
value:item
|
||||
})
|
||||
})
|
||||
|
||||
if(!arrayEmpty(multipleSelection.value)){
|
||||
let seenIds = new Set();
|
||||
let uniqueItems = multipleSelection.value.filter(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{
|
||||
list.value = []
|
||||
total.value = 0
|
||||
@ -300,6 +320,15 @@ const faindex =ref()
|
||||
const open = async (owners,index) => {
|
||||
multipleSelection.value=[]
|
||||
console.log(owners)
|
||||
postList.value = []
|
||||
postList.value.push({
|
||||
label:'4',
|
||||
value:'4'
|
||||
})
|
||||
postList.value.push({
|
||||
label:'5',
|
||||
value:'5'
|
||||
})
|
||||
beforeOwnerList.value = owners;
|
||||
faindex.value=index
|
||||
dialogVisible.value = true
|
||||
|
@ -11,28 +11,30 @@ const dictInfo = userStore?.dictInfo || []
|
||||
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
|
||||
const userId = userStore.userInfo.userId
|
||||
|
||||
const isShowStart = computed(() => {
|
||||
let flag = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (!obj?.endTime) {
|
||||
flag = false
|
||||
}
|
||||
}
|
||||
return flag
|
||||
})
|
||||
const isShowEnd = computed(() => {
|
||||
let flag = true
|
||||
if (historyList.value.length) {
|
||||
const obj = historyList.value[0]
|
||||
if (obj?.endTime) {
|
||||
flag = false
|
||||
}
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
return flag
|
||||
})
|
||||
const isShowStart = ref(false)
|
||||
const isShowEnd = ref(false)
|
||||
// const isShowStart = computed(() => {
|
||||
// let flag = true
|
||||
// if (historyList.value.length) {
|
||||
// const obj = historyList.value[0]
|
||||
// if (!obj?.endTime) {
|
||||
// flag = false
|
||||
// }
|
||||
// }
|
||||
// return flag
|
||||
// })
|
||||
// const isShowEnd = computed(() => {
|
||||
// let flag = true
|
||||
// if (historyList.value.length) {
|
||||
// const obj = historyList.value[0]
|
||||
// if (obj?.endTime) {
|
||||
// flag = false
|
||||
// }
|
||||
// } else {
|
||||
// flag = false
|
||||
// }
|
||||
// return flag
|
||||
// })
|
||||
const amount = 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 = '2025-01-13 00:00'
|
||||
})
|
||||
// if (data.list[0]) {
|
||||
// formObj.value = data.list[0]
|
||||
// const time = formObj.value.endTime - formObj.value.startTime //时间差秒
|
||||
// console.log(time)
|
||||
// const leave1 = time % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
|
||||
// workTime.value = Math.floor(leave1 / (3600 * 1000))
|
||||
// }
|
||||
// if (data.list[0]) {
|
||||
// // 将字符串转换为Date对象
|
||||
// formObj.value = data.list[0]
|
||||
// const endTime= new Date(formObj.value.endTimeStr);
|
||||
// const startTime = new Date(formObj.value.startTimeStr);
|
||||
|
||||
// // 计算两个日期之间的毫秒差
|
||||
// const timeDifferenceInMs = endTime - startTime;
|
||||
|
||||
// // 将毫秒差转换为小时
|
||||
// const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||
// const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||
// workTime.value = roundedTimeDifference;
|
||||
// }
|
||||
if (data.list[0]) {
|
||||
// 将字符串转换为Date对象
|
||||
formObj.value = data.list[0]
|
||||
const endTime= new Date(formObj.value.endTimeStr);
|
||||
const startTime = new Date(formObj.value.startTimeStr);
|
||||
// 计算两个日期之间的毫秒差
|
||||
const timeDifferenceInMs = endTime - startTime;
|
||||
|
||||
// 将毫秒差转换为小时
|
||||
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||
if ("Y"==detailInfo.value.isOutsourcing){
|
||||
|
||||
}else {
|
||||
workTime.value = roundedTimeDifference;
|
||||
}
|
||||
|
||||
}
|
||||
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){
|
||||
var totalAmount = detailInfo.value.amount;
|
||||
var beforeAmount = detailInfo.value.totalReportAmount
|
||||
@ -88,6 +104,7 @@ const getData = async () => {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
isLoading.value = false
|
||||
}
|
||||
@ -107,27 +124,28 @@ const getDetailData = async (id) => {
|
||||
data.startTime = formatDate(data.startTime, 'YYYY-MM-DD HH:mm');
|
||||
data.endTime = formatDate(data.endTime, 'YYYY-MM-DD HH:mm'); // 去掉了末尾的空格
|
||||
|
||||
const endTime = new Date(data.endTime);
|
||||
const startTime = new Date(data.startTime);
|
||||
// // 计算两个日期之间的毫秒差
|
||||
const timeDifferenceInMs = endTime - startTime;
|
||||
// // 将毫秒差转换为小时
|
||||
const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||
const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||
workTime.value = roundedTimeDifference;
|
||||
// const endTime = new Date(data.endTime);
|
||||
// const startTime = new Date(data.startTime);
|
||||
// // // 计算两个日期之间的毫秒差
|
||||
// const timeDifferenceInMs = endTime - startTime;
|
||||
// // // 将毫秒差转换为小时
|
||||
// const timeDifferenceInHours = timeDifferenceInMs / (3600 * 1000);
|
||||
// const roundedTimeDifference = parseFloat(timeDifferenceInHours.toFixed(2));
|
||||
// workTime.value = roundedTimeDifference;
|
||||
// 单位枚举
|
||||
const lineObj = unitDictData.find((q) => q.value == data.unit) || {}
|
||||
data.unit = lineObj.label
|
||||
detailInfo.value = data || {}
|
||||
isLoading.value = false
|
||||
}
|
||||
const popupShow = ref(false)
|
||||
onLoad(async (options: any) => {
|
||||
await getDetailData(options.id)
|
||||
await getData()
|
||||
const obj = historyList.value[0]
|
||||
// 最新的报工是否完成
|
||||
if (obj && obj?.workTime == null && obj.endTime) {
|
||||
popup.value?.open()
|
||||
popupShow.value = true
|
||||
}
|
||||
})
|
||||
|
||||
@ -138,8 +156,12 @@ const handleComplate = async () => {
|
||||
id: detailInfo.value?.id,
|
||||
active: 'FINISH',
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
isLoading.value = false
|
||||
try {
|
||||
const data = await postOperateAPI(params);
|
||||
} catch (error) {
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
@ -147,6 +169,7 @@ const handleComplate = async () => {
|
||||
}
|
||||
// 提交报工
|
||||
const handleOk = async (active) => {
|
||||
console.log(amount.value)
|
||||
const params = {
|
||||
id: detailInfo.value?.id,
|
||||
active: 'SUBMIT',
|
||||
@ -178,10 +201,11 @@ const handleStop = async () => {
|
||||
active: 'END',
|
||||
}
|
||||
const data = await postOperateAPI(params)
|
||||
const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
uni.redirectTo({
|
||||
url,
|
||||
})
|
||||
await getData()
|
||||
// const url = `/pages/productionReport/productionReport-detail?id=${detailInfo.value.id}`
|
||||
// uni.redirectTo({
|
||||
// url,
|
||||
// })
|
||||
popup.value?.open()
|
||||
}
|
||||
</script>
|
||||
@ -256,8 +280,8 @@ const handleStop = async () => {
|
||||
</view>
|
||||
</view>
|
||||
<view class="action" v-if="detailInfo.procedureStatus !== 2">
|
||||
<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 start" v-if="isShowStart" @click="handleStart">开始生产</view>
|
||||
<view class="action-item stop" v-if="isShowEnd" @click="handleStop">结束生产</view>
|
||||
<!-- <view class="action-item finish" v-if="isShowFinish" @click="handleComplate">生产完成</view> -->
|
||||
</view>
|
||||
</template>
|
||||
@ -270,20 +294,20 @@ const handleStop = async () => {
|
||||
<view class="cont">
|
||||
<view class="item">
|
||||
<view class="label">开始生产时间:</view>
|
||||
<view class="val">{{ detailInfo.startTime }}</view>
|
||||
<view class="val">{{ formObj.startTimeStr }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">结束生产时间:</view>
|
||||
<view class="val">{{ detailInfo.endTime }}</view>
|
||||
<view class="val">{{ formObj.endTimeStr }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<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>
|
||||
<view class="item">
|
||||
<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>
|
||||
</view>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user