提交 517441ba authored 作者: kxjia's avatar kxjia

完善报送工作流

上级 0cfa28bc
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button type="primary" @click="handleAdd" v-if="showAdd" preIcon="ant-design:plus-outlined">新增</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0 && showBatch">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作 <Icon icon="mdi:chevron-down" /></a-button>
</a-dropdown>
</template>
<template #action="{ record }">
<TableAction
:actions="tableActions(record)"
:dropDownActions="dropDownActions(record)"
/>
</template>
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
</BasicTable>
<slot name="modals"></slot>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
interface ActionItem {
label: string;
onClick?: (record: any) => void;
ifShow?: boolean;
popConfirm?: {
title: string;
confirm: () => void;
};
disabled?: boolean;
}
interface Props {
title?: string;
api: any;
columns: any[];
searchFormSchema?: any[];
canResize?: boolean;
labelWidth?: string | number;
showAdvancedButton?: boolean;
autoSubmitOnEnter?: boolean;
beforeFetch?: (params: any) => any;
actionColumn?: any;
showAdd?: boolean;
showBatch?: boolean;
getTableActions?: (record: any) => ActionItem[];
getDropDownActions?: (record: any) => ActionItem[];
deleteApi?: (data: any) => Promise<any>;
batchDeleteApi?: (data: any) => Promise<any>;
}
const props = withDefaults(defineProps<Props>(), {
title: '列表',
canResize: false,
labelWidth: '30%',
showAdvancedButton: true,
autoSubmitOnEnter: true,
showAdd: true,
showBatch: true,
});
const emit = defineEmits(['add', 'reload', 'register']);
const { tableContext } = useListPage({
tableProps: {
title: props.title,
api: props.api,
columns: props.columns,
canResize: props.canResize,
formConfig: {
labelWidth: props.labelWidth,
schemas: props.searchFormSchema || [],
autoSubmitOnEnter: props.autoSubmitOnEnter,
showAdvancedButton: props.showAdvancedButton,
},
beforeFetch: props.beforeFetch,
actionColumn: props.actionColumn || {
width: 200,
fixed: 'right',
},
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
// 组件初始化时发出 register 事件
onMounted(() => {
emit('register', {
register: registerTable,
reload,
});
});
function handleAdd() {
emit('add');
}
async function handleDelete(record: any) {
if (props.deleteApi) {
await props.deleteApi({ id: record.id });
handleSuccess();
}
}
async function batchHandleDelete() {
if (props.batchDeleteApi) {
await props.batchDeleteApi({ ids: selectedRowKeys.value });
handleSuccess();
}
}
async function handleSuccess() {
selectedRowKeys.value = [];
await reload();
emit('reload');
}
function tableActions(record: any) {
if (props.getTableActions) {
return props.getTableActions(record);
}
return [];
}
function dropDownActions(record: any) {
if (props.getDropDownActions) {
return props.getDropDownActions(record);
}
return [];
}
defineExpose({
reload,
registerTable,
});
</script>
...@@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [ ...@@ -96,7 +96,7 @@ export const columns: BasicColumn[] = [
status = "已启动"; status = "已启动";
} else if(text==="2") { } else if(text==="2") {
color = "green"; color = "green";
status = "行中"; status = "行中";
} else { } else {
color = ""; color = "";
status = "完成"; status = "完成";
......
<template> <template>
<div> <div>
<BasicTable @register="registerTable" :rowSelection="rowSelection"> <DynamicList
<template #tableTitle> :title="title"
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button> :api="api"
<a-dropdown v-if="selectedRowKeys.length > 0"> :columns="columns"
<template #overlay> :searchFormSchema="searchFormSchema"
<a-menu> :actionColumn="actionColumn"
<a-menu-item key="1" @click="batchHandleDelete"> :beforeFetch="beforeFetch"
<Icon icon="ant-design:delete-outlined" /> :getTableActions="getTableAction"
删除 :getDropDownActions="getDropDownAction"
</a-menu-item> :deleteApi="deleteOne"
</a-menu> :batchDeleteApi="batchDelete"
</template> :showBatch="false"
<a-button>批量操作 <Icon icon="mdi:chevron-down" /></a-button> @add="handleAdd"
</a-dropdown> @register="handleRegister"
>
<template #modals>
<BaosongTaskModal @register="registerModal" @success="handleSuccess" />
<BaosongAllocDrawer ref="refAllocDrawer" @callback="handleSuccess" />
</template> </template>
<template #action="{ record }"> </DynamicList>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<BaosongTaskModal @register="registerModal" @success="handleSuccess" />
<BaosongAllocDrawer ref="refAllocDrawer" @callback="handleSuccess" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, unref } from 'vue'; import { ref } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table'; import { useModal } from '/@/components/Modal';
import { useModal } from '/@/components/Modal'; import BaosongTaskModal from '../form/BaosongTaskModal.vue';
import { useListPage } from '/@/hooks/system/useListPage'; import { columns, searchFormSchema } from '../data/BaosongTask.data';
import BaosongTaskModal from '../form/BaosongTaskModal.vue'; import { list, deleteOne, batchDelete, saveOrUpdate } from '../api/BaosongTask.api';
import { columns, searchFormSchema } from '../data/BaosongTask.data'; import BaosongAllocDrawer from '../form/BaosongAllocDrawer.vue';
import { list, deleteOne, batchDelete, saveOrUpdate } from '../api/BaosongTask.api'; import DynamicList from '../components/DynamicList.vue';
import BaosongAllocDrawer from '../form/BaosongAllocDrawer.vue';
const [registerModal, { openModal }] = useModal();
const [registerModal, { openModal }] = useModal(); const refAllocDrawer = ref();
const refAllocDrawer = ref(); let reloadTable: () => Promise<void>;
const props = defineProps({ const props = defineProps({
todoList: { type: Array as () => Recordable[], default: () => [] }, todoList: { type: Array as () => Recordable[], default: () => [] },
}) });
const title = '任务表';
const { tableContext } = useListPage({ const api = list;
tableProps: { const actionColumn = {
title: '任务表', width: 200,
api: list, fixed: 'right',
columns, };
canResize: false,
formConfig: { function beforeFetch(params: any) {
labelWidth: '30%', params['bpmStatus'] = "2";
schemas: searchFormSchema, params['todoList'] = props.todoList;
autoSubmitOnEnter: true, return params;
showAdvancedButton: true, }
},
beforeFetch(params) { function handleRegister(params: any) {
params['bpmStatus'] = "2"; reloadTable = params.reload;
params['todoList'] = props.todoList; }
return params;
}, function handleAdd() {
actionColumn: { openModal(true, {
width: 200, isUpdate: false,
fixed: 'right', showFooter: true,
},
},
}); });
}
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext; function handleAlloc(record: Recordable) {
refAllocDrawer.value?.setIniData(record);
function handleAdd() { }
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
function handleAlloc(record: Recordable) {
refAllocDrawer.value.setIniData(record);
}
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
openModal(true, { openModal(true, {
record, record,
isUpdate: true, isUpdate: true,
showFooter: true, showFooter: true,
}); });
} }
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
async function handleDelete(record: Recordable) {
await deleteOne({ id: record.id }, handleSuccess);
}
async function batchHandleDelete() { function handleDetail(record: Recordable) {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess); openModal(true, {
} record,
isUpdate: true,
showFooter: false,
});
}
async function handleSuccess() { async function handleSuccess() {
selectedRowKeys.value = []; if (reloadTable) {
await reload(); await reloadTable();
} }
}
function getTableAction(record: Recordable) { function getTableAction(record: Recordable) {
return [ return [
// { {
// label: '分配', label: '处理',
// onClick: handleAlloc.bind(null, record), onClick: () => emit('open-multi-form', record),
// }, },
// { ];
// label: '提交', }
// onClick: () => emit('sendWorkFlow', record),
// }, function getDropDownAction(record: Recordable) {
{ return [
label: '处理', {
onClick: () => emit('open-multi-form', record), label: '详情',
}, onClick: () => handleDetail(record),
]; },
} {
label: '编辑',
onClick: () => handleEdit(record),
},
];
}
function getDropDownAction(record: Recordable) { const emit = defineEmits(['sendWorkFlow', 'open-multi-form']);
return [
{
label: '详情',
onClick: () => handleDetail(record),
},
{
label: '编辑',
onClick: () => handleEdit(record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: () => handleDelete(record),
},
},
];
}
const emit = defineEmits(['sendWorkFlow', 'open-multi-form']); const handleUpdate = async (dataId: string, flowNode: Recordable) => {
const record = {
const handleUpdate = async (dataId: string, flowNode: Recordable) => { bpmNodeId: flowNode.id,
const record = { deployId: flowNode.deployId,
bpmNodeId: flowNode.id, bpmStatus: 2,
deployId: flowNode.deployId, id: dataId,
bpmStatus: 2,
id: dataId,
};
await saveOrUpdate(record, true);
await handleSuccess();
}; };
await saveOrUpdate(record, true);
const handleStartUpdate = async (flowData: Recordable) => { await handleSuccess();
const record = { };
procInsId: flowData.procInsId,
id: flowData.dataId, const handleStartUpdate = async (flowData: Recordable) => {
bpmStatus: 0, const record = {
}; procInsId: flowData.procInsId,
id: flowData.dataId,
await saveOrUpdate(record, true); bpmStatus: 0,
await handleSuccess();
}; };
await saveOrUpdate(record, true);
defineExpose({ await handleSuccess();
handleUpdate, };
handleStartUpdate,
}); defineExpose({
</script> handleUpdate,
\ No newline at end of file handleStartUpdate,
});
</script>
...@@ -49,7 +49,6 @@ public class AuditActController extends JeecgController<AuditAct, IAuditActServi ...@@ -49,7 +49,6 @@ public class AuditActController extends JeecgController<AuditAct, IAuditActServi
@Autowired @Autowired
private IAuditActRelOthersService stActRelOthersService; private IAuditActRelOthersService stActRelOthersService;
/** /**
* 分页列表查询 * 分页列表查询
* *
......
...@@ -2,6 +2,7 @@ package org.jeecg.modules.stm.baosong.controller; ...@@ -2,6 +2,7 @@ package org.jeecg.modules.stm.baosong.controller;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import dev.langchain4j.internal.Utils; import dev.langchain4j.internal.Utils;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
...@@ -16,8 +17,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -16,8 +17,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.stm.my.entity.MyTask;
import org.jeecg.modules.stm.my.entity.MyTaskFlow; import org.jeecg.modules.stm.my.entity.MyTaskFlow;
import org.jeecg.modules.stm.my.entity.MyTaskFlowHis;
import org.jeecg.modules.stm.my.service.IMyTaskFlowHisService;
import org.jeecg.modules.stm.my.service.IMyTaskFlowService; import org.jeecg.modules.stm.my.service.IMyTaskFlowService;
import org.jeecg.modules.stm.my.service.IMyTaskService;
import org.jeecg.modules.stm.problem.entity.StProblemCheck; import org.jeecg.modules.stm.problem.entity.StProblemCheck;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -51,6 +56,10 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong ...@@ -51,6 +56,10 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong
private IBaosongTaskReviewService baosongTaskReviewService; private IBaosongTaskReviewService baosongTaskReviewService;
@Autowired @Autowired
private IMyTaskFlowService myTaskFlowService; private IMyTaskFlowService myTaskFlowService;
@Autowired
private IMyTaskFlowHisService myTaskFlowHisService;
@Autowired
private IMyTaskService myTaskService;
/** /**
* 分页列表查询 * 分页列表查询
...@@ -149,13 +158,13 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong ...@@ -149,13 +158,13 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong
@AutoLog(value = "任务表-添加") @AutoLog(value = "任务表-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody BaosongTask baosongTask) { public Result<BaosongTask> add(@RequestBody BaosongTask baosongTask) {
if(baosongTask.getTp()==null){ if(baosongTask.getTp()==null){
baosongTask.setTp(1); baosongTask.setTp(1);
} }
baosongTask.setSta(0); baosongTask.setSta(0);
baosongTaskService.save(baosongTask); baosongTaskService.save(baosongTask);
return Result.OK("添加成功!"); return Result.OK(baosongTask);
} }
/** /**
...@@ -167,9 +176,9 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong ...@@ -167,9 +176,9 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong
@AutoLog(value = "任务表-编辑") @AutoLog(value = "任务表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody BaosongTask baosongTask) { public Result<BaosongTask> edit(@RequestBody BaosongTask baosongTask) {
baosongTaskService.updateById(baosongTask); baosongTaskService.updateById(baosongTask);
return Result.OK("编辑成功!"); return Result.OK(baosongTask);
} }
/** /**
...@@ -183,6 +192,7 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong ...@@ -183,6 +192,7 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) Integer id) { public Result<String> delete(@RequestParam(name="id",required=true) Integer id) {
baosongTaskService.removeById(id); baosongTaskService.removeById(id);
deleteOther(id); deleteOther(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
...@@ -345,6 +355,23 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong ...@@ -345,6 +355,23 @@ public class BaosongTaskController extends JeecgController<BaosongTask, IBaosong
QueryWrapper<BaosongTaskRecord> queryRecordWrapper = new QueryWrapper<>(); QueryWrapper<BaosongTaskRecord> queryRecordWrapper = new QueryWrapper<>();
queryRecordWrapper.eq("taskid",taskId); queryRecordWrapper.eq("taskid",taskId);
baosongTaskRecordService.remove(queryRecordWrapper); baosongTaskRecordService.remove(queryRecordWrapper);
LambdaQueryWrapper<MyTaskFlow> myTaskFlowWrapper = new LambdaQueryWrapper<>();
myTaskFlowWrapper.eq(MyTaskFlow::getFormTableName, "baosong_task")
.eq(MyTaskFlow::getTaskId, taskId);
myTaskFlowService.getBaseMapper().delete(myTaskFlowWrapper);
LambdaQueryWrapper<MyTask> myTaskWrapper = new LambdaQueryWrapper<>();
myTaskWrapper.eq(MyTask::getTp, 5)
.eq(MyTask::getTargetId, taskId);
myTaskService.getBaseMapper().delete(myTaskWrapper);
LambdaQueryWrapper<MyTaskFlowHis> myTaskFlowHistoryWrapper = new LambdaQueryWrapper<>();
myTaskFlowHistoryWrapper.eq(MyTaskFlowHis::getFormTableName, "baosong_task")
.eq(MyTaskFlowHis::getTaskId, taskId);
myTaskFlowHisService.getBaseMapper().delete(myTaskFlowHistoryWrapper);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论