yxk-20260519-
YHJY005-添加反馈表完成状态字典项 YHJY008-对于反馈信息中间状态不需要保留,每次只编辑不新增
This commit is contained in:
@@ -151,7 +151,8 @@ export const bgPartymatterFeedbackColumns: BasicColumn[] = [
|
|||||||
{
|
{
|
||||||
title: '完成状态',
|
title: '完成状态',
|
||||||
align:"center",
|
align:"center",
|
||||||
dataIndex: 'bpmStatus'
|
dataIndex: 'bpmStatus',
|
||||||
|
customRender: ({ record }) => record?.bpmStatus_dictText || record?.bpmStatus
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '外键',
|
// title: '外键',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<JModal
|
<JModal
|
||||||
title="新增反馈"
|
:title="modalTitle"
|
||||||
:width="820"
|
:width="820"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:confirmLoading="saving"
|
:confirmLoading="saving"
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<!-- </a-col>-->
|
<!-- </a-col>-->
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="完成状态" name="bpmStatus">
|
<a-form-item label="完成状态" name="bpmStatus">
|
||||||
<a-input v-model:value="formData.bpmStatus" allow-clear />
|
<JDictSelectTag v-model:value="formData.bpmStatus" dictCode="feedback_status" placeholder="请选择完成状态" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -78,6 +78,7 @@
|
|||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { buildUUID } from '/@/utils/uuid';
|
import { buildUUID } from '/@/utils/uuid';
|
||||||
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
@@ -85,6 +86,7 @@
|
|||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const saving = ref(false);
|
const saving = ref(false);
|
||||||
|
const modalTitle = ref('新增反馈');
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const uploadFileRef = ref<InstanceType<typeof SUploadFile> | null>(null);
|
const uploadFileRef = ref<InstanceType<typeof SUploadFile> | null>(null);
|
||||||
const uploadSecretLevel = ref(1);
|
const uploadSecretLevel = ref(1);
|
||||||
@@ -121,10 +123,22 @@
|
|||||||
nextTick(() => formRef.value?.clearValidate?.());
|
nextTick(() => formRef.value?.clearValidate?.());
|
||||||
}
|
}
|
||||||
|
|
||||||
function open(mainId: string, secretLevel?: string | number, bpmProcessId = '') {
|
function open(mainId: string, secretLevel?: string | number, bpmProcessId = '', record?: Record<string, any>) {
|
||||||
resetForm(mainId, bpmProcessId);
|
resetForm(mainId, bpmProcessId);
|
||||||
uploadSecretLevel.value = normalizeSecretLevel(secretLevel);
|
uploadSecretLevel.value = normalizeSecretLevel(secretLevel);
|
||||||
|
if (record?.id) {
|
||||||
|
modalTitle.value = '编辑反馈';
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(record, key)) {
|
||||||
|
formData[key] = record[key] ?? '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
formData.mainId = formData.mainId || mainId;
|
||||||
|
formData.bpmProcessId = formData.bpmProcessId || bpmProcessId;
|
||||||
|
} else {
|
||||||
|
modalTitle.value = '新增反馈';
|
||||||
void applyCurrentUserFeedbackInfo();
|
void applyCurrentUserFeedbackInfo();
|
||||||
|
}
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,11 +200,14 @@
|
|||||||
}
|
}
|
||||||
saving.value = true;
|
saving.value = true;
|
||||||
try {
|
try {
|
||||||
|
const isUpdate = !!formData.id;
|
||||||
|
if (!isUpdate) {
|
||||||
await applyCurrentUserFeedbackInfo();
|
await applyCurrentUserFeedbackInfo();
|
||||||
if (!formData.id && uploadFileRef.value?.hasPendingFiles?.()) {
|
}
|
||||||
|
if (!isUpdate && uploadFileRef.value?.hasPendingFiles?.()) {
|
||||||
formData.id = buildUUID();
|
formData.id = buildUUID();
|
||||||
}
|
}
|
||||||
const res = await bgPartymatterFeedbackSaveOrUpdate({ ...formData }, false);
|
const res = await bgPartymatterFeedbackSaveOrUpdate({ ...formData }, isUpdate);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
if (formData.id && uploadFileRef.value?.hasPendingFiles?.()) {
|
if (formData.id && uploadFileRef.value?.hasPendingFiles?.()) {
|
||||||
await uploadFileRef.value.bindBussinessId(formData.id);
|
await uploadFileRef.value.bindBussinessId(formData.id);
|
||||||
|
|||||||
@@ -109,12 +109,13 @@
|
|||||||
:columns="feedbackColumns"
|
:columns="feedbackColumns"
|
||||||
:data-source="feedbackList"
|
:data-source="feedbackList"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ x: 1220 }"
|
:scroll="{ x: 1340 }"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'attachments'">
|
<template v-if="column.key === 'attachments'">
|
||||||
<SUploadFile
|
<SUploadFile
|
||||||
v-if="record.id"
|
v-if="record.id"
|
||||||
|
:key="getFeedbackAttachmentKey(record)"
|
||||||
class="feedback-attachment-list"
|
class="feedback-attachment-list"
|
||||||
:bussiness-id="record.id"
|
:bussiness-id="record.id"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
@@ -122,6 +123,14 @@
|
|||||||
/>
|
/>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a-button type="link" size="small" @click="openFeedbackEditModal(record)">编辑</a-button>
|
||||||
|
<a-popconfirm title="是否确认删除" @confirm="handleFeedbackDelete(record)">
|
||||||
|
<a-button type="link" size="small" danger>删除</a-button>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|
||||||
@@ -178,7 +187,7 @@
|
|||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||||
import Icon from '/@/components/Icon/index';
|
import Icon from '/@/components/Icon/index';
|
||||||
import { bgPartymatterFeedbackList, saveBpmForm, setProcessVariable } from '../BgPartymatter.api';
|
import { bgPartymatterFeedbackDelete, bgPartymatterFeedbackList, saveBpmForm, setProcessVariable } from '../BgPartymatter.api';
|
||||||
import { usePermission } from '/@/hooks/web/usePermission';
|
import { usePermission } from '/@/hooks/web/usePermission';
|
||||||
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
|
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
|
||||||
import JDictSelectTag from "../../../../components/Form/src/jeecg/components/JDictSelectTag.vue";
|
import JDictSelectTag from "../../../../components/Form/src/jeecg/components/JDictSelectTag.vue";
|
||||||
@@ -216,6 +225,7 @@
|
|||||||
const savingSubApproveUser = ref(false);
|
const savingSubApproveUser = ref(false);
|
||||||
const showBaseInfoDetail = ref(false);
|
const showBaseInfoDetail = ref(false);
|
||||||
const feedbackList = ref<any[]>([]);
|
const feedbackList = ref<any[]>([]);
|
||||||
|
const feedbackAttachmentRefreshKey = ref(0);
|
||||||
const subApproveUser = ref('');
|
const subApproveUser = ref('');
|
||||||
const isEnd = ref(0);
|
const isEnd = ref(0);
|
||||||
|
|
||||||
@@ -250,8 +260,9 @@
|
|||||||
{ title: '反馈人姓名', dataIndex: 'responPersonname', align: 'center', width: 140 },
|
{ title: '反馈人姓名', dataIndex: 'responPersonname', align: 'center', width: 140 },
|
||||||
{ title: '实际执行情况', dataIndex: 'actualExect', align: 'left', width: 280 },
|
{ title: '实际执行情况', dataIndex: 'actualExect', align: 'left', width: 280 },
|
||||||
{ title: '实际完成时间', dataIndex: 'actualTime', align: 'center', width: 180 },
|
{ title: '实际完成时间', dataIndex: 'actualTime', align: 'center', width: 180 },
|
||||||
{ title: '完成状态', dataIndex: 'bpmStatus', align: 'center', width: 120 },
|
{ title: '完成状态', dataIndex: 'bpmStatus', align: 'center', width: 120, customRender: ({ record }) => record?.bpmStatus_dictText || record?.bpmStatus },
|
||||||
{ title: '附件', dataIndex: 'id', key: 'attachments', align: 'left', width: 340 },
|
{ title: '附件', dataIndex: 'id', key: 'attachments', align: 'left', width: 340 },
|
||||||
|
{ title: '操作', dataIndex: 'action', key: 'action', align: 'center', width: 120, fixed: 'right' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const mainDisabled = computed(() => {
|
const mainDisabled = computed(() => {
|
||||||
@@ -323,10 +334,16 @@
|
|||||||
const bpmProcessId = processInfo.value.processInstanceId;
|
const bpmProcessId = processInfo.value.processInstanceId;
|
||||||
if (!mainForm.id || !bpmProcessId) {
|
if (!mainForm.id || !bpmProcessId) {
|
||||||
feedbackList.value = [];
|
feedbackList.value = [];
|
||||||
|
feedbackAttachmentRefreshKey.value += 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const res = await bgPartymatterFeedbackList({ mainId: mainForm.id, bpmProcessId, pageNo: 1, pageSize: 999 });
|
const res = await bgPartymatterFeedbackList({ mainId: mainForm.id, bpmProcessId, pageNo: 1, pageSize: 999 });
|
||||||
feedbackList.value = res?.records || res?.result?.records || [];
|
feedbackList.value = res?.records || res?.result?.records || [];
|
||||||
|
feedbackAttachmentRefreshKey.value += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFeedbackAttachmentKey(record: Recordable) {
|
||||||
|
return `${record?.id || ''}-${feedbackAttachmentRefreshKey.value}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submitForm() {
|
async function submitForm() {
|
||||||
@@ -389,6 +406,28 @@
|
|||||||
feedbackModalRef.value?.open(mainForm.id, mainForm.secretLevel, processInstanceId);
|
feedbackModalRef.value?.open(mainForm.id, mainForm.secretLevel, processInstanceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openFeedbackEditModal(record: Recordable) {
|
||||||
|
if (!record?.id) {
|
||||||
|
createMessage.warning('反馈记录不存在,无法编辑');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
feedbackModalRef.value?.open(mainForm.id, mainForm.secretLevel, processInfo.value.processInstanceId, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleFeedbackDelete(record: Recordable) {
|
||||||
|
if (!record?.id) {
|
||||||
|
createMessage.warning('反馈记录不存在,无法删除');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await bgPartymatterFeedbackDelete({ id: record.id }, () => undefined);
|
||||||
|
createMessage.success('删除成功');
|
||||||
|
await loadFeedbackList();
|
||||||
|
} catch (error) {
|
||||||
|
createMessage.warning('删除失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function saveSubApproveUserVariable(options: { showSuccessMessage?: boolean } = {}) {
|
async function saveSubApproveUserVariable(options: { showSuccessMessage?: boolean } = {}) {
|
||||||
const { showSuccessMessage = true } = options;
|
const { showSuccessMessage = true } = options;
|
||||||
const processInstanceId = processInfo.value.processInstanceId;
|
const processInstanceId = processInfo.value.processInstanceId;
|
||||||
|
|||||||
Reference in New Issue
Block a user