1.过程检、终检 都生成两条数据修正(添加转圈)

6、下一页 提示  是否保存
6、派工单详情 显示信息错误没有转换
7、 移动端 报工 增加下一个工序
This commit is contained in:
Ledo 2025-05-06 22:48:05 +08:00
parent a1dfeda855
commit 95a2d2d783
8 changed files with 110 additions and 28 deletions

View File

@ -174,5 +174,7 @@ public class TaskDispatchDetailDO extends BaseDO {
private String workerId; private String workerId;
@TableField(exist = false) @TableField(exist = false)
private String workerName; private String workerName;
@TableField(exist = false)
private String nextProcedureName;
} }

View File

@ -60,6 +60,7 @@ public class PgMasterServiceImpl implements PgMasterService {
@Override @Override
public Boolean insertPgList(Long task_id,Long project_id,Long bomMxId){ public Boolean insertPgList(Long task_id,Long project_id,Long bomMxId){
//213 605
//查询BOM明细 //查询BOM明细
List<ProcessBomDO> processBomDOList = processBomMapper.selectBomMx(task_id,project_id,bomMxId); List<ProcessBomDO> processBomDOList = processBomMapper.selectBomMx(task_id,project_id,bomMxId);
List<PgMasterLineDO> pgMasterLineDOList = new ArrayList<>(); List<PgMasterLineDO> pgMasterLineDOList = new ArrayList<>();

View File

@ -15,6 +15,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthing
import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
@ -24,6 +25,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMappe
import com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture.EquipManufactureMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture.EquipManufactureMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.fpuserdetail.FpUserDetailMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.procedure.ProcedureMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper; 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.dal.mysql.taskdispatch.TaskDispatchMapper;
@ -86,6 +88,8 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
private PgMasterService pgMasterService; private PgMasterService pgMasterService;
@Resource @Resource
private bdgzsomthingMapper bdgzsomthingMapper; private bdgzsomthingMapper bdgzsomthingMapper;
@Resource
private ProcedureMapper procedureMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) { public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) {
@ -358,6 +362,30 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
postIds.add(fpUserDetailDO.getPostId()); postIds.add(fpUserDetailDO.getPostId());
} }
PageResult<TaskDispatchDetailDO> taskDispatchDetailDOPageResult = taskDispatchDetailMapper.selectPageWx(pageReqVO, postIds); PageResult<TaskDispatchDetailDO> taskDispatchDetailDOPageResult = taskDispatchDetailMapper.selectPageWx(pageReqVO, postIds);
List<TaskDispatchDetailDO> list = taskDispatchDetailDOPageResult.getList();
HashMap<Long, String> hashMap = new HashMap<>();
if (CollUtil.isNotEmpty(list)){
for (TaskDispatchDetailDO taskDispatchDetailDO : list) {
List<TaskDispatchDetailDO> taskDispatchDetailDOS = taskDispatchDetailMapper.selectList(new LambdaQueryWrapperX<TaskDispatchDetailDO>()
.eq(TaskDispatchDetailDO::getDispatchId, taskDispatchDetailDO.getDispatchId())
.eq(TaskDispatchDetailDO::getSort, taskDispatchDetailDO.getSort() + 1));
if (CollUtil.isNotEmpty(taskDispatchDetailDOS)){
TaskDispatchDetailDO taskDispatchDetailDO1 = taskDispatchDetailDOS.get(0);
Long procedureId = taskDispatchDetailDO1.getProcedureId();
if (hashMap.get(procedureId)==null){
ProcedureDO procedureDO = procedureMapper.selectById(procedureId);
if (procedureDO != null){
hashMap.put(procedureId, procedureDO.getName());
taskDispatchDetailDO.setNextProcedureName(procedureDO.getName());
}
}else{
taskDispatchDetailDO.setNextProcedureName(hashMap.get(procedureId));
}
}
}
//非空遍历找下一道工序Id
}
return taskDispatchDetailDOPageResult; return taskDispatchDetailDOPageResult;
} }
@Override @Override

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog v-model="dialogVisible" :before-close="handleClose" title="编辑页" style="width: 70%"> <Dialog v-model="dialogVisible" :before-close="handleClose" :title="totalTital" style="width: 70%">
<el-card class="hl-card"> <el-card class="hl-card">
<el-form ref="formRef" label-width="140px" :rules="formRules" :model="formData" v-loading="formLoading"> <el-form ref="formRef" label-width="140px" :rules="formRules" :model="formData" v-loading="formLoading">
<!-- 基础信息 横向布局 --> <!-- 基础信息 横向布局 -->
@ -516,6 +516,7 @@ import {
ElButton ElButton
} from 'element-plus'; } from 'element-plus';
import { error } from 'console'; import { error } from 'console';
import { title } from 'process';
const centerDialogVisible = ref(false); const centerDialogVisible = ref(false);
const queryParams = { const queryParams = {
pageNo: 1, pageNo: 1,
@ -550,7 +551,7 @@ const active = toRef(commonStore.getStore('active'))
const currentId = toRef(commonStore.getStore('id')) const currentId = toRef(commonStore.getStore('id'))
const dispatchType = toRef(commonStore.getStore("dispatchType")); const dispatchType = toRef(commonStore.getStore("dispatchType"));
const totalTital = ref('')
const formLoading = ref(false) const formLoading = ref(false)
const dialogTitle = ref('') const dialogTitle = ref('')
const detailDisabled = ref(false) const detailDisabled = ref(false)
@ -860,8 +861,10 @@ const open = async (id ,actives,dispatchParamss,ownerId,taskCode) => {
dispatchParams.value.taskCode = taskCode; dispatchParams.value.taskCode = taskCode;
dispatchParams.value.id = id; dispatchParams.value.id = id;
active.value = actives; active.value = actives;
totalTital.value = '编辑页'
if ('detail' == actives) { if ('detail' == actives) {
detailDisabled.value = true detailDisabled.value = true
totalTital.value = '详情页'
} }
queryData(id) queryData(id)
fetchAllProcedurePages(); fetchAllProcedurePages();
@ -870,6 +873,14 @@ const open = async (id ,actives,dispatchParamss,ownerId,taskCode) => {
const showNext = ref(0) const showNext = ref(0)
const showBefore = ref(0) const showBefore = ref(0)
const nextItem = async (type) => { const nextItem = async (type) => {
if(formData.value.dispatchStatus == 1 && !(!formData.value.taskDispatchDetails || formData.value.taskDispatchDetails.length == 0)){
ElMessageBox.confirm('单据尚未保存,是否保存?',{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
.then( async() => {
await submitForm('SAVE')
dispatchParams.value.pageType = type; dispatchParams.value.pageType = type;
try{ try{
const data = await getTaskDispatchList() const data = await getTaskDispatchList()
@ -896,7 +907,39 @@ const nextItem = async (type) => {
}catch(error){ }catch(error){
console.log(error); console.log(error);
} }
console.log(tsk_id.value) })
.catch(() => {
})
}else{
dispatchParams.value.pageType = type;
try{
const data = await getTaskDispatchList()
dispatchlist.value = data;
if(dispatchlist.value != null){
tsk_id.value = dispatchlist.value[0].id;
dispatchParams.value.id = tsk_id.value;
if(dispatchlist.value.length == 2){
showBefore.value = 0;
showNext.value = 0;
}else{
if(type == 1){
showNext.value = 0;
showBefore.value = 1;
}else{
showNext.value = 1;
showBefore.value = 0;
}
}
}
queryData(tsk_id.value)
fetchAllProcedurePages();
}catch(error){
console.log(error);
}
}
// tsk_id.value = id; // tsk_id.value = id;
// if(type == 1){ // if(type == 1){
// for(var i = 0 ; i <dispatchlist.value.length;i++){ // for(var i = 0 ; i <dispatchlist.value.length;i++){
@ -1137,12 +1180,14 @@ const submitForm = async (operate) => {
if( formData.value.taskDispatchDetails[i].postId == undefined || formData.value.taskDispatchDetails[i].postId == null ||formData.value.taskDispatchDetails[i].postId == ''){ if( formData.value.taskDispatchDetails[i].postId == undefined || formData.value.taskDispatchDetails[i].postId == null ||formData.value.taskDispatchDetails[i].postId == ''){
message.error('请选择岗位!') message.error('请选择岗位!')
ownerIsNull = true; ownerIsNull = true;
throw new Error('Validation failed');
break; break;
} }
}else{ }else{
if( formData.value.taskDispatchDetails[i].owner == undefined || formData.value.taskDispatchDetails[i].owner == null ||formData.value.taskDispatchDetails[i].owner == ''){ if( formData.value.taskDispatchDetails[i].owner == undefined || formData.value.taskDispatchDetails[i].owner == null ||formData.value.taskDispatchDetails[i].owner == ''){
message.error('请选择责任人!') message.error('请选择责任人!')
ownerIsNull = true; ownerIsNull = true;
throw new Error('Validation failed');
break; break;
} }
} }

View File

@ -89,7 +89,7 @@
<el-button link type="primary" @click="openDispatching('update',scope.row.id,scope.row.ownerId,scope.row.taskCode)"> <el-button link type="primary" @click="openDispatching('update',scope.row.id,scope.row.ownerId,scope.row.taskCode)">
编辑 编辑
</el-button> </el-button>
<el-button link type="primary" @click="openDetail('detail', scope.row.id)"> <el-button link type="primary" @click="openDispatching('detail',scope.row.id,scope.row.ownerId,scope.row.taskCode)">
查看详情 查看详情
</el-button> </el-button>
</template> </template>

View File

@ -133,11 +133,13 @@ onLoad(async (options: any) => {
// //
const handleComplate = async () => { const handleComplate = async () => {
isLoading.value = true
const params = { const params = {
id: detailInfo.value?.id, id: detailInfo.value?.id,
active: 'FINISH', active: 'FINISH',
} }
const data = await postOperateAPI(params) const data = await postOperateAPI(params)
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,
@ -325,7 +327,7 @@ const handleStop = async () => {
.product-status { .product-status {
width: 140rpx; width: 140rpx;
border-raduis: 10rpx; border-radius: 10rpx;
text-align: center; text-align: center;
padding: 8rpx 12rpx; padding: 8rpx 12rpx;

View File

@ -136,7 +136,9 @@ const onRefresherrefresh = async () => {
<view class="item" v-for="item in dataList" :key="item.id" @click="handleDetail(item)"> <view class="item" v-for="item in dataList" :key="item.id" @click="handleDetail(item)">
<view class="hd"> <view class="hd">
<view class="num">派工单</view> <view class="num">派工单</view>
<view class="statusLabel"> 单号{{ item.dispatchCode }} </view> <view class="statusLabel">{{ '(单号:'+ item.dispatchCode+') '}}</view>
<view class="num">下一道工序</view>
<view class="statusLabel " >{{ item.nextProcedureName == null ? '无':item.nextProcedureName}}</view>
</view> </view>
<view class="md"> <view class="md">
<view class="product-item">项目名称{{ item.projectCode + ' ' + item.projectName }}</view> <view class="product-item">项目名称{{ item.projectCode + ' ' + item.projectName }}</view>

View File

@ -126,11 +126,13 @@ onLoad(async (options: any) => {
// //
const handleComplate = async () => { const handleComplate = async () => {
isLoading.value = true;
const params = { const params = {
id: detailInfo.value?.id, id: detailInfo.value?.id,
active: 'FINISH', active: 'FINISH',
} }
const data = await postOperateAPI(params) const data = await postOperateAPI(params)
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,
@ -221,7 +223,7 @@ const handleStop = async () => {
</view> </view>
<view class="product-item">预计生产日期{{ detailInfo.startTime }} {{ detailInfo.endTime }}</view> <view class="product-item">预计生产日期{{ detailInfo.startTime }} {{ detailInfo.endTime }}</view>
<view class="finish" v-if="isShowStart && detailInfo.procedureStatus !== 2 && detailInfo.totalWorkTime" <view class="finish" v-if="isShowStart && detailInfo.procedureStatus !== 2 && detailInfo.totalWorkTime"
@click="handleComplate"> @click="handleComplate" >
<image class="complate-img" src="/static/images/productionReport-detail-complate.png" mode="scaleToFill" /> <image class="complate-img" src="/static/images/productionReport-detail-complate.png" mode="scaleToFill" />
生产完成 生产完成
</view> </view>