提交 5a8e52f3 authored 作者: liuluyu's avatar liuluyu

计划管理流转记录更新

上级 ae0a6c59
...@@ -57,20 +57,20 @@ ...@@ -57,20 +57,20 @@
<div class="content-wrapper"> <div class="content-wrapper">
<!-- 左侧主表单 --> <!-- 左侧主表单 -->
<div class="main-form-section"> <div class="main-form-section">
<a-card title="审批表单" :bordered="false" class="form-card"> <!-- <a-card title="审批表单" :bordered="false" class="form-card">
<template #extra> <template #extra>
<a-button type="link" @click="refreshForm"> <ReloadOutlined /> 刷新 </a-button> <a-button type="link" @click="refreshForm"> <ReloadOutlined /> 刷新 </a-button>
</template> </template> -->
<div class="form-content"> <div class="form-card">
<div v-show="formTp == 1" class="form-wrapper"> <div v-show="formTp == 1" class="form-wrapper">
<FlowInnerForm ref="refCruInnerForm" :key="formKey" style="width: 100%" /> <FlowInnerForm ref="refCruInnerForm" :key="formKey" style="width: 100%; height: 100%" />
</div>
<div v-show="formTp == 2" class="iframe-container" style="height: 470px">
<iFrame :key="formKey" :src="formUrl" class="responsive-iframe" style="width: 100%; height: 100%" />
</div>
</div> </div>
</a-card> <div v-show="formTp == 2" class="form-wrapper">
<iFrame :key="formKey" :src="formUrl" class="responsive-iframe" style="width: 100%; height: 100%" />
</div>
</div>
<!-- </a-card> -->
</div> </div>
<!-- 右侧审批栏 --> <!-- 右侧审批栏 -->
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
// API // API
import { flowRecord } from '/@/components/Process/api/finished'; import { flowRecord } from '/@/components/Process/api/finished';
import { flowXmlAndNode } from '/@/components/Process/api/definition'; import { flowXmlAndNode } from '/@/components/Process/api/definition';
import { complete, flowTaskForm, getNextFlowNode, getMyTaskFlow,assign,assignRead } from '/@/components/Process/api/todo'; import { complete, flowTaskForm, getNextFlowNode, getMyTaskFlow, assign, assignRead } from '/@/components/Process/api/todo';
import { flowTaskInfo } from '/@/components/Process/api/process'; import { flowTaskInfo } from '/@/components/Process/api/process';
// 组件 // 组件
...@@ -723,8 +723,8 @@ ...@@ -723,8 +723,8 @@
} }
}; };
//转办处理 //转办处理
const handleAssignTask = async () => { const handleAssignTask = async () => {
if (assigning.value) return; if (assigning.value) return;
try { try {
assigning.value = true; assigning.value = true;
...@@ -738,33 +738,32 @@ ...@@ -738,33 +738,32 @@
const formData = await validate(); const formData = await validate();
Object.assign(submitData, formData); Object.assign(submitData, formData);
submitData.comment = submitData.comment || ''; submitData.comment = submitData.comment || '';
//test1 1958436761110269953 //test1 1958436761110269953
// submitData.values['targetUserId'] = '1959869916657950721'; // submitData.values['targetUserId'] = '1959869916657950721';
if (userType.value === 'user') { if (userType.value === 'user') {
submitData.values['targetUserId'] = formData.checkSendUser;
submitData.values['approvalType'] = 'user';
if (formData.checkSendUser) {
submitData.values['targetUserId'] = formData.checkSendUser; submitData.values['targetUserId'] = formData.checkSendUser;
submitData.values['approvalType'] = 'user'; submitData.values['approvalType'] = 'user';
if (formData.checkSendUser) {
submitData.values['targetUserId'] = formData.checkSendUser;
submitData.values['approvalType'] = 'user';
}
} else if (formData.checkSendRole) {
submitData.values['targetUserId'] = formData.checkSendRole;
submitData.values['approvalType'] = 'role';
} }
const dataId = formUrl.value.split('=').pop(); } else if (formData.checkSendRole) {
submitData.values['dataId'] = dataId; submitData.values['targetUserId'] = formData.checkSendRole;
submitData.values['approvalType'] = 'role';
const lastEqualIndex = formUrl.value.lastIndexOf('='); }
// 往前找到 & 或 ? 的位置 const dataId = formUrl.value.split('=').pop();
let startIndex = formUrl.value.lastIndexOf('&', lastEqualIndex); submitData.values['dataId'] = dataId;
if (startIndex === -1) {
startIndex = formUrl.value.lastIndexOf('?', lastEqualIndex); const lastEqualIndex = formUrl.value.lastIndexOf('=');
} // 往前找到 & 或 ? 的位置
const dataName = formUrl.value.substring(startIndex + 1, lastEqualIndex); let startIndex = formUrl.value.lastIndexOf('&', lastEqualIndex);
submitData.values['dataName'] = dataName; if (startIndex === -1) {
startIndex = formUrl.value.lastIndexOf('?', lastEqualIndex);
}
const dataName = formUrl.value.substring(startIndex + 1, lastEqualIndex);
submitData.values['dataName'] = dataName;
// 执行发送 // 执行发送
const result = await assign(submitData); const result = await assign(submitData);
...@@ -784,8 +783,8 @@ ...@@ -784,8 +783,8 @@
} }
}; };
//转阅处理 //转阅处理
const handleAssignReadTask = async () => { const handleAssignReadTask = async () => {
if (assiReadgning.value) return; if (assiReadgning.value) return;
try { try {
assiReadgning.value = true; assiReadgning.value = true;
...@@ -799,23 +798,21 @@ ...@@ -799,23 +798,21 @@
const formData = await validate(); const formData = await validate();
Object.assign(submitData, formData); Object.assign(submitData, formData);
submitData.comment = submitData.comment || ''; submitData.comment = submitData.comment || '';
//test1 1958436761110269953 //test1 1958436761110269953
// submitData.values['targetUserId'] = '1959869916657950721'; // submitData.values['targetUserId'] = '1959869916657950721';
if (userType.value === 'user') { if (userType.value === 'user') {
submitData.values['targetUserId'] = formData.checkSendUser;
submitData.values['approvalType'] = 'user';
if (formData.checkSendUser) {
submitData.values['targetUserId'] = formData.checkSendUser; submitData.values['targetUserId'] = formData.checkSendUser;
submitData.values['approvalType'] = 'user'; submitData.values['approvalType'] = 'user';
if (formData.checkSendUser) {
submitData.values['targetUserId'] = formData.checkSendUser;
submitData.values['approvalType'] = 'user';
}
} else if (formData.checkSendRole) {
submitData.values['targetUserId'] = formData.checkSendRole;
submitData.values['approvalType'] = 'role';
} }
} else if (formData.checkSendRole) {
submitData.values['targetUserId'] = formData.checkSendRole;
submitData.values['approvalType'] = 'role';
}
// 执行发送 // 执行发送
const result = await assignRead(submitData); const result = await assignRead(submitData);
...@@ -835,8 +832,6 @@ ...@@ -835,8 +832,6 @@
} }
}; };
defineExpose({ defineExpose({
iniData, iniData,
}); });
...@@ -868,7 +863,7 @@ ...@@ -868,7 +863,7 @@
height: 100vh; height: 100vh;
margin: 0; margin: 0;
padding: 0; padding: 0;
background: linear-gradient(135deg, #b0b3c2 0%, #764ba2 100%); // background: linear-gradient(135deg, #b0b3c2 0%, #764ba2 100%);
overflow: hidden; overflow: hidden;
} }
...@@ -945,6 +940,7 @@ ...@@ -945,6 +940,7 @@
} }
.next-node-label { .next-node-label {
width: 120px;
color: #666; color: #666;
font-size: 14px; font-size: 14px;
} }
......
<template> <template>
<div class="plan-management-page"> <div class="plan-management-page">
<!-- 页面头部区域 -->
<!-- <div class="page-header">
<div class="header-content">
<div class="header-left">
<h1 class="page-title">计划编制管理</h1>
<p class="page-desc">统一管理和追踪所有业务计划的编制与审批流程</p>
</div>
<div class="header-stats">
<div class="stat-item">
<span class="stat-value">--</span>
<span class="stat-label">计划总数</span>
</div>
<div class="stat-item warning">
<span class="stat-value">--</span>
<span class="stat-label">待处理</span>
</div>
<div class="stat-item success">
<span class="stat-value">--</span>
<span class="stat-label">已完成</span>
</div>
</div>
</div>
</div> -->
<!-- 主内容区 --> <!-- 主内容区 -->
<div class="main-content"> <div class="main-content">
<!-- 搜索区域 --> <!-- 搜索区域 -->
...@@ -43,12 +19,12 @@ ...@@ -43,12 +19,12 @@
<JSearchSelect placeholder="请选择类型" v-model:value="queryParam['projectType']" dict="projecttype" /> <JSearchSelect placeholder="请选择类型" v-model:value="queryParam['projectType']" dict="projecttype" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="5" :lg="8" :md="12" :sm="24"> <a-col :xl="7" :lg="8" :md="12" :sm="24">
<a-form-item label="执行部门"> <a-form-item label="执行部门">
<JSelectDept placeholder="请选择执行部门" v-model:value="queryParam['execDepCode']" /> <JSelectDept placeholder="请选择执行部门" v-model:value="queryParam['execDepCode']" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="4" :lg="8" :md="12" :sm="24"> <a-col :xl="5" :lg="8" :md="12" :sm="24">
<a-form-item label="计划状态"> <a-form-item label="计划状态">
<a-select <a-select
v-model:value="queryParam['status']" v-model:value="queryParam['status']"
...@@ -66,6 +42,8 @@ ...@@ -66,6 +42,8 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="16">
<a-col :xl="5" :lg="8" :md="12" :sm="24"> <a-col :xl="5" :lg="8" :md="12" :sm="24">
<a-form-item label="计划日期"> <a-form-item label="计划日期">
<a-range-picker <a-range-picker
...@@ -76,8 +54,6 @@ ...@@ -76,8 +54,6 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="16">
<a-col :xl="5" :lg="8" :md="12" :sm="24"> <a-col :xl="5" :lg="8" :md="12" :sm="24">
<a-form-item label="优先级"> <a-form-item label="优先级">
<a-select <a-select
...@@ -106,7 +82,7 @@ ...@@ -106,7 +82,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="14" :lg="16" :md="24" :sm="24"> <a-col :xl="7" :lg="16" :md="24" :sm="24">
<a-form-item class="search-btn-group"> <a-form-item class="search-btn-group">
<a-space :size="8"> <a-space :size="8">
<a-button type="primary" @click="searchQuery">查询</a-button> <a-button type="primary" @click="searchQuery">查询</a-button>
...@@ -166,12 +142,12 @@ ...@@ -166,12 +142,12 @@
<!-- 待办抽屉 --> <!-- 待办抽屉 -->
<div v-if="isShowDrawer"> <div v-if="isShowDrawer">
<a-drawer destroyOnClose v-model:open="isShowDrawer" class="flat-drawer" title="待办任务" placement="right" width="90%"> <a-drawer destroyOnClose v-model:open="isShowDrawer" class="flat-drawer" title="待办任务" placement="right" width="90%">
<template #extra> <!-- <template #extra>
<div class="drawer-tags"> <div class="drawer-tags">
<span class="tag">发起人: {{ startUser }}</span> <span class="tag">发起人: {{ startUser }}</span>
<span class="tag">任务节点: {{ taskName }}</span> <span class="tag">任务节点: {{ taskName }}</span>
</div> </div>
</template> </template> -->
<TodoIndex v-if="isShowDrawer" ref="refTodoIndex" @callback="handleSuccess" /> <TodoIndex v-if="isShowDrawer" ref="refTodoIndex" @callback="handleSuccess" />
</a-drawer> </a-drawer>
</div> </div>
...@@ -545,8 +521,8 @@ ...@@ -545,8 +521,8 @@
{ {
label: '待办', label: '待办',
ifShow: () => { ifShow: () => {
console.log("-------------record['uid'] ",record['uid']); console.log("-------------record['uid'] ", record['uid']);
console.log("-------------userStore.getUserInfo.id ",userStore.getUserInfo.id); console.log('-------------userStore.getUserInfo.id ', userStore.getUserInfo.id);
if (record['bpmStatus'] == '2' && record['uid'] == userStore.getUserInfo.id) return true; if (record['bpmStatus'] == '2' && record['uid'] == userStore.getUserInfo.id) return true;
else return false; else return false;
}, },
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, watch, nextTick } from 'vue'; import { ref, reactive, onMounted, watch, nextTick, toRaw } from 'vue';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { saveOrUpdate } from '../StPlanMan.api'; import { saveOrUpdate } from '../StPlanMan.api';
...@@ -107,6 +107,25 @@ ...@@ -107,6 +107,25 @@
attachments: [] as any[], attachments: [] as any[],
}); });
// accept external formData prop from parent modal
const props = defineProps({
formData: {
type: Object,
default: () => ({}),
},
});
// sync incoming prop into internal reactive formData
watch(
() => props.formData,
(v) => {
if (v && Object.keys(v).length > 0) {
Object.assign(formData, v);
}
},
{ immediate: true, deep: true }
);
// 监听formData变化,用于调试 // 监听formData变化,用于调试
watch( watch(
...@@ -272,7 +291,8 @@ ...@@ -272,7 +291,8 @@
const response = await saveOrUpdate(submitData, true); const response = await saveOrUpdate(submitData, true);
if (response) { if (response) {
message.success('保存成功'); // message.success('保存成功');
console.log('保存成功:');
// 更新缓存 // 更新缓存
planFormStore.updateFormDataCache(formData); planFormStore.updateFormDataCache(formData);
console.log(response); console.log(response);
...@@ -355,6 +375,7 @@ ...@@ -355,6 +375,7 @@
resetForm, resetForm,
initFormData, initFormData,
isInitialized, isInitialized,
getFormData: () => toRaw(formData),
}); });
</script> </script>
...@@ -489,10 +510,8 @@ ...@@ -489,10 +510,8 @@
/* ==================== 表单底部按钮 ==================== */ /* ==================== 表单底部按钮 ==================== */
.form-footer { .form-footer {
padding: 14px 32px; padding: 14px 32px;
background: var(--color-bg-section);
border-top: 1px solid var(--color-border);
display: flex; display: flex;
justify-content: flex-end; justify-content: center;
} }
/* ==================== 上传区域 ==================== */ /* ==================== 上传区域 ==================== */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论