提交 1f1c527f authored 作者: kxjia's avatar kxjia

完善问题

上级 89bf837f
<template>
<BasicDrawer v-bind="$attrs" title="流程追踪" width="100%"
@register="registerBasicDrawer"
:header-style="{ backgroundColor: '#018ffb', borderBottom: '1px solid #e8eef2' }">
<BasicDrawer v-bind="$attrs" title="流程追踪" width="100%" @register="registerBasicDrawer" :header-style="{ backgroundColor: '#018ffb', borderBottom: '1px solid #e8eef2' }">
<div class="drawer-content">
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleTabChange">
<a-tab-pane key="chart" tab="流程图">
......@@ -21,45 +19,30 @@
import FlowHistoryChart from './FlowHistoryChart.vue';
import FlowHistoryRecord from './FlowHistoryRecord.vue';
const activeKey = ref('chart');
const procInsId = ref('');
const dataId = ref('');
const deployId = ref('');
const refFlowHistoryChart = ref();
const refFlowHistoryRecord = ref();
const curData = ref({});
const callback = (data) => {
curData.value = data;
handleTabChange('chart');
}
const handleTabChange = (key) => {
if (key === 'chart') {
nextTick(() => {
refFlowHistoryChart.value.loadData(curData.value);
})
nextTick(() => refFlowHistoryChart.value?.loadData(curData.value));
} else if (key === 'record') {
nextTick(() => {
refFlowHistoryRecord.value.loadData(curData.value);
})
nextTick(() => refFlowHistoryRecord.value?.loadData(curData.value));
}
activeKey.value = key;
}
const [registerBasicDrawer, { closeDrawer, setDrawerProps }] = useDrawerInner(callback);
const [registerBasicDrawer, { closeDrawer }] = useDrawerInner(callback);
</script>
<style scoped>
.drawer-content {
height: 100%;
}
.drawer-content :deep(.ant-tabs) {
height: 100%;
}
.drawer-content :deep(.ant-tabs-content) {
height: calc(100% - 40px);
overflow-y: auto;
}
.drawer-content { height: 100%; }
.drawer-content :deep(.ant-tabs) { height: 100%; }
.drawer-content :deep(.ant-tabs-content) { height: calc(100% - 40px); overflow-y: auto; }
</style>
......@@ -14,20 +14,11 @@
<a-form layout="vertical">
<a-form-item label="用户类型" required>
<a-radio-group v-model:value="localUserType" disabled>
<a-radio value="user">
<UserOutlined /> 用户
</a-radio>
<a-radio value="role">
<TeamOutlined /> 角色
</a-radio>
<a-radio value="user"><UserOutlined /> 用户</a-radio>
<a-radio value="role"><TeamOutlined /> 角色</a-radio>
</a-radio-group>
</a-form-item>
<!-- 用户/角色选择区域(未选择时) -->
<a-form-item
v-if="!assigneeId"
:label="localUserType === 'user' ? '选择用户' : '选择角色'"
>
<a-form-item v-if="!assigneeId" :label="localUserType === 'user' ? '选择用户' : '选择角色'">
<div class="assignee-selector">
<a-input
:value="assigneeDisplayName"
......@@ -41,8 +32,6 @@
</a-input>
</div>
</a-form-item>
<!-- 已指定信息展示 -->
<div v-if="assigneeId" class="assignee-info-wrapper">
<div class="assignee-info-label">已指定{{ localUserType === 'user' ? '用户' : '角色' }}:</div>
<a-descriptions :column="1" size="small" bordered>
......@@ -53,12 +42,9 @@
{{ assigneeDisplayName || '--' }}
</a-descriptions-item>
</a-descriptions>
<a-button type="link" size="small" @click="clearAssignee" class="change-btn">
重新选择
</a-button>
<a-button type="link" size="small" @click="clearAssignee" class="change-btn">重新选择</a-button>
</div>
</a-form>
<div class="assignee-actions">
<a-space>
<a-button @click="handleClose">取消</a-button>
......@@ -68,27 +54,13 @@
</a-card>
</div>
<RoleSelectModal
rowKey="id"
@register="registerSelRoleModal"
@getSelectResult="onSelectRoleOk"
isRadioSelection
:showButton="false"
labelKey="roleName"
/>
<UserSelectModal
rowKey="id"
@register="registerSelUserModal"
@getSelectResult="onSelectUserOk"
isRadioSelection
:showButton="false"
labelKey="realname"
/>
<RoleSelectModal rowKey="id" @register="registerSelRoleModal" @getSelectResult="onSelectRoleOk" isRadioSelection :showButton="false" labelKey="roleName" />
<UserSelectModal rowKey="id" @register="registerSelUserModal" @getSelectResult="onSelectUserOk" isRadioSelection :showButton="false" labelKey="realname" />
</BasicDrawer>
</template>
<script lang="ts" setup>
import { ref, computed, watch, nextTick } from 'vue'
import { ref } from 'vue'
import { message } from 'ant-design-vue'
import { useModal } from '/@/components/Modal'
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'
......@@ -97,43 +69,26 @@ import UserSelectModal from '/@/components/Form/src/jeecg/components/modal/UserS
import RoleSelectModal from '/@/components/Form/src/jeecg/components/modal/RoleSelectModal.vue'
import { complete, getMyTaskFlow } from '/@/components/Process/api/todo'
interface formDadta {
assignee: string
userType: string
deployId?: string
required?: string
assigneeName?: string
dataId?: string
}
const emit = defineEmits(['success', 'error', 'close'])
const [registerSelUserModal, { openModal: userOpenModal }] = useModal()
const [registerSelRoleModal, { openModal: roleOpenModal }] = useModal()
// 状态
const localUserType = ref<'user' | 'role'>('user')
const assigneeId = ref('')
const assigneeDisplayName = ref('')
const confirmLoading = ref(false)
const dataId = ref('')
const deployId = ref('')
const taskId = ref('')
const hasAssignee = ref(false)
// 使用 useDrawerInner 接收外部传入的数据
const [registerBasicDrawer, { closeDrawer, setDrawerProps }] = useDrawerInner((data) => {
alert(JSON.stringify(data))
const [registerBasicDrawer, { closeDrawer }] = useDrawerInner((data) => {
if (data) {
dataId.value = data.dataId || ''
deployId.value = data.deployId || ''
if (data.assignee) {
localUserType.value = data.userType === 'role' ? 'role' : 'user'
assigneeId.value = data.assignee
if (data.assigneeName) {
assigneeDisplayName.value = data.assigneeName
}
assigneeDisplayName.value = data.assigneeName || ''
} else {
localUserType.value = data.userType === 'role' ? 'role' : 'user'
}
......@@ -146,14 +101,9 @@ const clearAssignee = () => {
}
const handleSelect = () => {
if (localUserType.value === 'user') {
userOpenModal()
} else {
roleOpenModal()
}
localUserType.value === 'user' ? userOpenModal() : roleOpenModal()
}
// 选择用户回调
const onSelectUserOk = (options: any[], values: any[]) => {
if (!values?.length) return
assigneeId.value = values[0]
......@@ -161,7 +111,6 @@ const onSelectUserOk = (options: any[], values: any[]) => {
localUserType.value = 'user'
}
// 选择角色回调
const onSelectRoleOk = (options: any[], values: any[]) => {
if (!values?.length) return
assigneeId.value = values[0]
......@@ -175,7 +124,6 @@ const handleClose = () => {
}
const handleConfirm = async () => {
confirmLoading.value = true
try {
if (dataId.value && deployId.value) {
......@@ -187,28 +135,20 @@ const handleConfirm = async () => {
taskId: myTaskFlow.taskId,
dataId: dataId.value,
comment: '',
values: {
approval: assigneeId.value,
approvalType: localUserType.value
},
values: { approval: assigneeId.value, approvalType: localUserType.value },
})
}
}
emit('success', dataId.value)
nextTick(() => {
message.success('任务发送成功')
handleClose()
})
} catch (error: any) {
} catch (error) {
emit('error', error)
} finally {
confirmLoading.value = false
}
}
// 对外暴露的方法
const getAssigneeData = () => ({
userType: localUserType.value,
assignee: assigneeId.value,
......@@ -228,110 +168,13 @@ const setRoleInfo = (roleId: string, roleNameValue: string) => {
localUserType.value = 'role'
}
defineExpose({
getAssigneeData,
submit: handleConfirm,
setUserInfo,
setRoleInfo
})
defineExpose({ getAssigneeData, submit: handleConfirm, setUserInfo, setRoleInfo })
</script>
<style scoped lang="scss">
.drawer-content {
height: 100%;
overflow-y: auto;
padding: 16px 20px;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 2px;
}
&::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 2px;
&:hover {
background: #a8a8a8;
}
}
}
.assignee-card {
height: 100%;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
:deep(.ant-card-head) {
background-color: #fafbfc;
border-bottom: 1px solid #e8eef2;
.ant-card-head-title {
font-size: 16px;
font-weight: 500;
}
}
:deep(.ant-card-body) {
padding: 24px;
height: calc(100% - 57px);
display: flex;
flex-direction: column;
}
}
.assignee-selector {
display: flex;
align-items: center;
gap: 8px;
.assignee-input {
flex: 1;
:deep(.ant-input) {
background-color: #fafafa;
cursor: pointer;
&:hover {
background-color: #fff;
}
}
}
}
.assignee-info-wrapper {
margin-top: 12px;
padding: 12px;
background-color: #fafbfc;
border-radius: 8px;
.assignee-info-label {
margin-bottom: 8px;
font-weight: 500;
color: #1f2f3d;
}
.change-btn {
margin-top: 8px;
padding-left: 0;
}
:deep(.ant-descriptions) {
.ant-descriptions-item-label {
background-color: #f5f5f5;
width: 80px;
}
}
}
.assignee-actions {
margin-top: auto;
padding-top: 24px;
text-align: center;
border-top: 1px solid #f0f0f0;
}
.drawer-content { height: 100%; overflow-y: auto; padding: 16px 20px; &::-webkit-scrollbar { width: 4px; } &::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 2px; } &::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 2px; &:hover { background: #a8a8a8; } } }
.assignee-card { height: 100%; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); :deep(.ant-card-head) { background-color: #fafbfc; border-bottom: 1px solid #e8eef2; .ant-card-head-title { font-size: 16px; font-weight: 500; } } :deep(.ant-card-body) { padding: 24px; height: calc(100% - 57px); display: flex; flex-direction: column; } }
.assignee-selector { display: flex; align-items: center; gap: 8px; .assignee-input { flex: 1; :deep(.ant-input) { background-color: #fafafa; cursor: pointer; &:hover { background-color: #fff; } } } }
.assignee-info-wrapper { margin-top: 12px; padding: 12px; background-color: #fafbfc; border-radius: 8px; .assignee-info-label { margin-bottom: 8px; font-weight: 500; color: #1f2f3d; } .change-btn { margin-top: 8px; padding-left: 0; } :deep(.ant-descriptions) { .ant-descriptions-item-label { background-color: #f5f5f5; width: 80px; } } }
.assignee-actions { margin-top: auto; padding-top: 24px; text-align: center; border-top: 1px solid #f0f0f0; }
</style>
......@@ -8,33 +8,38 @@
:minHeight="400"
:useWrapper="true"
:wrapperFooterOffset="20"
@cancel=""
@ok="handleOk"
>
<ApprovalPanel ref="approvalPanelRef" />
<ApprovalPanel ref="approvalPanelRef" @success="handleSuccess" @approval-fail="handleApprovalFail"/>
</BasicModal>
</template>
<script setup lang="ts">
import { ref, computed, watch, nextTick } from 'vue'
import { ref } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal';
import ApprovalPanel from './ApprovalPanel.vue';
import { complete, getMyTaskFlow,rejectTask, assignRead,assign } from '/@/components/Process/api/todo';
const approvalPanelRef = ref();
const emit = defineEmits(['success','approval-fail','update-form-data'])
const emit = defineEmits(['success', 'approval-fail', 'update-form-data'])
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
approvalPanelRef.value?.initFormData?.(data);
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
});
function handleOk() {
alert('handleOk');
setModalProps({confirmLoading: true});
approvalPanelRef.value.handleSaveApp();
setModalProps({confirmLoading: false});
setModalProps({ confirmLoading: true });
approvalPanelRef.value?.handleSaveApp?.();
setModalProps({ confirmLoading: false });
}
function handleSuccess(data: any) {
emit('success', data)
closeModal()
}
function handleApprovalFail(data: any) {
emit('approval-fail', data)
closeModal()
}
</script>
......@@ -30,23 +30,19 @@
</template>
<script lang="ts" setup>
import { ref, onMounted, nextTick } from 'vue';
import { ref, nextTick } from 'vue';
import { useForm, BasicForm, FormSchema } from '/@/components/Form';
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
import { complete, getMyTaskFlow, getRejectNode, rejectTask } from '/@/components/Process/api/todo';
import { complete, getMyTaskFlow, rejectTask } from '/@/components/Process/api/todo';
import { message } from 'ant-design-vue';
const emit = defineEmits(['update:visible', 'success', 'error', 'close', 'approval-fail']);
const props = defineProps({
beforeFlowNode: {
type: Object,
default: () => ({}),
},
assignee: { type: String, default: null },
userType: { type: String, default: '' },
deployId: { type: String, default: '' },
dataId: { type: String, default: '' },
});
const beforeFlowNode = ref<any>({})
const assignee = ref()
const userType = ref('')
const deployId = ref('')
const dataId = ref('')
const formSchemas: FormSchema[] = [
{
......@@ -60,7 +56,7 @@
label: '用户类型',
field: 'userType',
component: 'Input',
defaultValue: props.userType,
defaultValue: '',
ifShow: false,
},
{
......@@ -112,16 +108,17 @@
labelWidth: '120px',
size: 'large',
baseColProps: {style: { width: '100%' } },
});
const handleClose = () => {
emit('update:visible', false);
emit('close');
// emit('update:visible', false);
// emit('close');
};
const handleSaveApp = async () => {
const formDataTmp = await validate();
const myTaskFlow = await getMyTaskFlow({ deploymentId: props.deployId, dataId: props.dataId });
const myTaskFlow = await getMyTaskFlow({ deploymentId: deployId.value, dataId: dataId.value });
if (myTaskFlow?.taskId) {
const reviewStatus = formDataTmp.reviewStatus;
if (reviewStatus === true) {
......@@ -132,9 +129,13 @@
comment: formDataTmp.comment,
values: {
approval: formDataTmp.approvalUser || formDataTmp.approvalRole,
approvalType: props.userType,
approvalType: userType.value,
},
});
emit('success', {
dataId: dataId.value,
bpmNodeId: myTaskFlow.taskDefinitionKey || '',
});
} else {
await rejectTask({
instanceId: myTaskFlow.procInsId || '',
......@@ -142,18 +143,18 @@
taskId: myTaskFlow.taskId,
comment: formDataTmp.comment,
values: {
rejectNode: props.beforeFlowNode,
rejectNode: beforeFlowNode.value,
},
});
emit('approval-fail', props.dataId);
emit('approval-fail', {
dataId: dataId.value,
bpmNodeId: beforeFlowNode.value.id
});
}
}
emit('success', props.dataId);
nextTick(() => {
message.success('任务发送成功');
handleClose();
//message.success('任务发送成功');
//handleClose();
});
};
......@@ -173,7 +174,7 @@
};
const handleClickPass = async () => {
updateField(props.userType);
updateField(userType.value);
};
const updateField = (userTp) => {
......@@ -182,6 +183,7 @@
{
field: 'approvalUser',
required: true,
defaultValue: assignee.value,
ifShow: true,
},
{
......@@ -190,11 +192,18 @@
ifShow: false,
},
]);
nextTick(async () => {
await setFieldsValue({
userType: userType.value,
approvalUser: assignee.value,
})
})
} else {
updateSchema([
{
field: 'approvalRole',
required: true,
defaultValue: assignee.value,
ifShow: true,
},
{
......@@ -203,15 +212,30 @@
ifShow: false,
},
]);
nextTick(async () => {
await setFieldsValue({
userType: userType.value,
approvalRole: assignee.value,
})
})
}
};
onMounted(async () => {
updateField(props.userType);
});
const initFormData = async (data) => {
beforeFlowNode.value = data.beforeFlowNode || {}
assignee.value = data.assignee || ''
userType.value = data.userType || ''
deployId.value = data.deployId || ''
dataId.value = data.dataId || ''
nextTick(async () => {
updateField(userType.value);
})
}
defineExpose({
handleSaveApp,
initFormData,
})
</script>
......
......@@ -2,245 +2,80 @@
<a-form layout="vertical">
<a-form-item label="用户类型" required>
<a-radio-group v-model:value="localUserType" disabled>
<a-radio value="user">
<UserOutlined /> 用户
</a-radio>
<a-radio value="role">
<TeamOutlined /> 角色
</a-radio>
<a-radio value="user"><UserOutlined /> 用户</a-radio>
<a-radio value="role"><TeamOutlined /> 角色</a-radio>
</a-radio-group>
</a-form-item>
<!-- 用户/角色选择区域(未选择时) -->
<a-form-item
v-if="!assigneeId"
:label="localUserType === 'user' ? '选择用户' : '选择角色'"
>
<a-form-item v-if="!assigneeId" :label="localUserType === 'user' ? '选择用户' : '选择角色'">
<div class="assignee-selector">
<a-input
:value="assigneeDisplayName"
:placeholder="`点击'选择'按钮选择${localUserType === 'user' ? '用户' : '角色'}`"
readonly
class="assignee-input"
>
<a-input :value="assigneeDisplayName" :placeholder="`点击'选择'按钮选择${localUserType === 'user' ? '用户' : '角色'}`" readonly class="assignee-input">
<template #suffix>
<a-button type="link" size="small" @click="handleSelect">选择</a-button>
</template>
</a-input>
</div>
</a-form-item>
<!-- 已指定信息展示 -->
<div v-if="assigneeId" class="assignee-info-wrapper">
<div class="assignee-info-label">已指定{{ localUserType === 'user' ? '用户' : '角色' }}:</div>
<a-descriptions :column="2" size="small" bordered>
<a-descriptions-item :label="localUserType === 'user' ? '用户ID' : '角色ID'">
{{ assigneeId }}
</a-descriptions-item>
<a-descriptions-item :label="localUserType === 'user' ? '用户名' : '角色名'">
{{ assigneeDisplayName || '--' }}
</a-descriptions-item>
<a-descriptions-item>
<a-button type="link" size="small" @click="clearAssignee" class="change-btn">
重新选择
</a-button>
</a-descriptions-item>
<a-descriptions-item :label="localUserType === 'user' ? '用户ID' : '角色ID'">{{ assigneeId }}</a-descriptions-item>
<a-descriptions-item :label="localUserType === 'user' ? '用户名' : '角色名'">{{ assigneeDisplayName || '--' }}</a-descriptions-item>
<a-descriptions-item><a-button type="link" size="small" @click="clearAssignee" class="change-btn">重新选择</a-button></a-descriptions-item>
</a-descriptions>
</div>
<a-form-item label="说明">
<a-textarea
v-model:value="assigneeRemark"
placeholder="请输入说明"
:rows="4"
allow-clear
show-count
:maxlength="200"
/>
<a-textarea v-model:value="assigneeRemark" placeholder="请输入说明" :rows="4" allow-clear show-count :maxlength="200" />
</a-form-item>
</a-form>
<RoleSelectModal
rowKey="id"
@register="registerSelRoleModal"
@getSelectResult="onSelectRoleOk"
isRadioSelection
:showButton="false"
labelKey="roleName"
/>
<UserSelectModal
rowKey="id"
@register="registerSelUserModal"
@getSelectResult="onSelectUserOk"
isRadioSelection
:showButton="false"
labelKey="realname"
/>
<RoleSelectModal rowKey="id" @register="registerSelRoleModal" @getSelectResult="onSelectRoleOk" isRadioSelection :showButton="false" labelKey="roleName" />
<UserSelectModal rowKey="id" @register="registerSelUserModal" @getSelectResult="onSelectUserOk" isRadioSelection :showButton="false" labelKey="realname" />
</template>
<script lang="ts" setup>
import { ref, computed, watch, nextTick } from 'vue'
import { ref } from 'vue'
import { useModal } from '/@/components/Modal'
import { UserOutlined, TeamOutlined } from '@ant-design/icons-vue'
import UserSelectModal from '/@/components/Form/src/jeecg/components/modal/UserSelectModal.vue'
import RoleSelectModal from '/@/components/Form/src/jeecg/components/modal/RoleSelectModal.vue'
const emit = defineEmits(['success', 'error', 'close'])
const [registerSelUserModal, { openModal: userOpenModal }] = useModal()
const [registerSelRoleModal, { openModal: roleOpenModal }] = useModal()
// 状态
const localUserType = ref<'user' | 'role'>('user')
const assigneeId = ref('')
const assigneeDisplayName = ref('')
const assigneeRemark = ref('')
const setAssigneeData = ((data) => {
const setAssigneeData = (data: any) => {
if (data) {
if (data.assignee) {
localUserType.value = data.userType === 'role' ? 'role' : 'user'
if (data.assignee) {
assigneeId.value = data.assignee
if (data.assigneeName) {
assigneeDisplayName.value = data.assigneeName
}
} else {
localUserType.value = data.userType === 'role' ? 'role' : 'user'
}
assigneeDisplayName.value = data.assigneeName || ''
}
})
const clearAssignee = () => {
assigneeId.value = ''
assigneeDisplayName.value = ''
}
const handleSelect = () => {
if (localUserType.value === 'user') {
userOpenModal()
} else {
roleOpenModal()
}
}
const clearAssignee = () => { assigneeId.value = ''; assigneeDisplayName.value = '' }
const handleSelect = () => { localUserType.value === 'user' ? userOpenModal() : roleOpenModal() }
const onSelectUserOk = (options: any[], values: any[]) => {
if (!values?.length) return
assigneeId.value = values[0]
assigneeDisplayName.value = options[0]?.label || ''
localUserType.value = 'user'
}
const onSelectRoleOk = (options: any[], values: any[]) => {
if (!values?.length) return
assigneeId.value = values[0]
assigneeDisplayName.value = options[0]?.label || ''
localUserType.value = 'role'
}
const getAssigneeData = () => ({ userType: localUserType.value, assignee: assigneeId.value, name: assigneeDisplayName.value, remark: assigneeRemark.value })
// 对外暴露的方法
const getAssigneeData = () => ({
userType: localUserType.value,
assignee: assigneeId.value,
name: assigneeDisplayName.value,
remark: assigneeRemark.value
})
defineExpose({
setAssigneeData,
getAssigneeData,
})
defineExpose({ setAssigneeData, getAssigneeData })
</script>
<style scoped lang="scss">
.drawer-content {
height: 100%;
overflow-y: auto;
padding: 16px 20px;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 2px;
}
&::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 2px;
&:hover {
background: #a8a8a8;
}
}
}
.assignee-card {
height: 100%;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
:deep(.ant-card-head) {
background-color: #fafbfc;
border-bottom: 1px solid #e8eef2;
.ant-card-head-title {
font-size: 16px;
font-weight: 500;
}
}
:deep(.ant-card-body) {
padding: 24px;
height: calc(100% - 57px);
display: flex;
flex-direction: column;
}
}
.assignee-selector {
display: flex;
align-items: center;
gap: 8px;
.assignee-input {
flex: 1;
:deep(.ant-input) {
background-color: #fafafa;
cursor: pointer;
&:hover {
background-color: #fff;
}
}
}
}
.assignee-info-wrapper {
margin-top: 12px;
padding: 12px;
background-color: #fafbfc;
border-radius: 8px;
.assignee-info-label {
margin-bottom: 8px;
font-weight: 500;
color: #1f2f3d;
}
.change-btn {
margin-top: 8px;
padding-left: 0;
}
:deep(.ant-descriptions) {
.ant-descriptions-item-label {
background-color: #f5f5f5;
width: 80px;
}
}
}
.assignee-actions {
margin-top: auto;
padding-top: 24px;
text-align: center;
border-top: 1px solid #f0f0f0;
}
.assignee-selector { display: flex; align-items: center; gap: 8px; .assignee-input { flex: 1; :deep(.ant-input) { background-color: #fafafa; cursor: pointer; &:hover { background-color: #fff; } } } }
.assignee-info-wrapper { margin-top: 12px; padding: 12px; background-color: #fafbfc; border-radius: 8px; .assignee-info-label { margin-bottom: 8px; font-weight: 500; color: #1f2f3d; } .change-btn { margin-top: 8px; padding-left: 0; } :deep(.ant-descriptions) { .ant-descriptions-item-label { background-color: #f5f5f5; width: 80px; } } }
</style>
......@@ -16,8 +16,6 @@
<script setup lang="ts">
import { BasicModal, useModalInner } from '/@/components/Modal';
import ApprovalPanel from './ApprovalPanel.vue';
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
});
......
......@@ -21,35 +21,29 @@
import { ref } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal';
import AssigneePanel from './AssigneePanel.vue';
import { complete, getMyTaskFlow,rejectTask, assignRead,assign } from '/@/components/Process/api/todo';
import { message } from 'ant-design-vue';
import { complete, getMyTaskFlow, rejectTask, assignRead, assign } from '/@/components/Process/api/todo';
const emit = defineEmits(['success','approval-fail','update-form-data'])
const emit = defineEmits(['success', 'approval-fail', 'update-form-data'])
const taskTitle = ref('任务')
const sending = ref(false);
const taskType = ref<any>({});
const taskType = ref<any>(null);
const refAssigneePanel = ref<any>(null);
const myTaskFlow = ref<any>({});
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
taskTitle.value = data?.taskTitle || '任务'
taskType.value = data?.taskType || "";
refAssigneePanel.value.setAssigneeData(data);
myTaskFlow.value = await getMyTaskFlow({
deploymentId: data?.deployId || '',
dataId: data?.dataId || '',
})
taskType.value = data?.taskType || ''
refAssigneePanel.value?.setAssigneeData(data)
myTaskFlow.value = await getMyTaskFlow({ deploymentId: data?.deployId || '', dataId: data?.dataId || '' })
});
const handleTaskOk = async () => {
if (sending.value) return;
if (sending.value) return
try {
sending.value = true;
const assigneeData = refAssigneePanel.value.getAssigneeData();
sending.value = true
const assigneeData = refAssigneePanel.value?.getAssigneeData() || {}
const submitData: any = {
instanceId: myTaskFlow.value.procInsId,
deployId: myTaskFlow.value.deployId,
......@@ -57,55 +51,38 @@
comment: assigneeData.remark || '',
values: {
approval: assigneeData.assignee,
approvalType: assigneeData.userType,
approvalType: assigneeData.userType
}
};
if (taskType.value === 'send') {
await handleSendTask(submitData);
} else if (taskType.value === 'reject') {
await handleRejectTask(submitData);
} else if (taskType.value === 'transmit') {
await handleTransmitTask(submitData);
} else if (taskType.value === 'read') {
await handleReadTask(submitData);
}
//message.success('操作成功');
emit('success', submitData);
closeThisModal();
} catch (error: any) {
if (taskType.value === 'send') await handleSendTask(submitData)
else if (taskType.value === 'reject') await handleRejectTask(submitData)
else if (taskType.value === 'transmit') await handleTransmitTask(submitData)
else if (taskType.value === 'read') await handleReadTask(submitData)
emit('success', submitData)
closeThisModal()
} catch (error) {
console.error('任务操作失败:', error)
} finally {
sending.value = false;
sending.value = false
}
}
const handleSendTask = async (submitData: any) => {
const result = await complete(submitData);
return false;
};
const handleRejectTask = async (submitData) => {
const result = await rejectTask(submitData);
return false;
};
const handleReadTask = async (submitData) => {
const result = await assignRead(submitData);
return false;
};
const handleTransmitTask = async (submitData) => {
const result = await assign(submitData);
return false;
};
const closeThisModal = () => {
closeModal();
}
const handleSendTask = async (submitData: any) => {
await complete(submitData)
}
const handleRejectTask = async (submitData: any) => {
await rejectTask(submitData)
}
const handleReadTask = async (submitData: any) => {
alert(JSON.stringify(submitData))
await assignRead(submitData)
}
const handleTransmitTask = async (submitData: any) => {
await assign(submitData)
}
const closeThisModal = () => { closeModal() }
</script>
<style scoped lang="scss">
.assignee-panel-wrapper{
padding: 0px;
}
.assignee-panel-wrapper { padding: 0px; }
</style>
......@@ -220,7 +220,7 @@ export const formSchema: FormSchema[] = [
},
{
label: '流程节点顺序号',
field: 'bmpNodeId',
field: 'bpmNodeId',
component: 'Input',
},
{
......@@ -327,7 +327,7 @@ export const superQuerySchema = {
execEndDate: {title: '整改结束时间',order: 22,view: 'date', type: 'string',},
execRemark: {title: '整改落实情况',order: 23,view: 'textarea', type: 'string',},
reviewComment: {title: '审核意见',order: 24,view: 'textarea', type: 'string',},
bmpNodeId: {title: '流程节点顺序号',order: 25,view: 'text', type: 'string',},
bpmNodeId: {title: '流程节点顺序号',order: 25,view: 'text', type: 'string',},
bpmStatus: {title: '流程状态',order: 26,view: 'text', type: 'string',},
deployId: {title: '部署ID',order: 27,view: 'text', type: 'string',},
createdUser: {title: '创建人',order: 28,view: 'text', type: 'string',},
......
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #tableTitle></template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<!-- 整改执行 -->
<StProblemCheckExecuteModal @register="registerExecuteModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="problem-stProblemCheck" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { list,problemArchive} from './StProblemCheck.api';
import StProblemCheckExecuteModal from './components/StProblemCheckExecuteModal.vue';
const emit = defineEmits(['callback','openMultiForm'])
import { columns } from './StProblemCheck.data';
import { list, problemArchive } from './StProblemCheck.api';
const props = defineProps({
currentFlowNode: {
type: Object,
default: () => ({})
},
})
currentFlowNode: { type: Object, default: () => ({}) },
});
const emit = defineEmits(['callback', 'openMultiForm']);
//注册model
const [registerExecuteModal, { openModal: openExecuteModal }] = useModal();
//注册table数据
const { prefixCls, tableContext } = useListPage({
const { tableContext } = useListPage({
tableProps: {
title: '问题归档',
api: list,
columns,
canResize: false,
beforeFetch(params) {
params['bmpNodeId'] = props.currentFlowNode.id
},
actionColumn: {
width: 200,
fixed: 'right',
params['bpmNodeId'] = props.currentFlowNode.id;
},
actionColumn: { width: 200, fixed: 'right' },
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleArchive(record: Recordable) {
problemArchive({id: record.id, }).then(handleSuccess);
problemArchive({ id: record.id }).then(handleSuccess);
}
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
selectedRowKeys.value = [];
reload();
}
function getTableAction(record) {
return [
{
label: '问题归档',
onClick: handleArchive.bind(null, record),
},
];
return [{ label: '问题归档', onClick: handleArchive.bind(null, record) }];
}
</script>
<style scoped></style>
import {defHttp} from '/@/utils/http/axios';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
const enum Api {
list = '/problem/stProblemCheck/list',
save='/problem/stProblemCheck/add',
edit='/problem/stProblemCheck/edit',
......@@ -12,35 +12,22 @@ enum Api {
importExcel = '/problem/stProblemCheck/importExcel',
exportXls = '/problem/stProblemCheck/exportXls',
problemArchive = '/problem/stProblemCheck/problemArchive',
queryById = '/problem/stProblemCheck/queryById',
}
/**
* 导出api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* 导入api
*/
export const getImportUrl = Api.importExcel;
/**
* 列表接口
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
* 删除单个
*/
export const deleteOne = (params,handleSuccess) => {
export const list = (params) => defHttp.get({url: Api.list, params});
export const queryById = (params) => defHttp.get({url: Api.queryById, params});
export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
handleSuccess?.();
});
}
/**
* 批量删除
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
......@@ -50,26 +37,16 @@ export const batchDelete = (params, handleSuccess) => {
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
handleSuccess?.();
});
}
});
}
/**
* 保存或者更新
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
export const saveOrUpdate = (params, isUpdate = false) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}
/**
* 保存或者更新
* @param params
*/
export const problemArchive = (params) => {
let url = Api.problemArchive;
return defHttp.post({url: url, params});
}
export const problemArchive = (params) => defHttp.post({url: Api.problemArchive, params});
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '问题编号',
......@@ -357,29 +357,14 @@ export const reviewFormSchema: FormSchema[] = [
},
];
/**
* 流程表单调用这个方法获取formSchema-默认弹窗(查看详情)
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}
/**
* 流程表单调用这个方法获取formSchema-整改计划
* @param param
*/
export function getPlanFormSchema(_planFormSchema): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return planFormSchema;
}
/**
* 流程表单调用这个方法获取formSchema-整改执行
* @param param
*/
export function getExecuteFormSchema(_executeFormSchema): FormSchema[] {
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return executeFormSchema;
}
......@@ -18,50 +18,35 @@
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<!-- 表单区域 -->
<StProblemCheckModal @register="registerModal" @success="handleSuccess" :center="true" />
</div>
</template>
<script lang="ts" name="problem-stProblemCheck" setup>
import { ref } from 'vue';
import { ref, unref } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { Icon } from '/@/components/Icon';
import { useListPage } from '/@/hooks/system/useListPage';
import StProblemCheckModal from './components/StProblemCheckModal.vue';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,saveOrUpdate } from './StProblemCheck.api';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './StProblemCheck.api';
const props = defineProps({
beforeFlowNode: {
type: Object,
default: () => ({})
},
currentFlowNode: {
type: Object,
default: () => ({})
},
nextFlowNode: {
type: Object,
default: () => ({})
},
todoList: {
type: Array,
default: () => []
}
})
beforeFlowNode: { type: Object, default: () => ({}) },
currentFlowNode: { type: Object, default: () => ({}) },
nextFlowNode: { type: Object, default: () => ({}) },
todoList: { type: Array, default: () => [] },
});
const emit = defineEmits(['callback','startWorkFlow','sendWorkFlow','openMultiForm'])
const emit = defineEmits(['callback', 'startWorkFlow', 'sendWorkFlow', 'openMultiForm']);
//注册model
const [registerModal, { openModal }] = useModal();
const [registerPlanModal, { openModal: openPlanModal }] = useModal();
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '问题整改',
......@@ -69,55 +54,31 @@
columns,
canResize: false,
beforeFetch(params) {
params['bmpNodeId'] = props.currentFlowNode.id
params['todoList'] = props.todoList
},
actionColumn: {
width: 200,
fixed: 'right',
},
},
exportConfig: {
name: '问题整改',
url: getExportUrl,
params['bpmNodeId'] = props.currentFlowNode.id;
params['todoList'] = props.todoList;
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
actionColumn: { width: 200, fixed: 'right' },
},
exportConfig: { name: '问题整改', url: getExportUrl },
importConfig: { url: getImportUrl, success: handleSuccess },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
record: {
bmpNodeId: props.currentFlowNode.id,
deployId: props.currentFlowNode.deployId,
bpmStatus: 0,
}
record: { bpmNodeId: props.currentFlowNode.id, deployId: props.currentFlowNode.deployId, bpmStatus: 0 },
});
}
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
openModal(true, { record, isUpdate: true, showFooter: false });
}
async function handleDelete(record) {
......@@ -125,77 +86,50 @@
}
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
await batchDelete({ ids: unref(selectedRowKeys) }, handleSuccess);
}
function handleSuccess(retData) {
(selectedRowKeys.value = []) && reload();
if(retData){
emit('startWorkFlow',retData)
}
selectedRowKeys.value = [];
reload();
if (retData) emit('startWorkFlow', retData);
}
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '发送任务',
onClick: handleFlow.bind(null, record),
},
{ label: '编辑', onClick: handleEdit.bind(null, record) },
{ label: '发送任务', onClick: handleFlow.bind(null, record) },
];
}
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
},
];
}
async function handleFlow(record: Recordable) {
emit("sendWorkFlow",record)
emit('sendWorkFlow', record);
}
async function handleUpdate(dataId,flowNode) {
let record = {
bmpNodeId: flowNode.id,
deployId: flowNode.deployId,
bpmStatus: 2,
id:dataId
}
await saveOrUpdate(record,true).then(res => {
(selectedRowKeys.value = []) && reload();
})
async function handleUpdate(dataId, flowNode) {
const record = { bpmNodeId: flowNode.id, deployId: flowNode.deployId, bpmStatus: 2, id: dataId };
await saveOrUpdate(record, true);
selectedRowKeys.value = [];
reload();
}
async function handleStartUpdate(flowData) {
let record = {
procInsId: flowData.procInsId,
id:flowData.dataId,
bpmStatus: 0,
}
await saveOrUpdate(record,true).then(res => {
const record = { procInsId: flowData.procInsId, id: flowData.dataId, bpmStatus: 0 };
await saveOrUpdate(record, true);
handleSuccess(null);
})
}
defineExpose({
handleUpdate,
handleStartUpdate
})
defineExpose({ handleUpdate, handleStartUpdate });
</script>
<style scoped></style>
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #tableTitle></template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<!-- 整改执行 -->
<StProblemCheckExecuteModal @register="registerExecuteModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="problem-stProblemCheck" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { columns } from './StProblemCheck.data';
import { list, saveOrUpdate } from './StProblemCheck.api';
import StProblemCheckExecuteModal from './components/StProblemCheckExecuteModal.vue';
const emit = defineEmits(['callback','sendWorkFlow','openMultiForm'])
const props = defineProps({
beforeFlowNode: {
type: Object,
default: () => ({})
},
currentFlowNode: {
type: Object,
default: () => ({})
},
nextFlowNode: {
type: Object,
default: () => ({})
}
})
beforeFlowNode: { type: Object, default: () => ({}) },
currentFlowNode: { type: Object, default: () => ({}) },
nextFlowNode: { type: Object, default: () => ({}) },
});
const emit = defineEmits(['callback', 'sendWorkFlow', 'openMultiForm']);
//注册model
const [registerExecuteModal, { openModal: openExecuteModal }] = useModal();
//注册table数据
const { prefixCls, tableContext } = useListPage({
const { tableContext } = useListPage({
tableProps: {
title: '计划执行审批',
api: list,
columns,
canResize: true,
beforeFetch(params) {
params['bmpNodeId'] = props.currentFlowNode.id
},
actionColumn: {
width: 200,
fixed: 'right',
params['bpmNodeId'] = props.currentFlowNode.id;
},
actionColumn: { width: 200, fixed: 'right' },
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleExecuteApproval(record: Recordable) {
emit("openMultiForm",record)
emit('openMultiForm', record);
}
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
function handleSendNext(record: Recordable) {
emit('sendWorkFlow', record);
}
function handleSendNext(record: Recordable) {
emit("sendWorkFlow",record)
function handleSuccess() {
selectedRowKeys.value = [];
reload();
}
function getTableAction(record) {
return [
{
label: '整改审核',
onClick: handleExecuteApproval.bind(null, record),
},
{
label: '提交',
onClick: handleSendNext.bind(null, record),
},
{ label: '整改审核', onClick: handleExecuteApproval.bind(null, record) },
{ label: '提交', onClick: handleSendNext.bind(null, record) },
];
}
async function handleUpdate(dataId) {
await saveOrUpdate({
bmpNodeId: props.nextFlowNode.id,
id:dataId,
},true).then(res => {
await saveOrUpdate({ bpmNodeId: props.nextFlowNode?.id, id: dataId }, true);
handleSuccess();
})
}
defineExpose({
handleUpdate,
})
defineExpose({ handleUpdate });
</script>
<style scoped></style>
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #tableTitle></template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<!-- 整改执行 -->
<StProblemCheckExecuteModal @register="registerExecuteModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="problem-stProblemCheck" setup>
import { ref } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { columns } from './StProblemCheck.data';
import { list, saveOrUpdate } from './StProblemCheck.api';
import StProblemCheckExecuteModal from './components/StProblemCheckExecuteModal.vue';
const emit = defineEmits(['callback','sendWorkFlow','openMultiForm'])
const props = defineProps({
beforeFlowNode: {
type: Object,
default: () => ({})
},
currentFlowNode: {
type: Object,
default: () => ({})
},
nextFlowNode: {
type: Object,
default: () => ({})
}
})
beforeFlowNode: { type: Object, default: () => ({}) },
currentFlowNode: { type: Object, default: () => ({}) },
nextFlowNode: { type: Object, default: () => ({}) },
});
const emit = defineEmits(['callback', 'sendWorkFlow', 'openMultiForm']);
//注册model
const [registerExecuteModal, { openModal: openExecuteModal }] = useModal();
//注册table数据
const { prefixCls, tableContext } = useListPage({
const { tableContext } = useListPage({
tableProps: {
title: '问题整改',
api: list,
columns,
canResize: true,
beforeFetch(params) {
params['bmpNodeId'] = props.currentFlowNode.id
},
actionColumn: {
width: 200,
fixed: 'right',
params['bpmNodeId'] = props.currentFlowNode.id;
},
actionColumn: { width: 200, fixed: 'right' },
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleExecute(record: Recordable) {
emit("openMultiForm",record)
emit('openMultiForm', record);
}
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
function handleSendNext(record: Recordable) {
emit('sendWorkFlow', record);
}
function handleSendNext(record: Recordable) {
emit("sendWorkFlow",record)
function handleSuccess() {
selectedRowKeys.value = [];
reload();
}
function getTableAction(record) {
return [
{
label: '整改执行',
onClick: handleExecute.bind(null, record),
},
{
label: '提交',
onClick: handleSendNext.bind(null, record),
},
{ label: '整改执行', onClick: handleExecute.bind(null, record) },
{ label: '提交', onClick: handleSendNext.bind(null, record) },
];
}
async function handleUpdate(dataId,flowNode) {
let record = {
bmpNodeId: flowNode.id,
deployId: flowNode.deployId,
bpmStatus: 2,
id:dataId
}
await saveOrUpdate(record,true).then(res => {
async function handleUpdate(dataId, flowNode) {
const record = { bpmNodeId: flowNode.id, deployId: flowNode.deployId, bpmStatus: 2, id: dataId };
await saveOrUpdate(record, true);
handleSuccess();
})
}
defineExpose({
handleUpdate,
})
defineExpose({ handleUpdate });
</script>
<style scoped></style>
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #tableTitle></template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<!-- 整改执行 -->
<StProblemCheckExecuteModal @register="registerExecuteModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="problem-stProblemCheck" setup>
import { ref } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { columns } from './StProblemCheck.data';
import { list, saveOrUpdate } from './StProblemCheck.api';
import StProblemCheckExecuteModal from './components/StProblemCheckExecuteModal.vue';
const props = defineProps({
beforeFlowNode: {
type: Object,
default: () => ({})
},
currentFlowNode: {
type: Object,
default: () => ({})
},
nextFlowNode: {
type: Object,
default: () => ({})
}
})
beforeFlowNode: { type: Object, default: () => ({}) },
currentFlowNode: { type: Object, default: () => ({}) },
nextFlowNode: { type: Object, default: () => ({}) },
});
const emit = defineEmits(['callback','sendWorkFlow','openMultiForm'])
const emit = defineEmits(['callback', 'sendWorkFlow', 'openMultiForm']);
//注册model
const [registerExecuteModal, { openModal: openExecuteModal }] = useModal();
//注册table数据
const { prefixCls, tableContext } = useListPage({
const { tableContext } = useListPage({
tableProps: {
title: '问题整改',
api: list,
columns,
canResize: false,
beforeFetch(params) {
params['bmpNodeId'] = props.currentFlowNode.id
},
actionColumn: {
width: 200,
fixed: 'right',
params['bpmNodeId'] = props.currentFlowNode.id;
},
actionColumn: { width: 200, fixed: 'right' },
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handlePlanApproval(record: Recordable) {
emit("openMultiForm",record)
emit('openMultiForm', record);
}
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
function handleSendNext(record: Recordable) {
emit('sendWorkFlow', record);
}
function handleSendNext(record: Recordable) {
emit("sendWorkFlow",record)
function handleSuccess() {
selectedRowKeys.value = [];
reload();
}
function getTableAction(record) {
return [
{
label: '计划审核',
onClick: handlePlanApproval.bind(null, record),
},
// {
// label: '提交',
// onClick: handleSendNext.bind(null, record),
// },
{ label: '计划审核', onClick: handlePlanApproval.bind(null, record) },
];
}
async function handleUpdate(dataId,flowNode) {
let record = {
bmpNodeId: flowNode.id,
deployId: flowNode.deployId,
bpmStatus: 2,
id:dataId
}
await saveOrUpdate(record,true).then(res => {
async function handleUpdate(dataId, flowNode) {
const record = { bpmNodeId: flowNode.id, deployId: flowNode.deployId, bpmStatus: 2, id: dataId };
await saveOrUpdate(record, true);
handleSuccess();
})
}
defineExpose({
handleUpdate,
})
defineExpose({ handleUpdate });
</script>
<style scoped></style>
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #tableTitle></template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<!-- 整改执行 -->
<StProblemCheckExecuteModal @register="registerExecuteModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" name="problem-stProblemCheck" setup>
import { ref } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from './StProblemCheck.data';
import { list,saveOrUpdate} from './StProblemCheck.api';
import StProblemCheckExecuteModal from './components/StProblemCheckExecuteModal.vue';
const emit = defineEmits(['callback','sendWorkFlow','openMultiForm'])
import { columns } from './StProblemCheck.data';
import { list, saveOrUpdate } from './StProblemCheck.api';
const props = defineProps({
beforeFlowNode: {
type: Object,
default: () => ({})
},
currentFlowNode: {
type: Object,
default: () => ({})
},
nextFlowNode: {
type: Object,
default: () => ({})
}
})
beforeFlowNode: { type: Object, default: () => ({}) },
currentFlowNode: { type: Object, default: () => ({}) },
nextFlowNode: { type: Object, default: () => ({}) },
});
const [registerExecuteModal, { openModal: openExecuteModal }] = useModal();
const { prefixCls, tableContext } = useListPage({
const emit = defineEmits(['callback', 'sendWorkFlow', 'openMultiForm']);
const { tableContext } = useListPage({
tableProps: {
title: '问题整改计划',
api: list,
columns,
canResize: false,
beforeFetch(params) {
params['bmpNodeId'] = props.currentFlowNode.id
},
actionColumn: {
width: 200,
fixed: 'right',
params['bpmNodeId'] = props.currentFlowNode.id;
},
actionColumn: { width: 200, fixed: 'right' },
},
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handlePlan(record: Recordable) {
emit("openMultiForm",record)
emit('openMultiForm', record);
}
async function handleSendNext(record: Recordable) {
emit("sendWorkFlow",record)
function handleSendNext(record: Recordable) {
emit('sendWorkFlow', record);
}
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
selectedRowKeys.value = [];
reload();
}
function getTableAction(record) {
return [
{
label: '制定计划',
onClick: handlePlan.bind(null, record),
},
{
label: '提交',
onClick: handleSendNext.bind(null, record),
},
{ label: '制定计划', onClick: handlePlan.bind(null, record) },
{ label: '提交', onClick: handleSendNext.bind(null, record) },
];
}
async function handleUpdate(dataId,flowNode) {
let record = {
bmpNodeId: flowNode.id,
deployId: flowNode.deployId,
bpmStatus: 2,
id:dataId
}
await saveOrUpdate(record,true).then(res => {
async function handleUpdate(dataId, flowNode) {
const record = { bpmNodeId: flowNode.id, deployId: flowNode.deployId, bpmStatus: 2, id: dataId };
await saveOrUpdate(record, true);
handleSuccess();
})
}
defineExpose({
handleUpdate,
})
defineExpose({ handleUpdate });
</script>
<style scoped></style>
<template>
<div>
<vxe-drawer
show-confirm-button
show-cancel-button
v-model="showPopup"
:title="pageTilte"
width="100%"
height="100%"
:loading="loading"
>
<iframe
id="iframeId"
ref="iframeRef"
:src="frmUrl"
frameborder="0"
style="width: 100%; height: 100%;"
></iframe>
</vxe-drawer>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted,nextTick } from "vue";
import { useUserStoreWithOut } from "/@/store/modules/user";
import { defHttp } from '/@/utils/http/axios';
import { getToken } from '/@/utils/auth';
const user = useUserStoreWithOut();
const showPopup = ref(false);
const frmUrl = ref("");
const loading = ref(false);
const pageTilte = ref("");
const iframeRef = ref<HTMLIFrameElement>();
const iniPage = async (data) => {
pageTilte.value = data.projectName;
showPopup.value = true;
frmUrl.value = `${import.meta.env.VITE_APP_JFLOW_CORE_ADDR}/#/WF/MyFlow?FlowNo=102&Token=${user.getJflowToken}&tid=${data.id}`;
const setSourctUrl = '/api/jflow/setCCWorkId';
await defHttp.get({
url: setSourctUrl,
params: {"targetId":data.id,"targetKey":"targetKey","token":getToken()},
});
}
// 暴露方法
defineExpose({ iniPage });
</script>
......@@ -38,32 +38,17 @@
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { ref, reactive, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { Form } from 'ant-design-vue';
import { useTabs } from '/@/hooks/web/useTabs';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import { useUserStoreWithOut } from '/@/store/modules/user';
import { useRouter } from 'vue-router';
import { getAuthCache, setAuthCache, removeAuthCache } from '/@/utils/auth';
import { TOKEN_KEY } from '/@/enums/cacheEnum';
import { useUserStore } from '/@/store/modules/user';
const router = useRouter();
const user = useUserStoreWithOut();
const { closeCurrent, refreshPage, setTitle } = useTabs();
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => {} },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true },
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
......@@ -72,65 +57,36 @@
problemSource: '',
isReceive: '',
programme: '',
labels: '',
actIds: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
const loading = ref(false);
//表单验证
const validatorRules = {};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
const disabled = ref<boolean>(true);
const labelCol = ref({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref(false);
const disabled = ref(true);
const listAll = '/problem/stProblemCheck/queryById';
// 从URL获取参数
const getUrlParams = () => {
const winurl = window.location.href;
const params = new URLSearchParams(winurl.split('?')[1]);
return {
cctoken: params.get('Token') || '',
WorkID: params.get('WorkID') || '',
};
return { cctoken: params.get('Token') || '', WorkID: params.get('WorkID') || '' };
};
const iniData = async () => {
try {
loading.value = true;
confirmLoading.value = true;
const { cctoken, WorkID } = getUrlParams();
console.log('Token:', cctoken, 'WorkID:', WorkID);
const timestamp = new Date().getTime();
const gettokeyUrl = '/api/jflow/getCCWorkTokenAndTid';
const { tid, token } = await defHttp.get({
url: gettokeyUrl,
params: {
targetKey: 'targetKey',
flowToken: cctoken,
WorkID: WorkID,
_t: timestamp,
},
params: { targetKey: 'targetKey', flowToken: cctoken, WorkID: WorkID, _t: timestamp },
});
console.log('问题整改tid ', tid);
// setAuthCache(TOKEN_KEY, token);
//params: { id: tid, token: token, "_t": timestamp },
defHttp.get({ url: listAll, params: { token: token, id: tid } }).then((res) => {
console.log('res ', res);
defHttp.get({ url: listAll, params: { token, id: tid } }).then((res) => {
formData.problemItem = res.problemItem;
formData.problemDes = res.problemDes;
formData.problemSource = res.problemSource;
if (res.isReceive == '1') {
formData.isReceive = '是';
} else {
formData.isReceive = '否';
}
formData.isReceive = res.isReceive == '1' ? '是' : '否';
formData.programme = res.programme;
formData.strategy = res.strategy;
});
......@@ -138,21 +94,18 @@
console.error('初始化表单数据失败:', error);
createMessage.error('初始化表单数据失败');
} finally {
loading.value = false;
confirmLoading.value = false;
}
};
onMounted(async () => {
iniData();
});
onMounted(() => { iniData(); });
defineExpose({});
</script>
<style lang="less" scoped>
.antd-modal-form {
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
padding: 24px;
}
</style>
......@@ -47,7 +47,7 @@
try {
let values = await validate();
values.bpmStatus = bpmFlowData.value?.bpmStatus || '';
values.bmpNodeId = bpmFlowData.value?.bmpNodeId || '';
values.bpmNodeId = bpmFlowData.value?.bpmNodeId || '';
values.deployId = bpmFlowData.value?.deployId || '';
setModalProps({ confirmLoading: true });
//提交表单
......
......@@ -65,12 +65,11 @@
}
// 保存按钮
async function saveForm() {
async function saveForm(formData) {
try {
let data = getFieldsValue();
let params = Object.assign({}, currentFormData.value, data);
const result = await saveOrUpdate(params, true);
const result = await saveOrUpdate(formData, true);
alert(JSON.stringify(result))
// 保存成功后更新表单
if (result && result.id) {
await initFormData(result.id);
......
import { ref, computed } from 'vue';
import { useListPage } from '/@/hooks/system/useListPage';
import { list, saveOrUpdate } from '../StProblemCheck.api';
import { columns } from '../StProblemCheck.data';
export function useProblemList(props) {
const { tableContext, reload } = useListPage({
tableProps: {
title: props?.title || '问题整改',
api: list,
columns,
canResize: props?.canResize ?? false,
beforeFetch(params) {
if (props?.currentFlowNode?.id) {
params['bpmNodeId'] = props.currentFlowNode.id;
}
if (props?.todoList) {
params['todoList'] = props.todoList;
}
},
actionColumn: {
width: 200,
fixed: 'right',
},
},
exportConfig: {
name: '问题整改',
url: '/problem/stProblemCheck/exportXls',
},
importConfig: {
url: '/problem/stProblemCheck/importExcel',
},
});
const [registerTable, , { rowSelection, selectedRowKeys }] = tableContext;
async function handleUpdate(dataId, flowNode) {
const record = {
bpmNodeId: flowNode.id,
deployId: flowNode.deployId,
bpmStatus: 2,
id: dataId,
};
await saveOrUpdate(record, true);
selectedRowKeys.value = [];
reload();
}
function handleSuccess() {
selectedRowKeys.value = [];
reload();
}
return {
registerTable,
reload,
rowSelection,
selectedRowKeys,
handleUpdate,
handleSuccess,
};
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论