|
@@ -262,21 +262,31 @@
|
|
|
return row.statusId === 3;
|
|
return row.statusId === 3;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /** 第一个待反馈的下发记录,用于底部「提交」按钮 */
|
|
|
|
|
- const pendingFeedbackRow = computed(() => {
|
|
|
|
|
- const records = detailData.value?.issueRecords;
|
|
|
|
|
- if (!Array.isArray(records)) return null;
|
|
|
|
|
- return records.find((r) => r.statusId === 3) ?? null;
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- /** 底部提交:打开部门反馈弹窗并预填附件,若无待反馈任务则提示 */
|
|
|
|
|
- function handleSubmit() {
|
|
|
|
|
- const row = pendingFeedbackRow.value;
|
|
|
|
|
- if (!row) {
|
|
|
|
|
- ElMessage.warning('暂无待反馈任务');
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ /** 底部提交:直接调用反馈接口(使用当前详情主记录 id) */
|
|
|
|
|
+ async function handleSubmit() {
|
|
|
|
|
+ const id = currentId.value;
|
|
|
|
|
+ if (!id) return;
|
|
|
|
|
+ try {
|
|
|
|
|
+ let attachments = '';
|
|
|
|
|
+ if (hasProblem.value && materialAttachmentList.value.length) {
|
|
|
|
|
+ const formatted = await formatAttachmentList(materialAttachmentList.value);
|
|
|
|
|
+ attachments = JSON.stringify(formatted);
|
|
|
|
|
+ }
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ const feedbackTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;
|
|
|
|
|
+ await submitDrawLessonsDeptFeedback({
|
|
|
|
|
+ id,
|
|
|
|
|
+ feedbackHasIssue: hasProblem.value ? 1 : 0,
|
|
|
|
|
+ feedbackResult: '',
|
|
|
|
|
+ feedbackTime,
|
|
|
|
|
+ attachments,
|
|
|
|
|
+ });
|
|
|
|
|
+ ElMessage.success('反馈提交成功');
|
|
|
|
|
+ getDetail();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('反馈提交失败:', e);
|
|
|
|
|
+ ElMessage.error('反馈提交失败,请重试');
|
|
|
}
|
|
}
|
|
|
- openFeedbackDialog(row);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|