Merge remote-tracking branch 'origin/master'

This commit is contained in:
ye1023
2026-06-17 14:15:36 +08:00
6 changed files with 414 additions and 105 deletions
+12 -21
View File
@@ -112,7 +112,7 @@
updateLaunchType, updateLaunchType,
saveOrUpdateDict, saveOrUpdateDict,
withDrawXiSpeak, withDrawXiSpeak,
bgXiSpeakFeedbackList, queryFeedbackCounts,
} from './BgXiSpeak.api'; } from './BgXiSpeak.api';
const FLOW_CODE = 'dev_bg_xi_speak_001'; const FLOW_CODE = 'dev_bg_xi_speak_001';
@@ -348,27 +348,18 @@
const ids = collectAllIds(records); const ids = collectAllIds(records);
if (ids.length === 0) return; if (ids.length === 0) return;
try { try {
// 并行加载所有记录的反馈数据 const res = await queryFeedbackCounts({ ids: ids.join(',') });
const results = await Promise.all( const data = Array.isArray(res) ? res : res?.records || res?.result || [];
ids.map((id) =>
bgXiSpeakFeedbackList({
mainId: id,
pageNo: 1,
pageSize: 9999,
column: 'createTime',
order: 'desc',
}).catch(() => null)
)
);
// 构建 id -> { total, closed } 映射
const countsMap: Record<string, { total: number; closed: number }> = {}; const countsMap: Record<string, { total: number; closed: number }> = {};
ids.forEach((id, index) => { for (const item of data) {
const res = results[index]; const id = item.mainId || item.id || item.main_id;
const list = Array.isArray(res) ? res : res?.records || []; if (id) {
const total = list.length; countsMap[id] = {
const closed = list.filter((item: any) => item.completionStatus == 1).length; total: item.total ?? item.implCount ?? 0,
countsMap[id] = { total, closed }; closed: item.closed ?? item.closedCount ?? 0,
}); };
}
}
const updateFn = (list) => { const updateFn = (list) => {
if (!list) return; if (!list) return;
for (const item of list) { for (const item of list) {
@@ -2,21 +2,21 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled"> <JFormContainer :disabled="disabled">
<template #detail> <template #detail>
<a-form class="antd-modal-form" labelAlign="left" :labelCol="formItemLayout.labelCol" :wrapperCol="formItemLayout.wrapperCol" ref="formRef" :model="formData" :rules="validatorRules" name="BgXiSpeakFeedbackForm"> <a-form class="antd-modal-form" labelAlign="left" :labelCol="labelCol" :wrapperCol="wrapperCol" ref="formRef" :model="formData" :rules="validatorRules" name="BgXiSpeakFeedbackForm">
<!-- 基本信息 --> <!-- 基本信息 -->
<a-divider orientation="left" plain>基本信息</a-divider> <a-divider orientation="left" plain>基本信息</a-divider>
<a-row :gutter="[16, 0]"> <a-row class="form-content-row" :gutter="[12, 4]">
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="反馈部门" name="responDeptid"> <a-form-item label="反馈部门" name="responDeptid">
<j-select-dept v-model:value="formData.responDeptid" :multiple="true" checkStrictly allow-clear @change="handleDeptChange" /> <j-select-dept v-model:value="formData.responDeptid" :multiple="true" checkStrictly allow-clear @change="handleDeptChange" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="反馈人" name="responPersonid"> <a-form-item label="反馈人" name="responPersonid">
<j-select-user v-model:value="formData.responPersonid" allow-clear @change="handleUserChange" /> <j-select-user v-model:value="formData.responPersonid" allow-clear @change="handleUserChange" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="反馈时间" name="responTime"> <a-form-item label="反馈时间" name="responTime">
<a-date-picker <a-date-picker
placeholder="请选择反馈时间" placeholder="请选择反馈时间"
@@ -28,7 +28,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="序号" name="num"> <a-form-item label="序号" name="num">
<a-input-number v-model:value="formData.num" placeholder="请输入序号" style="width: 100%" allow-clear /> <a-input-number v-model:value="formData.num" placeholder="请输入序号" style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
@@ -36,15 +36,13 @@
</a-row> </a-row>
<!-- 措施内容 --> <!-- 措施内容 -->
<a-divider orientation="left" plain>措施信息</a-divider> <a-divider orientation="left" plain>措施信息</a-divider>
<a-row :gutter="[16, 0]"> <a-row class="form-content-row" :gutter="[12, 4]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="具体措施" name="method"> <a-form-item label="具体措施" name="method">
<a-textarea v-model:value="formData.method" placeholder="请输入措施内容" :rows="3" allow-clear></a-textarea> <a-textarea v-model:value="formData.method" placeholder="请输入措施内容" :rows="3" allow-clear></a-textarea>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> <a-col :xs="24" :md="12">
<a-row :gutter="[16, 0]">
<a-col :span="12">
<a-form-item label="完成期限" name="deadline"> <a-form-item label="完成期限" name="deadline">
<a-date-picker <a-date-picker
placeholder="请选择完成期限" placeholder="请选择完成期限"
@@ -55,13 +53,11 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="成果形式" name="outcomeForm"> <a-form-item label="成果形式" name="outcomeForm">
<a-input v-model:value="formData.outcomeForm" placeholder="请输入成果形式" allow-clear></a-input> <a-input v-model:value="formData.outcomeForm" placeholder="请输入成果形式" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="[16, 0]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="进展情况" v-bind="validateInfos.progress" name="progress"> <a-form-item label="进展情况" v-bind="validateInfos.progress" name="progress">
<a-textarea v-model:value="formData.progress" placeholder="请输入进展情况" :rows="3" allow-clear></a-textarea> <a-textarea v-model:value="formData.progress" placeholder="请输入进展情况" :rows="3" allow-clear></a-textarea>
@@ -70,13 +66,13 @@
</a-row> </a-row>
<!-- 状态与落实 --> <!-- 状态与落实 -->
<a-divider orientation="left" plain>状态与落实</a-divider> <a-divider orientation="left" plain>状态与落实</a-divider>
<a-row :gutter="[16, 0]"> <a-row class="form-content-row" :gutter="[12, 4]">
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="落实情况" name="implStatus"> <a-form-item label="落实情况" name="implStatus">
<a-input v-model:value="formData.implStatus" placeholder="请输入落实情况" allow-clear></a-input> <a-input v-model:value="formData.implStatus" placeholder="请输入落实情况" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="完成状态" v-bind="validateInfos.completionStatus" name="completionStatus"> <a-form-item label="完成状态" v-bind="validateInfos.completionStatus" name="completionStatus">
<JDictSelectTag <JDictSelectTag
v-model:value="formData.completionStatus" v-model:value="formData.completionStatus"
@@ -87,9 +83,7 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> <a-col :xs="24" :md="12">
<a-row :gutter="[16, 0]">
<a-col :span="12">
<a-form-item label="是否报送上级报告" name="isReportedToHigher"> <a-form-item label="是否报送上级报告" name="isReportedToHigher">
<JDictSelectTag <JDictSelectTag
v-model:value="formData.isReportedToHigher" v-model:value="formData.isReportedToHigher"
@@ -101,32 +95,26 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="检查情况" name="checkStatus"> <a-form-item label="检查情况" name="checkStatus">
<a-input v-model:value="formData.checkStatus" placeholder="请输入检查情况" allow-clear></a-input> <a-input v-model:value="formData.checkStatus" placeholder="请输入检查情况" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="[16, 0]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="落实计划" name="completionPlan"> <a-form-item label="落实计划" name="completionPlan">
<a-textarea v-model:value="formData.completionPlan" placeholder="请输入落实计划" :rows="3" allow-clear></a-textarea> <a-textarea v-model:value="formData.completionPlan" placeholder="请输入落实计划" :rows="3" allow-clear></a-textarea>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> <a-col :xs="24" :md="12">
<a-row :gutter="[16, 0]">
<a-col :span="12">
<a-form-item label="总措施号" name="sumMethodNum"> <a-form-item label="总措施号" name="sumMethodNum">
<a-input v-model:value="formData.sumMethodNum" placeholder="请输入总措施号" allow-clear></a-input> <a-input v-model:value="formData.sumMethodNum" placeholder="请输入总措施号" allow-clear></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="措施数量" name="measureNum"> <a-form-item label="措施数量" name="measureNum">
<a-input-number v-model:value="formData.measureNum" placeholder="请输入措施数量" style="width: 100%" allow-clear /> <a-input-number v-model:value="formData.measureNum" placeholder="请输入措施数量" style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="[16, 0]">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="监督意见" name="inspectionAdvice"> <a-form-item label="监督意见" name="inspectionAdvice">
<a-textarea v-model:value="formData.inspectionAdvice" placeholder="请输入监督意见" :rows="3" allow-clear></a-textarea> <a-textarea v-model:value="formData.inspectionAdvice" placeholder="请输入监督意见" :rows="3" allow-clear></a-textarea>
@@ -135,8 +123,8 @@
</a-row> </a-row>
<!-- 周期配置 --> <!-- 周期配置 -->
<a-divider orientation="left" plain>周期配置</a-divider> <a-divider orientation="left" plain>周期配置</a-divider>
<a-row :gutter="[16, 0]"> <a-row class="form-content-row" :gutter="[12, 4]">
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="发起类型" name="launchType"> <a-form-item label="发起类型" name="launchType">
<a-select v-model:value="formData.launchType" placeholder="请选择发起类型" allow-clear> <a-select v-model:value="formData.launchType" placeholder="请选择发起类型" allow-clear>
<a-select-option :value="0">立即发起</a-select-option> <a-select-option :value="0">立即发起</a-select-option>
@@ -144,7 +132,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="周期类型" name="intervalType"> <a-form-item label="周期类型" name="intervalType">
<a-select v-model:value="formData.intervalType" placeholder="请选择周期类型" allow-clear> <a-select v-model:value="formData.intervalType" placeholder="请选择周期类型" allow-clear>
<a-select-option :value="1"></a-select-option> <a-select-option :value="1"></a-select-option>
@@ -155,12 +143,12 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="周期任务数量" name="startCount"> <a-form-item label="周期任务数量" name="startCount">
<a-input-number v-model:value="formData.startCount" placeholder="请输入周期任务数量" style="width: 100%" allow-clear /> <a-input-number v-model:value="formData.startCount" placeholder="请输入周期任务数量" style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :xs="24" :md="12">
<a-form-item label="周期开始时间" name="startTime"> <a-form-item label="周期开始时间" name="startTime">
<a-date-picker <a-date-picker
v-model:value="formData.startTime" v-model:value="formData.startTime"
@@ -234,10 +222,8 @@
const props = defineProps({ const props = defineProps({
disabled: { type: Boolean, default: false }, disabled: { type: Boolean, default: false },
}); });
const formItemLayout = { const labelCol = { xs: { span: 24 }, sm: { span: 7 } };
labelCol: { xs: { span: 24 }, sm: { span: 6 } }, const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
wrapperCol: { xs: { span: 24 }, sm: { span: 18 } },
};
/** /**
* 部门选择变化 * 部门选择变化
@@ -343,5 +329,35 @@
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { .antd-modal-form {
padding: 14px; padding: 14px;
:deep(.ant-form-item-label) {
padding-bottom: 0;
text-align: left;
}
:deep(.ant-form-item-label > label) {
width: 100%;
justify-content: flex-start;
}
:deep(.ant-form-item-control),
:deep(.ant-form-item-control-input),
:deep(.ant-form-item-control-input-content) {
text-align: left;
}
}
.form-content-row {
:deep(.ant-form-item) {
margin-bottom: 6px;
}
:deep(.ant-input),
:deep(.ant-input-affix-wrapper),
:deep(.ant-input-number),
:deep(.ant-picker),
:deep(.ant-select-selector) {
min-height: 30px;
}
} }
</style> </style>
@@ -20,6 +20,21 @@
<div class="my-work__body"> <div class="my-work__body">
<template v-if="activeTab === 'todo'"> <template v-if="activeTab === 'todo'">
<BasicTable @register="registerTodoTable"> <BasicTable @register="registerTodoTable">
<template #headerCell="{ column }">
<HeaderCell v-if="column.dataIndex !== 'action'" :column="column" />
<span v-else class="action-header">
操作
<Tooltip placement="topLeft" :overlayStyle="{ maxWidth: '300px' }">
<template #title>
<div>
<b>转办</b>将任务转交他人办理对方办完后流程继续流转到下一环节不再回到本人<br />
<b>委托</b>将任务委托他人代办对方办完后任务会回到本人由本人继续完成流程
</div>
</template>
<QuestionCircleOutlined class="action-header__icon" />
</Tooltip>
</span>
</template>
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="getTodoTableAction(record)" /> <TableAction :actions="getTodoTableAction(record)" />
</template> </template>
@@ -44,9 +59,11 @@
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { BasicTable, TableAction } from '/@/components/Table'; import { BasicTable, TableAction } from '/@/components/Table';
import HeaderCell from '/@/components/Table/src/components/HeaderCell.vue';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { RightOutlined } from '@ant-design/icons-vue'; import { RightOutlined, QuestionCircleOutlined } from '@ant-design/icons-vue';
import { Tooltip } from 'ant-design-vue';
import TaskHandleModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/TaskHandleModal.vue'; import TaskHandleModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/TaskHandleModal.vue';
import SelectEntrusterModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/SelectEntrusterModal.vue'; import SelectEntrusterModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/SelectEntrusterModal.vue';
import { getTaskInfoForHistory } from '/@/views/super/bpm/process/personalOffice/myHandleTask/useTaskList'; import { getTaskInfoForHistory } from '/@/views/super/bpm/process/personalOffice/myHandleTask/useTaskList';
@@ -75,7 +92,11 @@
showTableSetting: false, showTableSetting: false,
canResize: false, canResize: false,
scroll: { x: 900 }, scroll: { x: 900 },
actionColumn: { dataIndex: 'action', fixed: 'right', width: 180 }, actionColumn: {
dataIndex: 'action',
fixed: 'right',
width: 180,
},
useSearchForm: false, useSearchForm: false,
}, },
}); });
@@ -343,6 +364,22 @@
&__body { &__body {
padding: 12px 20px; padding: 12px 20px;
.action-header {
display: inline-flex;
align-items: center;
gap: 4px;
&__icon {
color: rgba(0, 0, 0, 0.45);
cursor: help;
font-size: 14px;
&:hover {
color: @primary-color;
}
}
}
:deep(.ant-table) { :deep(.ant-table) {
table { table {
table-layout: fixed; table-layout: fixed;
@@ -2,48 +2,48 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled"> <JFormContainer :disabled="disabled">
<template #detail> <template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DqInspectProgressForm"> <a-form ref="formRef" class="antd-modal-form" labelAlign="left" :labelCol="labelCol" :wrapperCol="wrapperCol" name="DqInspectProgressForm">
<a-row> <a-row class="form-content-row" :gutter="[12, 4]">
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="反馈部门ID" v-bind="validateInfos.feedbackDeptId" id="DqInspectProgressForm-feedbackDeptId" name="feedbackDeptId"> <a-form-item label="反馈部门ID" v-bind="validateInfos.feedbackDeptId" id="DqInspectProgressForm-feedbackDeptId" name="feedbackDeptId">
<a-input v-model:value="formData.feedbackDeptId" placeholder="请输入反馈部门ID" allow-clear ></a-input> <a-input v-model:value="formData.feedbackDeptId" placeholder="请输入反馈部门ID" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="反馈部门名称" v-bind="validateInfos.feedbackDeptName" id="DqInspectProgressForm-feedbackDeptName" name="feedbackDeptName"> <a-form-item label="反馈部门名称" v-bind="validateInfos.feedbackDeptName" id="DqInspectProgressForm-feedbackDeptName" name="feedbackDeptName">
<a-input v-model:value="formData.feedbackDeptName" placeholder="请输入反馈部门名称" allow-clear ></a-input> <a-input v-model:value="formData.feedbackDeptName" placeholder="请输入反馈部门名称" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="反馈人ID" v-bind="validateInfos.feedbackPersonId" id="DqInspectProgressForm-feedbackPersonId" name="feedbackPersonId"> <a-form-item label="反馈人ID" v-bind="validateInfos.feedbackPersonId" id="DqInspectProgressForm-feedbackPersonId" name="feedbackPersonId">
<a-input v-model:value="formData.feedbackPersonId" placeholder="请输入反馈人ID" allow-clear ></a-input> <a-input v-model:value="formData.feedbackPersonId" placeholder="请输入反馈人ID" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="反馈人姓名" v-bind="validateInfos.feedbackPersonName" id="DqInspectProgressForm-feedbackPersonName" name="feedbackPersonName"> <a-form-item label="反馈人姓名" v-bind="validateInfos.feedbackPersonName" id="DqInspectProgressForm-feedbackPersonName" name="feedbackPersonName">
<a-input v-model:value="formData.feedbackPersonName" placeholder="请输入反馈人姓名" allow-clear ></a-input> <a-input v-model:value="formData.feedbackPersonName" placeholder="请输入反馈人姓名" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="实际完成时间" v-bind="validateInfos.actualTime" id="DqInspectProgressForm-actualTime" name="actualTime"> <a-form-item label="实际完成时间" v-bind="validateInfos.actualTime" id="DqInspectProgressForm-actualTime" name="actualTime">
<a-date-picker placeholder="请选择实际完成时间" v-model:value="formData.actualTime" value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> <a-date-picker placeholder="请选择实际完成时间" v-model:value="formData.actualTime" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="工作进展" v-bind="validateInfos.workProgress" id="DqInspectProgressForm-workProgress" name="workProgress"> <a-form-item label="工作进展" v-bind="validateInfos.workProgress" id="DqInspectProgressForm-workProgress" name="workProgress">
<a-input v-model:value="formData.workProgress" placeholder="请输入工作进展" allow-clear ></a-input> <a-input v-model:value="formData.workProgress" placeholder="请输入工作进展" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="进展状态" v-bind="validateInfos.bpmStatus" id="DqInspectProgressForm-bpmStatus" name="bpmStatus"> <a-form-item label="进展状态" v-bind="validateInfos.bpmStatus" id="DqInspectProgressForm-bpmStatus" name="bpmStatus">
<a-input v-model:value="formData.bpmStatus" placeholder="请输入进展状态" allow-clear ></a-input> <a-input v-model:value="formData.bpmStatus" placeholder="请输入进展状态" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :xs="24" :md="12">
<a-form-item label="整改措施任务ID" v-bind="validateInfos.mainId" id="DqInspectProgressForm-mainId" name="mainId"> <a-form-item label="整改措施任务ID" v-bind="validateInfos.mainId" id="DqInspectProgressForm-mainId" name="mainId">
<a-input v-model:value="formData.mainId" placeholder="请输入整改措施任务ID" allow-clear ></a-input> <a-input v-model:value="formData.mainId" placeholder="请输入整改措施任务ID" allow-clear />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-if="showFlowSubmitButton" :span="24" style="width: 100%;text-align: center;"> <a-col v-if="showFlowSubmitButton" :span="24" style="width: 100%;text-align: center;">
<a-button preIcon="ant-design:check-outlined" style="width: 126px" type="primary" @click="submitForm"> </a-button> <a-button preIcon="ant-design:check-outlined" style="width: 126px" type="primary" @click="submitForm"> </a-button>
</a-col> </a-col>
@@ -85,8 +85,8 @@
mainId: '', mainId: '',
}); });
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } }); const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 17 } });
const confirmLoading = ref<boolean>(false); const confirmLoading = ref<boolean>(false);
//表单验证 //表单验证
const validatorRules = reactive({ const validatorRules = reactive({
@@ -212,5 +212,35 @@
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { .antd-modal-form {
padding: 14px; padding: 14px;
:deep(.ant-form-item-label) {
padding-bottom: 0;
text-align: left;
}
:deep(.ant-form-item-label > label) {
width: 100%;
justify-content: flex-start;
}
:deep(.ant-form-item-control),
:deep(.ant-form-item-control-input),
:deep(.ant-form-item-control-input-content) {
text-align: left;
}
}
.form-content-row {
:deep(.ant-form-item) {
margin-bottom: 6px;
}
:deep(.ant-input),
:deep(.ant-input-affix-wrapper),
:deep(.ant-input-number),
:deep(.ant-picker),
:deep(.ant-select-selector) {
min-height: 30px;
}
} }
</style> </style>
@@ -104,7 +104,7 @@
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue'; import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue'; import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
import { startProcessSchedules } from '/@/api/common/api'; import { startProcessSchedules } from '/@/api/common/api';
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue'; import FlowScheduleStartModal from './components/DqInspectTaskFlowScheduleStartModal.vue';
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue'; import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
const [registerBpmModal, { openModal: bpmPicModal }] = useModal(); const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
@@ -0,0 +1,235 @@
<template>
<j-modal :title="title" :width="720" :visible="visible" @ok="handleOk" @cancel="handleCancel" cancelText="取消">
<a-form :model="formData" :label-col="{ style: { width: '120px' } }" :wrapper-col="{ span: 16 }">
<a-form-item label="发起类型">
<a-radio-group v-model:value="formData.triggerMode">
<a-radio value="immediate">立即发起</a-radio>
<a-radio value="recurring">重复发起</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item v-if="deptOptions.length" label="牵头部门">
<a-select
v-model:value="formData.deptIds"
mode="multiple"
:options="deptOptions"
placeholder="请选择牵头部门"
allow-clear
style="width: 100%"
:getPopupContainer="(node) => node?.parentNode"
/>
</a-form-item>
<a-form-item v-if="showDeadlineField" label="事项截止时间">
<a-date-picker
v-model:value="formData.deadline"
valueFormat="YYYY-MM-DD"
placeholder="请选择事项截止时间"
style="width: 100%"
:getPopupContainer="(node) => node?.parentNode"
/>
</a-form-item>
<template v-if="showSuoleaderFields">
<a-form-item label="党群领导是否审批">
<j-switch v-model:value="formData.isNeedAppro" />
</a-form-item>
<a-form-item v-show="formData.isNeedAppro === '1'" label="党群领导">
<DeptRoleUserSelectRadioGroup
v-model:value="formData.supDeptleaderid"
:deptId="PARTY_MASSES_DEPT_ID"
:roleId="MEASURE_RES_LEADER_ROLE_ID"
/>
</a-form-item>
</template>
<template v-if="formData.triggerMode === 'recurring'">
<a-form-item label="重复周期">
<JDictSelectTag
v-model:value="formData.intervalType"
dictCode="sup_interval_type"
placeholder="重复周期"
:getPopupContainer="(node) => node?.parentNode"
/>
</a-form-item>
<a-form-item label="重复次数">
<a-input-number v-model:value="formData.startCount" :min="1" :precision="0" placeholder="重复次数" style="width: 100%" />
</a-form-item>
<a-form-item label="重复开始日期">
<a-date-picker
v-model:value="formData.intervalStartTime"
show-time
valueFormat="YYYY-MM-DD HH:mm:ss"
placeholder="重复开始日期"
style="width: 100%"
:getPopupContainer="(node) => node?.parentNode"
/>
</a-form-item>
</template>
</a-form>
<template #footer>
<a-button @click="handleCancel">取消</a-button>
<a-button type="primary" @click="handleOk">提交</a-button>
</template>
</j-modal>
</template>
<script lang="ts" setup>
import { reactive, ref } from 'vue';
import JModal from '/src/components/Modal/src/JModal/JModal.vue';
import JDictSelectTag from '/src/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSwitch from '/src/components/Form/src/jeecg/components/JSwitch.vue';
import DeptRoleUserSelectRadioGroup from '/@/components/semri/userComponent/DeptRoleUserSelectRadioGroup.vue';
import { useMessage } from '/src/hooks/web/useMessage';
const PARTY_MASSES_DEPT_ID = '2044677628281720834';
const MEASURE_RES_LEADER_ROLE_ID = '2044680793306591234';
interface ModalPayload {
title?: string;
payload?: Record<string, any>;
deptOptions?: DeptOption[];
showSuoleaderFields?: boolean;
isNeedAppro?: string | number;
supDeptleaderid?: string | string[];
supDeptleaderName?: string;
showDeadlineField?: boolean;
deadline?: string | Date;
}
interface DeptOption {
label: string;
value: string;
}
const emit = defineEmits(['confirm']);
const { createMessage } = useMessage();
const title = ref('发起流程');
const visible = ref(false);
const contextData = ref<Record<string, any>>({});
const deptOptions = ref<DeptOption[]>([]);
const showSuoleaderFields = ref(false);
const showDeadlineField = ref(false);
const formData = reactive({
triggerMode: 'immediate',
intervalType: undefined as number | string | undefined,
startCount: undefined as number | undefined,
intervalStartTime: undefined as string | undefined,
deptIds: [] as string[],
isNeedAppro: '0',
supDeptleaderid: '' as string | string[],
deadline: undefined as string | undefined,
});
function resetForm() {
formData.triggerMode = 'immediate';
formData.intervalType = undefined;
formData.startCount = undefined;
formData.intervalStartTime = undefined;
formData.deptIds = [];
formData.isNeedAppro = '0';
formData.supDeptleaderid = '';
formData.deadline = undefined;
deptOptions.value = [];
showSuoleaderFields.value = false;
showDeadlineField.value = false;
}
function normalizeDeptOptions(options: DeptOption[] = []) {
const optionMap = new Map<string, DeptOption>();
options.forEach((item) => {
const value = String(item?.value || '').trim();
if (!value || optionMap.has(value)) {
return;
}
optionMap.set(value, {
value,
label: item?.label || value,
});
});
return Array.from(optionMap.values());
}
function normalizeDeadlineValue(value?: string | Date) {
if (!value) {
return undefined;
}
if (typeof value === 'string') {
return value.length >= 10 ? value.substring(0, 10) : value;
}
const year = value.getFullYear();
const month = String(value.getMonth() + 1).padStart(2, '0');
const day = String(value.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function open(data: ModalPayload = {}) {
resetForm();
title.value = data.title || '发起流程';
contextData.value = data.payload || {};
deptOptions.value = normalizeDeptOptions(data.deptOptions || []);
formData.deptIds = deptOptions.value.map((item) => item.value);
showSuoleaderFields.value = !!data.showSuoleaderFields;
formData.isNeedAppro = String(data.isNeedAppro ?? '0');
formData.supDeptleaderid = data.supDeptleaderid || '';
showDeadlineField.value = !!data.showDeadlineField;
formData.deadline = normalizeDeadlineValue(data.deadline);
visible.value = true;
}
function handleCancel() {
visible.value = false;
}
function handleOk() {
if (formData.triggerMode === 'recurring') {
if (!formData.intervalType) {
createMessage.warning('Please select interval type');
return;
}
if (!formData.startCount) {
createMessage.warning('Please input repeat count');
return;
}
if (!formData.intervalStartTime) {
createMessage.warning('Please select start time');
return;
}
}
if (deptOptions.value.length && !formData.deptIds.length) {
createMessage.warning('请选择责任部门');
return;
}
if (showDeadlineField.value && !formData.deadline) {
createMessage.warning('请选择事项截止时间');
return;
}
emit('confirm', {
payload: contextData.value,
options: {
triggerType: formData.triggerMode === 'recurring' ? 2 : 1,
intervalType: formData.triggerMode === 'recurring' ? Number(formData.intervalType) : undefined,
startCount: formData.triggerMode === 'recurring' ? Number(formData.startCount) : undefined,
intervalStartTime: formData.triggerMode === 'recurring' ? formData.intervalStartTime : undefined,
deptId: formData.deptIds.join(','),
deptIds: [...formData.deptIds],
isNeedAppro: showSuoleaderFields.value ? formData.isNeedAppro : undefined,
supDeptleaderid: showSuoleaderFields.value ? (String(formData.isNeedAppro) === '1' ? formData.supDeptleaderid : '') : undefined,
deadline: showDeadlineField.value ? formData.deadline : undefined,
},
});
handleCancel();
}
defineExpose({
open,
});
</script>