!6 适配json数据,用来适配后端传回的json数据

Merge pull request !6 from new_new_new/feature/xispeak-second-process
This commit is contained in:
new_new_new
2026-05-13 13:11:58 +00:00
committed by Gitee
5 changed files with 824 additions and 99 deletions
+4
View File
@@ -162,3 +162,7 @@ export const saveBpmForm = (params) => {
export const setProcessVariable = (params) => {
return defHttp.post({ url: '/act/process/setProcessVariable', params }, { isTransformResponse: false });
};
export const updateLaunchType = (params) => {
return defHttp.post({ url: '/bg/xispeak/bgXiSpeak/edit', params }, { isTransformResponse: false });
};
+82 -12
View File
@@ -114,25 +114,36 @@ export const columns: BasicColumn[] = [
align: 'center',
dataIndex: 'supervisionCount',
},
{
title: '审批信息',
align: 'center',
dataIndex: 'approveInfo',
customRender: ({ text }) => {
if (!text) return '-';
try {
const info = typeof text === 'string' ? JSON.parse(text) : text;
const keys = Object.keys(info);
if (keys.length === 0) return '-';
return `${keys.length} 项审批`;
} catch {
return '-';
}
},
},
];
//子表列表数据
export const bgXiSpeakFeedbackColumns: BasicColumn[] = [
{
title: '反馈部门id',
title: '序号',
align: 'center',
dataIndex: 'responDeptid',
dataIndex: 'num',
},
{
title: '反馈部门名称',
align: 'center',
dataIndex: 'responDeptname',
},
{
title: '反馈人id',
align: 'center',
dataIndex: 'responPersonid',
},
{
title: '反馈人姓名',
align: 'center',
@@ -143,13 +154,51 @@ export const bgXiSpeakFeedbackColumns: BasicColumn[] = [
align: 'center',
dataIndex: 'responTime',
customRender: ({ text }) => {
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
return text;
if (!text) return '';
if (text instanceof Date) {
const y = text.getFullYear();
const m = String(text.getMonth() + 1).padStart(2, '0');
const d = String(text.getDate()).padStart(2, '0');
return `${y}-${m}-${d}`;
}
text = String(text);
return text.length > 10 ? text.substr(0, 10) : text;
},
},
{
title: '落实情况',
title: '措施内容',
align: 'left',
dataIndex: 'method',
},
{
title: '完成期限',
align: 'center',
dataIndex: 'deadline',
customRender: ({ text }) => {
if (!text) return '';
if (text instanceof Date) {
const y = text.getFullYear();
const m = String(text.getMonth() + 1).padStart(2, '0');
const d = String(text.getDate()).padStart(2, '0');
return `${y}-${m}-${d}`;
}
text = String(text);
return text.length > 10 ? text.substr(0, 10) : text;
},
},
{
title: '成果形式',
align: 'center',
dataIndex: 'outcomeForm',
},
{
title: '进展情况',
align: 'left',
dataIndex: 'progress',
},
{
title: '落实情况',
align: 'left',
dataIndex: 'implStatus',
},
{
@@ -158,9 +207,29 @@ export const bgXiSpeakFeedbackColumns: BasicColumn[] = [
dataIndex: 'completionStatus',
},
{
title: '外键',
title: '落实计划',
align: 'left',
dataIndex: 'completionPlan',
},
{
title: '总措施号',
align: 'center',
dataIndex: 'mainId',
dataIndex: 'sumMethodNum',
},
{
title: '检查情况',
align: 'center',
dataIndex: 'checkStatus',
},
{
title: '监督意见',
align: 'left',
dataIndex: 'inspectionAdvice',
},
{
title: '措施数量',
align: 'center',
dataIndex: 'measureNum',
},
];
@@ -187,4 +256,5 @@ export const superQuerySchema = {
sortOrder: { title: '同级数据排序号', order: 19, view: 'number', type: 'number' },
bpmStatus: { title: '流程引擎状态字段', order: 21, view: 'number', type: 'number' },
supervisionCount: { title: '督办次数', order: 22, view: 'number', type: 'number' },
approveInfo: { title: '审批信息', order: 23, view: 'text', type: 'string' },
};
+463 -79
View File
@@ -2,18 +2,16 @@
<div class="erpNativeList">
<div class="content">
<!--引用表格-->
<BasicTable
@register="registerTable"
:rowSelection="rowSelection"
:expandedRowKeys="expandedRowKeys"
@expand="handleExpand"
@fetch-success="onFetchSuccess"
>
<BasicTable @register="registerTable" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>
<j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"
>导出</a-button
>
<j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"
>导入</j-upload-button
>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
@@ -31,19 +29,69 @@
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!-- 自定义展开图标完全复刻 Jeecg 原生树形效果 -->
<template #expandIcon="{ expanded, onExpand, record }">
<span v-if="record.hasChild === '1'" class="jeecg-tree-expand-icon" @click="(e) => onExpand(record, e)">
<!-- 用方块样式的加减号 Jeecg 原生一致 -->
<Icon :icon="expanded ? 'ant-design:minus-square-outlined' : 'ant-design:plus-square-outlined'" />
</span>
<span v-else class="jeecg-tree-expand-placeholder"></span>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }"> </template>
<!--嵌套子表-->
<template #expandedRowRender="{ record }">
<div class="feedback-expand-table" v-if="selectedFeedbackId === record.id">
<div class="feedback-expand-header">
<div class="feedback-expand-title">
<span class="feedback-expand-icon">
<Icon icon="ant-design:message-outlined" />
</span>
<span>反馈信息</span>
<a-tag class="feedback-expand-count" color="processing">
{{ getFeedbackTableLoading(record) ? '加载中' : `${getFeedbackCount(record)}` }}
</a-tag>
</div>
<div class="feedback-expand-actions">
<a-button type="link" size="small" @click="handleCloseFeedback">收起</a-button>
</div>
</div>
<BasicTable
class="feedback-inner-table"
bordered
size="small"
rowKey="id"
:canResize="false"
:showIndexColumn="false"
:showActionColumn="false"
:showTableSetting="false"
:clickToRowSelect="false"
:columns="feedbackExpandColumns"
:dataSource="getFeedbackTableData(record)"
:loading="getFeedbackTableLoading(record)"
:pagination="false"
:scroll="{ x: 1220 }"
>
<template #feedbackAttachments="{ record: feedbackRecord }">
<SUploadFile
v-if="feedbackRecord.id"
class="feedback-attachment-list"
:bussiness-id="feedbackRecord.id"
:disabled="true"
:multiple="true"
/>
<span v-else>-</span>
</template>
</BasicTable>
</div>
</template>
</BasicTable>
<!--子表表格tab-->
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="习总书记重要讲话反馈表" key="1">
<BgXiSpeakFeedbackList />
</a-tab-pane>
</a-tabs>
</div>
<!-- 表单区域 -->
<BgXiSpeakModal ref="registerModal" @success="handleSuccess"></BgXiSpeakModal>
@@ -57,23 +105,34 @@
<script lang="ts" name="bg.xispeak-bgXiSpeak" setup>
import { ref, reactive, unref, computed, provide } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import type { BasicColumn } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { startProcessSchedules } from '/@/api/common/api';
import { dateUtil } from '/@/utils/dateUtil';
import Icon from '/@/components/Icon/index';
import BgXiSpeakModal from './components/BgXiSpeakModal.vue';
import BgXiSpeakFeedbackList from './BgXiSpeakFeedbackList.vue';
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
import { columns as taskTaskColumns } from '/@/views/taskProcess/TaskTask.data';
import { columns, superQuerySchema } from './BgXiSpeak.data';
import { list, deleteBgXiSpeak, batchDeleteBgXiSpeak, getExportUrl, getImportUrl, getChildList, getChildListBatch } from './BgXiSpeak.api';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
import { columns, superQuerySchema, bgXiSpeakFeedbackColumns } from './BgXiSpeak.data';
import {
list,
deleteBgXiSpeak,
batchDeleteBgXiSpeak,
getExportUrl,
getImportUrl,
getChildList,
getChildListBatch,
updateLaunchType,
bgXiSpeakFeedbackList,
} from './BgXiSpeak.api';
const FLOW_CODE = 'dev_bg_xi_speak_001';
const FLOW_NAME = '习总书记重要讲话指示批示';
const FLOW_CODE_JBR = 'bg_xi_speak_fb_01';
const BUSINESS_TABLE_NAME = 'bg_xi_speak';
const FORM_URL = 'bg/xispeak/components/BgXiSpeakBPMForm';
@@ -86,6 +145,22 @@
const flowScheduleModalRef = ref();
const businessProcessListModalRef = ref();
const processColumns = taskTaskColumns;
const selectedFeedbackId = ref<string | number | null>(null);
const feedbackTableData = reactive<Record<string, Recordable[]>>({});
const feedbackTableLoading = reactive<Record<string, boolean>>({});
// 注册table数据
const feedbackExpandColumns: BasicColumn[] = [
...bgXiSpeakFeedbackColumns,
{
title: '附件下载',
dataIndex: 'id',
key: 'attachments',
align: 'left',
width: 340,
slots: { customRender: 'feedbackAttachments' },
},
];
// 是否显示DW领导列表选择
const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1');
@@ -98,8 +173,13 @@
canResize: false,
useSearchForm: false,
isTreeTable: true,
indentSize: 24, // 和 Jeecg 原生树形缩进保持一致
expandIconColumnIndex: 0,
clickToRowSelect: true,
rowSelection: { type: 'radio' },
treeProps: {
children: 'children',
indent: 24, // 和 indentSize 保持一致,保证缩进对齐
},
actionColumn: {
width: 120,
fixed: 'right',
@@ -108,10 +188,21 @@
params.hasQuery = 'true';
return Object.assign(params, queryParam.value);
},
afterFetch: (result) => {
if (result && result.length > 0) {
// 为有子节点的记录设置 children(用于显示展开图标)
result.forEach((item) => {
if (item.hasChild == '1' && (!item.children || item.children.length === 0)) {
item.children = [{ id: item.id + '_loadChild', name: 'loading...', isLoading: true }];
}
});
}
return result;
},
pagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20'],
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
},
},
exportConfig: {
@@ -124,7 +215,7 @@
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { selectedRowKeys }] = tableContext;
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
provide('mainId', mainId);
@@ -227,11 +318,43 @@
}
/**
* 添加下级
* 树节点展开合并
*/
function handleAddSub(record) {
registerModal.value.disableSubmit = false;
registerModal.value.add(record);
async function handleExpand(expanded, record) {
if (expanded) {
expandedRowKeys.value.push(record.id);
// 懒加载子节点
if (record.children && record.children.length > 0 && record.children[0].isLoading) {
let result = await getChildList({ pid: record.id });
result = result.records ? result.records : result;
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null;
record.hasChild = '0';
}
}
} else {
let keyIndex = expandedRowKeys.value.indexOf(record.id);
if (keyIndex >= 0) {
expandedRowKeys.value.splice(keyIndex, 1);
}
}
}
/**
* 处理数据集,标记有子节点的记录
*/
function getDataByResult(result) {
if (result && result.length > 0) {
return result.map((item) => {
if (item['hasChild'] == '1') {
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true };
item.children = [loadChild];
}
return item;
});
}
}
/**
@@ -277,59 +400,31 @@
}
}
/**
* 处理数据集
*/
function getDataByResult(result) {
if (result && result.length > 0) {
return result.map((item) => {
if (item['hasChild'] == '1') {
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true };
item.children = [loadChild];
}
return item;
});
}
}
/**
* 树节点展开合并
*/
async function handleExpand(expanded, record) {
if (expanded) {
expandedRowKeys.value.push(record.id);
if (record.children.length > 0 && !!record.children[0].isLoading) {
let result = await getChildList({ pid: record.id });
result = result.records ? result.records : result;
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null;
record.hasChild = '0';
}
}
} else {
let keyIndex = expandedRowKeys.value.indexOf(record.id);
if (keyIndex >= 0) {
expandedRowKeys.value.splice(keyIndex, 1);
}
}
}
/**
* 操作表格后处理树节点展开合并
*/
async function expandTreeNode(key) {
let record = findTableDataRecord(key);
expandedRowKeys.value.push(key);
let result = await getChildList({ pid: key });
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null;
record.hasChild = '0';
if (record) {
expandedRowKeys.value.push(key);
let result = await getChildList({ pid: key });
result = result.records ? result.records : result;
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null;
record.hasChild = '0';
}
updateTableDataRecord(key, record);
}
updateTableDataRecord(key, record);
}
/**
* 添加下级
*/
function handleAddSub(record) {
registerModal.value.disableSubmit = false;
registerModal.value.add(record);
}
/**
@@ -376,13 +471,21 @@
label: '查询督办流程',
onClick: handleQueryProcess.bind(null, record),
},
{
label: selectedFeedbackId.value === record.id ? '收起反馈信息' : '查看反馈',
onClick: handleViewFeedback.bind(null, record),
},
];
if (record.bpmStatus == '1' || !record.bpmStatus) {
dropDownAction.push({
label: '发起流程',
label: '发起督办计划收集流程',
onClick: handleProcess.bind(null, record),
});
dropDownAction.push({
label: '发起经办人执行反馈流程',
onClick: handleProcessJbr.bind(null, record),
});
}
return dropDownAction;
@@ -390,11 +493,18 @@
function handleProcess(record) {
flowScheduleModalRef.value?.open({
title: '发起流程',
title: '发起督办计划收集流程',
payload: { record },
});
}
function handleProcessJbr(record) {
flowScheduleModalRef.value?.open({
title: '发起落实部门经办人执行反馈流程',
payload: { record, flowCode: FLOW_CODE_JBR },
});
}
function handleQueryProcess(record) {
businessProcessListModalRef.value?.open({
title: '流程列表',
@@ -405,10 +515,19 @@
async function handleFlowScheduleConfirm({ payload, options }) {
const record = payload?.record || {};
const flowCode = payload?.flowCode || FLOW_CODE;
const formatDate = (value, format) => {
return value ? dateUtil(value).format(format) : undefined;
};
// triggerType: 1=立即发起, 2=重复发起; launchType: 0=收集后直接发起, 1=收集后周期性发起
const launchType = options.triggerType === 2 ? 1 : 0;
// 先保存 launchType 到主表
if (flowCode === FLOW_CODE) {
await updateLaunchType({ id: record.id, launchType });
}
// 合并选中的DW领导列表到record中
const recordWithSdwLeader = {
...record,
@@ -416,13 +535,83 @@
needSdwApproval: queryParam.value.needSdwApproval || '',
};
// 如果是经办人执行反馈流程,需要遍历每个部门单独发起
if (flowCode === FLOW_CODE_JBR) {
let approveInfo = {};
if (record.approveInfo) {
try {
approveInfo = typeof record.approveInfo === 'string' ? JSON.parse(record.approveInfo) : record.approveInfo;
} catch (e) {
createMessage.error('审批信息解析失败');
return;
}
}
const deptKeys = Object.keys(approveInfo);
if (deptKeys.length === 0) {
createMessage.warning('没有可用的部门审批信息');
return;
}
let successCount = 0;
const total = deptKeys.length;
for (const deptId of deptKeys) {
const deptApproveDetail = approveInfo[deptId];
const implUserIdList = deptApproveDetail.implUserIdList || [];
const implUserNameList = deptApproveDetail.implUserNameList || [];
const params = {
intervalType: options.intervalType,
startCount: options.startCount,
taskTask: {
triggerType: options.triggerType,
startTime: options.intervalStartTime,
flowCode: flowCode,
formUrl: FORM_URL,
flowName: '落实部门经办人执行反馈流程',
jsonData: {
...recordWithSdwLeader,
currentDeptId: deptId,
currentApproverId: deptApproveDetail.approverId,
currentApproverName: deptApproveDetail.approverName,
implUserIdList: implUserIdList.join(','),
implUserNameList: implUserNameList.join(','),
},
businessTablename: BUSINESS_TABLE_NAME,
businessId: record.id,
deptHandlerName: deptApproveDetail.implUserNameList.join(','),
title: record.speakStatus,
content: record.implStatus,
urgencyLevel: record.completionStatus,
deptId: deptId,
deptLeaderId: deptApproveDetail.approverId,
requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'),
deadline: formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'),
},
};
try {
await startProcessSchedules(params);
successCount++;
if (successCount === total) {
createMessage.success(`成功发起 ${total} 个经办人执行反馈流程`);
reload();
}
} catch (e) {
createMessage.error(`部门 ${deptId} 流程发起失败`);
}
}
return;
}
// 原有的督办计划收集流程逻辑
const params = {
intervalType: options.intervalType,
startCount: options.startCount,
taskTask: {
triggerType: options.triggerType,
startTime: options.intervalStartTime,
flowCode: FLOW_CODE,
flowCode: flowCode,
formUrl: FORM_URL,
flowName: FLOW_NAME,
jsonData: recordWithSdwLeader,
@@ -439,7 +628,8 @@
};
await startProcessSchedules(params);
handleSuccess({ isUpdate: false, values: {}, expandedArr: [], changeParent: false });
createMessage.success('发起成功');
reload();
}
async function handlePreviewPic(record) {
@@ -449,6 +639,55 @@
});
}
function getFeedbackKey(record: Recordable) {
return String(record?.id ?? '');
}
function getFeedbackTableData(record: Recordable) {
return feedbackTableData[getFeedbackKey(record)] || [];
}
function getFeedbackCount(record: Recordable) {
return getFeedbackTableData(record).length;
}
function getFeedbackTableLoading(record: Recordable) {
return !!feedbackTableLoading[getFeedbackKey(record)];
}
function handleCloseFeedback() {
selectedFeedbackId.value = null;
}
async function loadFeedbackTableData(mainId: string | number) {
const key = String(mainId);
feedbackTableLoading[key] = true;
try {
const res = await bgXiSpeakFeedbackList({
mainId,
pageNo: 1,
pageSize: 9999,
column: 'createTime',
order: 'desc',
});
feedbackTableData[key] = Array.isArray(res) ? res : res?.records || [];
} finally {
feedbackTableLoading[key] = false;
}
}
async function handleViewFeedback(record: Recordable) {
const mainId = record.id;
if (selectedFeedbackId.value === mainId) {
selectedFeedbackId.value = null;
} else {
selectedFeedbackId.value = mainId;
if (!feedbackTableData[mainId] || feedbackTableData[mainId].length === 0) {
await loadFeedbackTableData(mainId);
}
}
}
/**
* 查询
*/
@@ -562,10 +801,53 @@
transition: background 0.2s ease;
}
// 树形表格缩进样式,和 Jeecg 原生对齐
:deep(.ant-table-row) {
.ant-table-row-indent {
display: inline-block;
width: 24px; // 和 indentSize 保持一致
height: 1px;
}
}
:deep(.ant-table-tbody > tr:hover > td) {
background: #f5f7fa;
}
// Jeecg 原生风格的树形展开图标
:deep(.jeecg-tree-expand-icon) {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
margin-right: 6px;
cursor: pointer;
border-radius: 2px;
transition: all 0.2s;
&:hover {
background-color: #f0f0f0;
}
.anticon {
font-size: 14px;
color: #666;
transition: color 0.2s;
}
&:hover .anticon {
color: #1890ff;
}
}
:deep(.jeecg-tree-expand-placeholder) {
display: inline-block;
width: 20px;
height: 20px;
margin-right: 6px;
}
// 操作按钮样式
:deep(.ant-btn-link) {
padding: 4px 8px;
@@ -626,6 +908,108 @@
}
}
.feedback-expand-table {
margin: 4px 10px 12px 42px;
padding: 12px 14px 14px;
background: #f6fbff;
border: 1px solid #d6e8ff;
border-left: 4px solid #1677ff;
border-radius: 6px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
.feedback-expand-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}
.feedback-expand-title {
display: inline-flex;
align-items: center;
min-width: 0;
color: #1f2937;
font-size: 14px;
font-weight: 600;
line-height: 24px;
}
.feedback-expand-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
margin-right: 8px;
color: #1677ff;
background: #e6f4ff;
border-radius: 50%;
}
.feedback-expand-count {
margin-left: 10px;
}
.feedback-expand-desc {
color: #64748b;
font-size: 13px;
line-height: 22px;
white-space: nowrap;
}
.feedback-expand-actions {
display: flex;
align-items: center;
}
:deep(.jeecg-basic-table) {
background: #fff;
}
:deep(.feedback-inner-table .ant-table-wrapper) {
padding: 0;
border-radius: 4px;
}
:deep(.feedback-inner-table .ant-table-thead > tr > th) {
background: #eef6ff;
color: #334155;
font-weight: 600;
}
:deep(.feedback-inner-table .ant-table-tbody > tr > td) {
background: #fff;
}
:deep(.feedback-inner-table .ant-table-tbody > tr:hover > td) {
background: #f8fbff;
}
.feedback-attachment-list {
min-width: 300px;
:deep(.file-list-wrapper) {
min-height: auto;
padding: 8px;
}
:deep(.file-list-header) {
margin-bottom: 6px;
padding-bottom: 6px;
}
:deep(.file-list .file-item) {
padding: 8px;
margin-bottom: 6px;
}
:deep(.ant-empty) {
margin: 0;
}
}
}
// 响应式适配
@media (max-width: 768px) {
.erpNativeList {
@@ -119,6 +119,11 @@
>
<div class="section-title">新增反馈</div>
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="序号" name="num">
<a-input-number v-model:value="feedbackForm.num" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="反馈部门id" name="responDeptid">
<a-input v-model:value="feedbackForm.responDeptid" allow-clear />
@@ -139,14 +144,88 @@
<a-input v-model:value="feedbackForm.responPersonname" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="措施内容" name="method" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-textarea v-model:value="feedbackForm.method" :rows="3" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="完成期限" name="deadline">
<a-date-picker v-model:value="feedbackForm.deadline" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="成果形式" name="outcomeForm">
<a-input v-model:value="feedbackForm.outcomeForm" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="进展情况" name="progress" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-textarea v-model:value="feedbackForm.progress" :rows="3" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实情况" name="implStatus" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-textarea v-model:value="feedbackForm.implStatus" :rows="3" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="完成状态" name="completionStatus">
<a-input v-model:value="feedbackForm.completionStatus" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实情况" name="implStatus" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-textarea v-model:value="feedbackForm.implStatus" :rows="3" allow-clear />
<a-form-item label="落实计划" name="completionPlan" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-textarea v-model:value="feedbackForm.completionPlan" :rows="3" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="总措施号" name="sumMethodNum">
<a-input v-model:value="feedbackForm.sumMethodNum" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="检查情况" name="checkStatus">
<a-input v-model:value="feedbackForm.checkStatus" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="监督意见" name="inspectionAdvice" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-textarea v-model:value="feedbackForm.inspectionAdvice" :rows="3" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="措施数量" name="measureNum">
<a-input-number v-model:value="feedbackForm.measureNum" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="发起类型" name="launchType">
<a-select v-model:value="feedbackForm.launchType" placeholder="请选择发起类型" allow-clear>
<a-select-option :value="0">立即发起</a-select-option>
<a-select-option :value="1">周期发起</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期类型" name="intervalType">
<a-select v-model:value="feedbackForm.intervalType" placeholder="请选择周期类型" allow-clear>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="2"></a-select-option>
<a-select-option :value="3">两周</a-select-option>
<a-select-option :value="4"></a-select-option>
<a-select-option :value="5"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期任务数量" name="startCount">
<a-input-number v-model:value="feedbackForm.startCount" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期开始时间" name="startTime">
<a-date-picker v-model:value="feedbackForm.startTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" placeholder="请选择周期开始时间" allow-clear />
</a-form-item>
</a-col>
</a-row>
@@ -258,7 +337,21 @@
responPersonname: '',
implStatus: '',
completionStatus: '',
completionPlan: '',
mainId: '',
num: undefined,
method: '',
deadline: '',
outcomeForm: '',
progress: '',
sumMethodNum: '',
checkStatus: '',
inspectionAdvice: '',
measureNum: undefined,
launchType: undefined,
intervalType: undefined,
startCount: undefined,
startTime: '',
});
const feedbackRules = {
@@ -266,10 +359,76 @@
};
const feedbackColumns = [
{ title: '反馈部门名称', dataIndex: 'responDeptname', align: 'center', width: 160 },
{ title: '反馈人姓名', dataIndex: 'responPersonname', align: 'center', width: 140 },
{ title: '落实情况', dataIndex: 'implStatus', align: 'left', width: 280 },
{ title: '完成状态', dataIndex: 'completionStatus', align: 'center', width: 120 },
{ title: '序号', dataIndex: 'num', align: 'center', width: 60 },
{ title: '反馈部门名称', dataIndex: 'responDeptname', align: 'center', width: 120 },
{ title: '反馈人姓名', dataIndex: 'responPersonname', align: 'center', width: 100 },
{ title: '措施内容', dataIndex: 'method', align: 'left', width: 200 },
{
title: '完成期限',
dataIndex: 'deadline',
align: 'center',
width: 120,
customRender: ({ text }) => {
if (!text) return '';
if (text instanceof Date) {
const y = text.getFullYear();
const m = String(text.getMonth() + 1).padStart(2, '0');
const d = String(text.getDate()).padStart(2, '0');
return `${y}-${m}-${d}`;
}
return String(text).substr(0, 10);
},
},
{ title: '成果形式', dataIndex: 'outcomeForm', align: 'center', width: 100 },
{ title: '进展情况', dataIndex: 'progress', align: 'left', width: 200 },
{ title: '落实情况', dataIndex: 'implStatus', align: 'left', width: 200 },
{ title: '完成状态', dataIndex: 'completionStatus', align: 'center', width: 100 },
{ title: '落实计划', dataIndex: 'completionPlan', align: 'left', width: 200 },
{ title: '总措施号', dataIndex: 'sumMethodNum', align: 'center', width: 100 },
{ title: '检查情况', dataIndex: 'checkStatus', align: 'center', width: 120 },
{ title: '监督意见', dataIndex: 'inspectionAdvice', align: 'left', width: 200 },
{ title: '措施数量', dataIndex: 'measureNum', align: 'center', width: 80 },
{
title: '发起类型',
dataIndex: 'launchType',
align: 'center',
width: 100,
customRender: ({ text }) => {
if (text === 0) return '立即发起';
if (text === 1) return '周期发起';
return text || '';
},
},
{
title: '周期类型',
dataIndex: 'intervalType',
align: 'center',
width: 80,
customRender: ({ text }) => {
const map = { 1: '日', 2: '周', 3: '两周', 4: '月', 5: '季' };
return map[text] || text || '';
},
},
{ title: '周期任务数量', dataIndex: 'startCount', align: 'center', width: 100 },
{
title: '周期开始时间',
dataIndex: 'startTime',
align: 'center',
width: 160,
customRender: ({ text }) => {
if (!text) return '';
if (text instanceof Date) {
const y = text.getFullYear();
const m = String(text.getMonth() + 1).padStart(2, '0');
const d = String(text.getDate()).padStart(2, '0');
const h = String(text.getHours()).padStart(2, '0');
const min = String(text.getMinutes()).padStart(2, '0');
const s = String(text.getSeconds()).padStart(2, '0');
return `${y}-${m}-${d} ${h}:${min}:${s}`;
}
return String(text);
},
},
];
const mainDisabled = computed(() => {
@@ -383,7 +542,11 @@
function resetFeedbackForm() {
Object.keys(feedbackForm).forEach((key) => {
feedbackForm[key] = '';
if (key === 'num' || key === 'measureNum' || key === 'launchType' || key === 'intervalType' || key === 'startCount') {
feedbackForm[key] = undefined;
} else {
feedbackForm[key] = '';
}
});
feedbackForm.mainId = mainForm.id;
nextTick(() => feedbackFormRef.value?.clearValidate?.());
@@ -19,6 +19,31 @@
<a-date-picker placeholder="请选择反馈时间" v-model:value="formData.responTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="序号" name="num">
<a-input-number v-model:value="formData.num" placeholder="请输入序号" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="措施内容" name="method">
<a-textarea v-model:value="formData.method" placeholder="请输入措施内容" :rows="3" allow-clear></a-textarea>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="完成期限" name="deadline">
<a-date-picker placeholder="请选择完成期限" v-model:value="formData.deadline" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="成果形式" name="outcomeForm">
<a-input v-model:value="formData.outcomeForm" placeholder="请输入成果形式" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="进展情况" name="progress">
<a-textarea v-model:value="formData.progress" placeholder="请输入进展情况" :rows="3" allow-clear></a-textarea>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="落实情况" v-bind="validateInfos.implStatus" name="implStatus">
<a-input v-model:value="formData.implStatus" placeholder="请输入落实情况" allow-clear></a-input>
@@ -29,6 +54,60 @@
<a-input v-model:value="formData.completionStatus" placeholder="请输入完成状态" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实计划" v-bind="validateInfos.completionPlan" name="completionPlan">
<a-textarea v-model:value="formData.completionPlan" placeholder="请输入落实计划" :rows="3" allow-clear></a-textarea>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="总措施号" name="sumMethodNum">
<a-input v-model:value="formData.sumMethodNum" placeholder="请输入总措施号" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="检查情况" name="checkStatus">
<a-input v-model:value="formData.checkStatus" placeholder="请输入检查情况" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="监督意见" name="inspectionAdvice">
<a-textarea v-model:value="formData.inspectionAdvice" placeholder="请输入监督意见" :rows="3" allow-clear></a-textarea>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="措施数量" name="measureNum">
<a-input-number v-model:value="formData.measureNum" placeholder="请输入措施数量" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="发起类型" name="launchType">
<a-select v-model:value="formData.launchType" placeholder="请选择发起类型" allow-clear>
<a-select-option :value="0">立即发起</a-select-option>
<a-select-option :value="1">周期发起</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期类型" name="intervalType">
<a-select v-model:value="formData.intervalType" placeholder="请选择周期类型" allow-clear>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="2"></a-select-option>
<a-select-option :value="3">两周</a-select-option>
<a-select-option :value="4"></a-select-option>
<a-select-option :value="5"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期任务数量" name="startCount">
<a-input-number v-model:value="formData.startCount" placeholder="请输入周期任务数量" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="周期开始时间" name="startTime">
<a-date-picker v-model:value="formData.startTime" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" placeholder="请选择周期开始时间" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="外键" name="mainId" style="display: none">
<a-input v-model:value="formData.mainId" placeholder="请输入外键" allow-clear></a-input>
@@ -65,7 +144,21 @@
responTime: '',
implStatus: '',
completionStatus: '',
completionPlan: '',
mainId: '',
num: undefined,
method: '',
deadline: '',
outcomeForm: '',
progress: '',
sumMethodNum: '',
checkStatus: '',
inspectionAdvice: '',
measureNum: undefined,
launchType: undefined,
intervalType: undefined,
startCount: undefined,
startTime: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
@@ -109,7 +202,18 @@
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key];
let value = record[key];
// 处理日期字段,Date 对象转换为字符串
if (key === 'deadline' && value instanceof Date) {
value = value.format('YYYY-MM-DD HH:mm:ss');
}
if (key === 'responTime' && value instanceof Date) {
value = value.format('YYYY-MM-DD HH:mm:ss');
}
if (key === 'startTime' && value instanceof Date) {
value = value.format('YYYY-MM-DD HH:mm:ss');
}
tmpData[key] = value;
}
});
Object.assign(formData, tmpData);