过程检和终检增加管控,报工不能为空

This commit is contained in:
think 2025-01-14 11:27:28 +08:00
parent d6b7f2316f
commit 595315b149
5 changed files with 53 additions and 26 deletions

View File

@ -103,6 +103,7 @@ public interface ErrorCodeConstants {
ErrorCode TASK_REPORT_PARAMS_ERRORBG = new ErrorCode(1_009_009, "开始报工和结束报工操作人员不同,无法报工");
ErrorCode TASK_REPORT_PARAMS_ERRORJD = new ErrorCode(1_009_010, "报工进度不能超过100%");
ErrorCode TASK_REPORT_PARAMS_ERRORSJBG = new ErrorCode(1_009_011, "报工进度不能小于上次报工进度");
ErrorCode TASK_DISPATCH_TASK_NOT_EXISTS = new ErrorCode(1_009_004, "任务不存在或已完成");
ErrorCode TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE = new ErrorCode(1_009_005, "任务不满足操作条件");
ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工");

View File

@ -38,6 +38,10 @@ public class BgMasterLineServiceImpl implements BgMasterLineService {
//结束本次报工
@Override
public Integer updateBgMasterLines(BgMasterLineSaveReqVO createReqVO){
if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){
throw exception(TASK_REPORT_PARAMS_ERROR);
}
//先取出总的派工数量和预计工时
PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(createReqVO.getZjMxId());
//然后再取出这条ID明细ID下的所有工时和报工数量相加

View File

@ -50,6 +50,9 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService {
//结束本次报工
@Override
public Integer updateBgMasterLines(ZjBgMasterLineSaveReqVO createReqVO){
if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){
throw exception(TASK_REPORT_PARAMS_ERROR);
}
//先取出总的派工数量和预计工时
ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(createReqVO.getZjMxId());
//然后再取出这条ID明细ID下的所有工时和报工数量相加

View File

@ -113,17 +113,26 @@ const handleComplate = async () => {
}
//
const handleOk = async (active) => {
const params = {
zjMxId: detailInfo.value?.id,
amount: amount.value,
workTime: workTime.value,
bgUser: userId,
}
const data = await postOperateAPIEnd(params)
const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
uni.redirectTo({
url,
})
if(amount.value>0&&workTime.value>0){
const params = {
zjMxId: detailInfo.value?.id,
amount: amount.value,
workTime: workTime.value,
bgUser: userId,
}
const data = await postOperateAPIEnd(params)
const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}`
uni.redirectTo({
url,
})
}else{
uni.showToast({
title: '报工数量或报工时间必须大于0请检查',
icon: 'none', // iconnone
duration: 2000
});
}
}
//
const handleStart = async () => {
@ -248,14 +257,14 @@ const handleStop = async () => {
<!-- <view class="close" @click="handleClose">X</view> -->
</view>
<view class="cont">
<view class="item">
<!-- <view class="item">
<view class="label">过程检开始时间</view>
<view class="val">{{ formObj.startTime }}</view>
</view>
<view class="item">
<view class="label">过程检结束时间</view>
<view class="val">{{ formObj.endTime }}</view>
</view>
</view> -->
<view class="item">
<view class="label"><span class="star">*</span>本次报工工时</view>
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>

View File

@ -113,17 +113,27 @@ const handleComplate = async () => {
}
//
const handleOk = async (active) => {
const params = {
zjMxId: detailInfo.value?.id,
amount: amount.value,
workTime: workTime.value,
bgUser: userId,
}
const data = await postOperateAPIEnd(params)
const url = `/pages/zjPgMaster/zjPgMaster-detail?id=${detailInfo.value.id}`
uni.redirectTo({
url,
})
if(amount.value>0&&workTime.value>0){
const params = {
zjMxId: detailInfo.value?.id,
amount: amount.value,
workTime: workTime.value,
bgUser: userId,
}
const data = await postOperateAPIEnd(params)
const url = `/pages/zjPgMaster/zjPgMaster-detail?id=${detailInfo.value.id}`
uni.redirectTo({
url,
})
}else{
uni.showToast({
title: '报工数量或报工时间必须大于0请检查',
icon: 'none', // iconnone
duration: 2000
});
}
}
//
const handleStart = async () => {
@ -259,14 +269,14 @@ const handleStop = async () => {
<!-- <view class="close" @click="handleClose">X</view> -->
</view>
<view class="cont">
<view class="item">
<!-- <view class="item">
<view class="label">终检开始时间</view>
<view class="val">{{ formObj.startTime }}</view>
</view>
<view class="item">
<view class="label">终检结束时间</view>
<view class="val">{{ formObj.endTime }}</view>
</view>
</view> -->
<view class="item">
<view class="label"><span class="star">*</span>本次报工工时</view>
<uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>