|
|
@@ -118,6 +118,9 @@
|
|
|
<!-- 审核弹窗 -->
|
|
|
<el-dialog v-model="auditDialogVisible" :title="auditStatus === 2 ? '审核通过' : '审核拒绝'" width="400px" center>
|
|
|
<el-form ref="auditFormRef" :model="auditFormData" label-width="80px">
|
|
|
+ <el-form-item v-if="auditStatus === 3" label="拒绝原因">
|
|
|
+ <el-input v-model="auditFormData.rejectReason" type="textarea" :rows="2" placeholder="请输入拒绝原因" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="审核备注">
|
|
|
<el-input v-model="auditFormData.auditRemark" type="textarea" :rows="3" placeholder="请输入审核备注" />
|
|
|
</el-form-item>
|
|
|
@@ -165,9 +168,39 @@ const currentSubmitData = ref(null);
|
|
|
|
|
|
const viewSubmitData = (row) => {
|
|
|
try {
|
|
|
- currentSubmitData.value = typeof row.screenshots === "string" ? JSON.parse(row.screenshots) : row.screenshots;
|
|
|
+ let data = typeof row.screenshots === "string" ? JSON.parse(row.screenshots) : row.screenshots;
|
|
|
+ // 确保数据是数组格式
|
|
|
+ if (!Array.isArray(data)) {
|
|
|
+ data = [data];
|
|
|
+ }
|
|
|
+ // 兼容不同的数据格式,确保每个项都有 type 字段
|
|
|
+ currentSubmitData.value = data.map((item, index) => {
|
|
|
+ // 如果 item 是字符串(直接是图片URL),转换为对象格式
|
|
|
+ if (typeof item === "string") {
|
|
|
+ return { step: index + 1, type: "screenshot", value: item };
|
|
|
+ }
|
|
|
+ // 如果没有 type 字段,根据 value 判断类型
|
|
|
+ if (!item.type) {
|
|
|
+ const value = item.value || item.url || item;
|
|
|
+ // 如果 value 是字符串且看起来像URL(图片),设置为 screenshot
|
|
|
+ if (typeof value === "string" && (value.startsWith("http") || value.startsWith("/"))) {
|
|
|
+ return { ...item, step: item.step || index + 1, type: "screenshot", value };
|
|
|
+ }
|
|
|
+ // 如果 value 是数组(多张图片),设置为 screenshot
|
|
|
+ if (Array.isArray(value)) {
|
|
|
+ return { ...item, step: item.step || index + 1, type: "screenshot", value };
|
|
|
+ }
|
|
|
+ return { ...item, step: item.step || index + 1, type: "text", value };
|
|
|
+ }
|
|
|
+ return { ...item, step: item.step || index + 1 };
|
|
|
+ });
|
|
|
} catch (e) {
|
|
|
- currentSubmitData.value = [{ value: row.screenshots }];
|
|
|
+ // 解析失败时,尝试直接作为图片URL处理
|
|
|
+ if (typeof row.screenshots === "string" && row.screenshots.startsWith("http")) {
|
|
|
+ currentSubmitData.value = [{ step: 1, type: "screenshot", value: row.screenshots }];
|
|
|
+ } else {
|
|
|
+ currentSubmitData.value = [{ step: 1, type: "text", value: row.screenshots }];
|
|
|
+ }
|
|
|
}
|
|
|
dataDialogVisible.value = true;
|
|
|
};
|
|
|
@@ -178,12 +211,12 @@ const auditLoading = ref(false);
|
|
|
const auditStatus = ref(2);
|
|
|
const currentAuditRow = ref(null);
|
|
|
const auditFormRef = ref(null);
|
|
|
-const auditFormData = ref({ auditRemark: "" });
|
|
|
+const auditFormData = ref({ auditRemark: "", rejectReason: "" });
|
|
|
|
|
|
const handleAudit = (row, status) => {
|
|
|
currentAuditRow.value = row;
|
|
|
auditStatus.value = status;
|
|
|
- auditFormData.value = { auditRemark: "" };
|
|
|
+ auditFormData.value = { auditRemark: "", rejectReason: "" };
|
|
|
auditDialogVisible.value = true;
|
|
|
};
|
|
|
|
|
|
@@ -193,7 +226,8 @@ const submitAudit = async () => {
|
|
|
const params = {
|
|
|
id: currentAuditRow.value.id,
|
|
|
status: auditStatus.value,
|
|
|
- auditRemark: auditFormData.value.auditRemark
|
|
|
+ auditRemark: auditFormData.value.auditRemark,
|
|
|
+ rejectReason: auditFormData.value.rejectReason
|
|
|
};
|
|
|
const res = await auditUserTask(params);
|
|
|
if (res.code === 200) {
|