1.取消顺序号

2.人员为弹框多选
3.预计时间取生产计划自动带出
5.人员为4 5岗位人员
This commit is contained in:
Ledo 2025-05-14 23:42:43 +08:00
parent 6c69e4fbc6
commit d003a4a9aa
10 changed files with 459 additions and 9 deletions

View File

@ -10,6 +10,7 @@ import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
import com.chanko.yunxi.mes.framework.operatelog.core.service.OperateLogFrameworkService;
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuser.FpUserDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
@ -210,6 +211,15 @@ public class TaskDispatchController {
List<HashMap<String, String>> owner = taskDispatchService.getOwner(id, type);
return success(owner);
}
@GetMapping("/assmebleDispatchPage")
@Operation(summary = "获取装配报工责任人名单")
@PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')")
public CommonResult< List<FpUserDetailDO>> assmebleDispatchPage() {
List<FpUserDetailDO> assembleOwner = taskDispatchService.getAssembleOwner();
return success(assembleOwner);
}
@GetMapping("/getListJg")
@Operation(summary = "获得加工工时成本")
@PreAuthorize("@ss.hasPermission('heli:deliver-order:query')")

View File

@ -119,6 +119,15 @@ public class TaskDispatchRespVO {
@Schema(description = "要求开始日期")
private LocalDateTime requiredStartDate;
@Schema(description = "装配报工预计开始时间")
private LocalDateTime assembleBeginDate;
@Schema(description = "装配报工预计结束时间")
private LocalDateTime assembleEndDate;
@Schema(description = "工艺流程+6")
private String craftContent;
@Schema(description = "要求完成日期")
private LocalDateTime requiredEndDate;

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.math.BigDecimal;
@ -72,6 +73,7 @@ public class TaskDispatchDO extends BaseDO {
* 备注
*/
private String remark;
/**
* 状态,1表示正常2表示禁用
*/
@ -152,6 +154,10 @@ public class TaskDispatchDO extends BaseDO {
private String craftContent;
@TableField(exist = false)
private Integer projectSubAmount;
@TableField(exist = false)
private LocalDateTime assembleBeginDate;
@TableField(exist = false)
private LocalDateTime assembleEndDate;
public boolean canSave(){
return TaskDispatchStatusEnum.SAVE.getCode() == this.dispatchStatus.intValue();
}

View File

@ -13,6 +13,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -107,7 +108,26 @@ public interface FpUserDetailMapper extends BaseMapperX<FpUserDetailDO> {
return selectList(query);
}
default List<FpUserDetailDO> selectOwnerList(){
MPJLambdaWrapper<FpUserDetailDO> queery1 = new MPJLambdaWrapper();
List<Integer> list = new ArrayList();
list.add(4);
list.add(5);
queery1.selectAll(FpUserDetailDO.class)
.select("c.nickname as nick_Name ")
// .leftJoin(PostDO.class,"b", PostDO::getId,FpUserDetailDO::getPostId)
.leftJoin(AdminUserDO.class,"c",AdminUserDO::getId,FpUserDetailDO::getBusyId)
.leftJoin(FpUserDO.class,"a",FpUserDO::getId, FpUserDetailDO::getFpId)
.eq(FpUserDO::getType,"1")
.eq(FpUserDetailDO::getIsRes,"Y")
.in(FpUserDetailDO::getPostId,list);
return selectList(queery1);
}
// void deleteFpId(@Param("fpId") Long fpId);
//
// void deleteByFuId(@Param("id")Long id);

View File

@ -131,6 +131,7 @@ public interface TaskDispatchMapper extends BaseMapperX<TaskDispatchDO> {
default TaskDispatchDO selectById(Long id) {
MPJLambdaWrapper<TaskDispatchDO> query = new MPJLambdaWrapper<>();
query.selectAll(TaskDispatchDO.class)
.select("a.plan_no as planCode", "e.name as customerName", "a.craft_content as craftContent")
.select("d.code as projectCode", "d.project_name as projectName", "d.project_end_time as projectEndTime")
.select("c.name as projectSubName", "b.project_sub_code as projectSubCode")

View File

@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.service.taskdispatch;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.ygjx.vo.YgjxPageReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.fpuserdetail.FpUserDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO;
@ -90,6 +91,7 @@ public interface TaskDispatchService {
void convertAssembleProcedure(TaskDispatchDO taskDispatchDO);
List<HashMap<String,String>> getOwner(Long id,Long type);
public List<FpUserDetailDO> getAssembleOwner();
boolean judgeHasOver(Long id);
List<TaskDispatchDO> getListJg(Long id, Long projectSubId);

View File

@ -654,6 +654,15 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
return fpUserMapList;
}
@Override
public List<FpUserDetailDO> getAssembleOwner(){
List<FpUserDetailDO> fpUserDetailDOS = fpUserDetailMapper.selectOwnerList();
// List<HashMap<String,String>> fpUserMapList = new ArrayList<>();
if (CollUtil.isEmpty(fpUserDetailDOS)){
throw exception(OWNER_NOT_EXISTS);
}
return fpUserDetailDOS;
}
@Override
public PageResult<TaskDispatchDetailTotalVO> getTaskDispatchPageDetailTotal(TaskDispatchDetailTotalVO pageTotalVO) {
if(pageTotalVO.getDeviceModel()!=null){
EquipManufactureDO equipManufactureDO = equipManufactureMapper.selectById(pageTotalVO.getDeviceModel());

View File

@ -72,7 +72,9 @@ export const getTaskDispatchDetailListByWorkTime = async (params) => {
export const getOwnerList = async(id:number,type:number)=>{
return await request.get({url:`/heli/task-dispatch/task-dispatch-detail/getOwner?id=`+id+`&type=`+type})
}
export const getAssmebleDispatchPage = async() => {
return await request.get({ url: '/heli/task-dispatch/assmebleDispatchPage' })
}
export const judgeHasOver = async(id:number)=>{
return await request.get({url:`/heli/task-dispatch/task-dispatch-detail/judgeHasOver?id=`+id})

View File

@ -278,9 +278,9 @@ ref="subFormRef" :model="formData.taskDispatchDetails" :rules="subFormRules"
</template>
</el-table-column>
<el-table-column label="顺序号" align="center" prop="sort" width="160">
<template #header> <span class="hl-table_header">*</span>顺序号</template>
<template #header> 顺序号</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.sort`" :rules="subFormRules.sort" class="mb-0px!">
<el-form-item :prop="`${$index}.sort`" class="mb-0px!">
<el-input-number
min="0" :precision="0" class="!w-240px"
:disabled="detailDisabled || (row.beginProduce != 0 && row.procedureStatus != 0)" v-model="row.sort"
@ -288,20 +288,42 @@ min="0" :precision="0" class="!w-240px"
</el-form-item>
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="owner" width="180">
<!-- <el-table-column label="负责人" align="center" prop="owner" width="180">
<template #header> <span class="hl-table_header">*</span>负责人</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.owner`" :rules="subFormRules.owner" class="mb-0px!">
<el-form-item :prop="`${$index}.owner`" :rules="subFormRules.owner" class="mb-0px!">-->
<!-- <UserSelect-->
<!--v-model="row.owner" :disabled="detailDisabled || row.procedureStatus != 0"-->
<!-- @update:new-value="handleSelectedUser($index, $event)" />-->
<el-select v-model="row.owner" filterable :disabled="detailDisabled || (row.beginProduce != 0 && row.procedureStatus != 0)" @update:new-value="handleSelectedUser($index, $event)">
<!-- <el-select v-model="row.owner" filterable :disabled="detailDisabled || (row.beginProduce != 0 && row.procedureStatus != 0)" @update:new-value="handleSelectedUser($index, $event)">
<el-option
v-for="dict in userInit" :key="dict.id"
:label="dict.username+' '+dict.nickname" :value="dict.id" />
</el-select>
</el-form-item>
</template>
</el-table-column>-->
<el-table-column label="负责人" align="center" prop="owner" width="180">
<template #header> <span class="hl-table_header">*</span>负责人</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.ownerNames`" :rules="subFormRules.owner" class="mb-0px!">
<el-input
class="!w-265px"
placeholder="负责人"
v-model="row.ownerNames"
readonly
:disabled="detailDisabled "
@click.prevent="handleClick(row.owners,$index)"
>
<template #append
><el-button
:icon="Search"
:disabled="detailDisabled"
@click="openuserDialog(row.owners,$index)"
/></template>
</el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="预计开始时间" min-width="180">
<template #header> <span class="hl-table_header">*</span>预计开始时间</template>
@ -473,6 +495,8 @@ v-if="formData.dispatchStatus == 2" @click="printHandle(formData.id)" :disabled=
<!-- 打印发货单 - 弹框-->
<ProductProcessPrint ref="ProductProcessPrintRef" :info="dialogInfo" />
<!--派工人员选择弹框-->
<UserDialog ref="userDialogref" @success="handleuserClick" />
</template>
<script setup lang="ts">
import {
@ -485,6 +509,8 @@ import {
dateFormatter,
formatDate
} from "@/utils/formatTime";
import UserDialog from './userselect.vue'
import { Search } from '@element-plus/icons-vue'
import {
ref,
watch
@ -521,7 +547,7 @@ import * as ProcedureApi from "@/api/heli/procedure";
defineOptions({
name: 'TaskDispatchDetail'
})
const userDialogref = ref()
const reload = inject('reload')
const {
t
@ -548,7 +574,20 @@ const formatDateT = (timestamp) => {
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`; // YYYY-MM-DD
}
const handleClick = (owners,index) => {
openuserDialog(owners,index)
}
const openuserDialog = (owners,index) => {
userDialogref.value.open(owners,index)
}
const handleuserClick = (val, index) => {
// reactive
formData.value.taskDispatchDetails[index].owners = val.map((item) => item.id)
formData.value.taskDispatchDetails[index].ownerNames = val.map((item) => item.nickname)
// console.log(formData.value.taskDispatchDetails[index].owners);
// console.log(formData.value.taskDispatchDetails[index].ownerNames);
}
const formData = ref({
id: undefined,
code: undefined,
@ -566,7 +605,9 @@ const formData = ref({
taskDispatchDetails: [],
operateLogs: [],
active: undefined,
activeOpinion: ''
activeOpinion: '',
craftInfos:[],
craftContent:''
})
const formRef = ref() // Ref
@ -824,7 +865,9 @@ const resetForm = () => {
taskDispatchDetails: [],
operateLogs: [],
active: undefined,
activeOpinion: ''
activeOpinion: '',
craftInfos:[],
craftContent:''
}
formRef.value?.resetFields()
}
@ -866,7 +909,22 @@ const subFormRules = reactive({
trigger: 'blur'
}],
})
const arrayEmpty = (list : any[]) => {
if(list != null && list.length > 0){
return false;
}else{
return true;
}
}
const strEmpty = (str : string) => {
if(str != null && str !== ''){
return false;
}else{
return true;
}
}
const queryData = async (id?: number) => {
resetForm()
//
@ -874,6 +932,11 @@ const queryData = async (id?: number) => {
formLoading.value = true
try {
formData.value = await TaskDispatchApi.getTaskDispatch(id)
if(formData.value.craftContent != null && formData.value.craftContent != ''){
formData.value.craftInfos = JSON.parse(formData.value.craftContent)
console.log(formData.value.craftInfos)
}
formData.value.taskDispatchDetails = await TaskDispatchApi.getTaskDispatchDetailListByDispatchId(id)
formData.value.bomCode = 'BOM-' + formData.value.projectSubCode
if (formData.value.dispatchStatus == 2) {
@ -1002,6 +1065,14 @@ const onAddItem = () => {
beginProduce: 0,
dispatchId: undefined,
}
if(!arrayEmpty(formData.value.craftInfos)){
formData.value.craftInfos.forEach(item => {
if(item.name == '装配'){
row.startTime = item.startDate;
row.endTime = item.endDate
}
})
}
row.amount = formData.value.projectSubAmount
row.dispatchId = formData.value.id
formData.value.taskDispatchDetails.push(row)

View File

@ -0,0 +1,320 @@
<template>
<Dialog title="职工信息" width="80%" v-model="dialogVisible" center>
<ContentWrap class="borderxx">
<!-- 搜索工作栏 -->
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="108px">
<el-form-item label="姓名/工号" label-width="130px" prop="nickname">
<el-input v-model="queryParams.userNickName" placeholder="请输入姓名/工号" clearable @keyup.enter="handleQuery" class="!w-240px" />
</el-form-item>
<el-form-item label="所属部门" prop="deptId">
<el-tree-select v-model="queryParams.deptId" :data="deptList" :props="defaultProps" check-strictly node-key="id" clearable placeholder="请选择所属部门" />
</el-form-item>
<el-form-item label="岗位" prop="postId">
<el-select v-model="queryParams.postIdNew" clearable placeholder="请选择岗位">
<el-option v-for="dict in postList" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery" type="primary">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-button @click="resetQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<el-card class="hl-card">
<!-- 列表 -->
<ContentWrap>
<el-table ref="multipleTable" v-loading="loading" :data="list" :stripe="true" height="100%" :show-overflow-tooltip="true" :reserve-selection="true" class="hl-table" @selection-change="handleSelectionChange" :row-key="getRowKeys" @row-click="clickRow" selection :style="{height: list && list.length > 9 ? '475px' : ''}">
<el-table-column type="selection" width="55" :reserve-selection="true" />
<el-table-column type="index" min-width="70" label="序号" align="center" />
<el-table-column label="工号" align="center" prop="username" :show-overflow-tooltip="true" min-width="120" />
<el-table-column label="姓名" align="center" prop="nickname" :show-overflow-tooltip="true" min-width="120" />
<el-table-column label="部门" align="center" key="deptName" prop="deptName" :show-overflow-tooltip="true" min-width="120" />
<el-table-column label="岗位" align="center" prop="postIdNew" min-width="120" />
<el-table-column label="手机号码" align="center" prop="mobile" min-width="120" />
<!-- <el-table-column label="性别" align="center" prop="sex" min-width="120"> -->
<!-- <template #default="scope">
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex" />
</template>
</el-table-column> -->
</el-table>
<!-- 分页 -->
<!-- <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" @pagination="getList" /> -->
</ContentWrap>
</el-card>
<template #footer>
<el-button @click="dialogVisible = false" size="large"> </el-button>
<el-button @click="submitForm" type="success" size="large"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { CommonStatusEnum } from '@/utils/constants'
import { defaultProps, handleTree } from '@/utils/tree'
import * as PostApi from '@/api/system/post'
import * as DeptApi from '@/api/system/dept'
import * as UserApi from '@/api/system/user'
import * as DispatchApi from '@/api/heli/taskdispatch'
import { FormRules } from 'element-plus'
import { ElTable } from 'element-plus'
import { any, string } from 'vue-types'
import { toRefs } from 'vue'
const beforeOwnerList = ref([])
const message = useMessage() //
const { t } = useI18n() //
const router = useRouter()
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const loading = ref(true) //
const list = ref([]) //
const total = ref(0) //
const deptList = ref<Tree[]>([]) //
const postList = ref([]) //
//
const props = defineProps({
dialogType: {
type: Object,
required: true
}
})
const dialogTypeValue = toRefs(props).dialogType // props dialogType
const queryParams = reactive({
pageNo: 1,
pageSize: 999,
userNickName: undefined,
nickname: undefined,
deptId: undefined,
postIdNew:'',
postId: undefined,
status: 0
})
const queryFormRef = ref() //
const finalToggleList : any = ref([])
const thisPageList : any = ref([])
/** 查询列表 */
const arrayEmpty = (list : any[]) => {
if(list != null && list.length > 0){
return false;
}else{
return true;
}
}
const strEmpty = (str : string) => {
if(str != null && str !== ''){
return false;
}else{
return true;
}
}
const getList = async () => {
loading.value = true
//
try {
postList.value = [];
list.value = []
var hasSet = new Set;
const data = await UserApi.getUserPage(queryParams)
var ownerList = await DispatchApi.getAssmebleDispatchPage();
if(!arrayEmpty(ownerList)){
ownerList.forEach(item => {
data.list.forEach( item1 =>{
if(item.busyId == item1.id){
if(!strEmpty(queryParams.postIdNew)){
if(item.postId == queryParams.postIdNew){
let newItem = { postIdNew: item.postId, ...item1 };
list.value.push(newItem)
hasSet.add(item.postId)
}
}else{
let newItem = { postIdNew: item.postId, ...item1 };
list.value.push(newItem)
hasSet.add(item.postId)
}
}
})
})
if(!arrayEmpty(list.value)){
if(!arrayEmpty(beforeOwnerList.value )){
//
beforeOwnerList.value.forEach(item =>{
list.value.forEach(item1 =>{
if(item == item1.id){
multipleSelection.value.push(item1);
multipleTable.value.toggleRowSelection(item1, true)
}
})
})
}
total.value = list.value.length;
}else{
total.value = 0
}
hasSet.forEach(item =>{
postList.value.push({
label:item,
value:item
})
})
}else{
list.value = []
total.value = 0
}
// console.log(ownerList)
// list.value = data.list
// total.value = data.total
// if((finalToggleList.value == null || finalToggleList.value.length == 0 )&& (multipleSelection.value == null || multipleSelection.value.length == 0)){
// console.log('1')
// }else if ((finalToggleList.value == null || finalToggleList.value.length == 0 )&& multipleSelection.value != null && multipleSelection.value.length >0){
// multipleSelection.value.forEach(item =>{
// finalToggleList.value.push(item);
// })
// multipleTable.value.clearSelection();
// }else if (finalToggleList.value != null && finalToggleList.value.length >0 && multipleSelection.value != null && multipleSelection.value.length >0){
// if(thisPageList.value != null && thisPageList.value.length > 0){
// console.log('3')
// // multipleSelection thisPageList
// const inMultipleNotInThisPage = multipleSelection.value.filter(msItem =>
// !thisPageList.value.some(tpItem => tpItem.id === msItem.id)
// );
// // thisPageList multipleSelection
// const inThisPageNotInMultiple = thisPageList.value.filter(tpItem =>
// !multipleSelection.value.some(msItem => msItem.id === tpItem.id)
// );
// // id finalToggleList
// const finalToggleListObj = finalToggleList.value.reduce((acc, item) => {
// acc[item.id] = item;
// return acc;
// }, {});
// // inMultipleNotInThisPage finalToggleListObj
// inMultipleNotInThisPage.forEach(item => {
// finalToggleListObj[item.id] = item;
// });
// // inThisPageNotInMultiple finalToggleListObj
// inThisPageNotInMultiple.forEach(item => {
// delete finalToggleListObj[item.id];
// });
// // finalToggleListObj
// const updatedFinalToggleList = Object.values(finalToggleListObj);
// // finalToggleList Vue.js
// finalToggleList.value = updatedFinalToggleList;
// thisPageList.value = []
// multipleTable.value.clearSelection();
// }else{
// console.log('4')
// multipleSelection.value.forEach(item => {
// finalToggleList.value.push(item)
// })
// }
// }else if (finalToggleList.value != null && finalToggleList.value.length >0 && ( multipleSelection.value == null || multipleSelection.value.length == 0) ){
// console.log('5')
// finalToggleList.value.forEach(item => {
// const row = list.value.find(r => r.matId === item.matId);
// console.log(row)
// if (row) {
// multipleTable.value.toggleRowSelection(row, true);
// thisPageList.value.push(row);
// }
// });
// }
// console.log(multipleSelection.value)
// console.log(finalToggleList.value)
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
const multipleTable: any = ref<InstanceType<typeof ElTable>>()
const multipleSelection: any = ref([])
const handleSelectionChange = (val: []) => {
multipleSelection.value = val
}
//key,
const getRowKeys = (row) => {
return row.id
}
const clickRow = (row: any) => {
if (row) {
multipleTable.value!.toggleRowSelection(row, undefined)
} else {
multipleTable.value!.clearSelection()
}
}
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = () => {
if (!multipleSelection.value || multipleSelection.value.length <= 0) {
message.warning(t('common.selectText'))
return
}
dialogVisible.value = false
//
// console.log(dialogTypeValue.value)
console.log(multipleSelection.value);
emit('success', multipleSelection.value, faindex.value)
//
}
const userInit = ref()
const faindex =ref()
/** 打开弹窗 */
const open = async (owners,index) => {
multipleSelection.value=[]
console.log(owners)
beforeOwnerList.value = owners;
faindex.value=index
dialogVisible.value = true
queryParams.userNickName = undefined
queryParams.deptId = undefined
queryParams.postId = undefined
//
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
//
// postList.value = await PostApi.getSimplePostList()
//
userInit.value = await UserApi.getSimpleUserList()
handleQuery()
}
defineExpose({ open }) // open
</script>