|
@@ -4,10 +4,8 @@
|
|
|
<template #title> 报告生成 </template>
|
|
|
<template #extra>
|
|
|
<n-space>
|
|
|
- <n-button type="primary" @click="showCreateDialog">生成方案</n-button>
|
|
|
- <n-button type="primary" @click="showUploadModal"
|
|
|
- >上传验证实施方案</n-button
|
|
|
- >
|
|
|
+ <n-button type="primary" @click="showCreateDialog">生成报告</n-button>
|
|
|
+ <n-button type="primary" @click="showUploadModal">上传验证</n-button>
|
|
|
</n-space>
|
|
|
</template>
|
|
|
</n-page-header>
|
|
@@ -15,9 +13,8 @@
|
|
|
label-placement="left"
|
|
|
label-width="auto"
|
|
|
size="large"
|
|
|
- :show-feedback="false"
|
|
|
show-require-mark
|
|
|
- class="w-2/5 mx-auto flex-1 flex flex-col justify-between"
|
|
|
+ class="w-2/5 mx-auto"
|
|
|
>
|
|
|
<template
|
|
|
v-for="(item, i) of templateList"
|
|
@@ -51,7 +48,6 @@
|
|
|
multiple
|
|
|
scrollable
|
|
|
:options="classList"
|
|
|
- :render-label="renderLabel"
|
|
|
v-model:value="item.T_value"
|
|
|
>
|
|
|
<div class="overflow-x-auto">
|
|
@@ -66,10 +62,10 @@
|
|
|
<template #action>
|
|
|
<n-space>
|
|
|
<n-button class="underline" text @click="handleSelectAll(i)"
|
|
|
- >全选</n-button
|
|
|
+ >全选</n-button
|
|
|
>
|
|
|
<n-button class="underline" text @click="handleSelectReverse(i)"
|
|
|
- >反选</n-button
|
|
|
+ >反选</n-button
|
|
|
>
|
|
|
</n-space>
|
|
|
</template>
|
|
@@ -194,8 +190,6 @@ import * as qiniu from "qiniu-js";
|
|
|
import { getToken } from "@/utils/storage/sessionToken";
|
|
|
import { getFileToken } from "@/common";
|
|
|
import { InformationCircleOutline } from "@vicons/ionicons5";
|
|
|
-import { NThing } from "naive-ui";
|
|
|
-import { h } from "vue";
|
|
|
|
|
|
const message = useMessage();
|
|
|
|
|
@@ -227,17 +221,6 @@ const modal = reactive({
|
|
|
});
|
|
|
|
|
|
//
|
|
|
-const renderLabel = (option) => {
|
|
|
- return h(
|
|
|
- NThing,
|
|
|
- {},
|
|
|
- {
|
|
|
- description: () => option.value,
|
|
|
- }
|
|
|
- );
|
|
|
-};
|
|
|
-
|
|
|
-//
|
|
|
const handleChange = async (options) => {
|
|
|
if (options.file.type.split("/")[1] === "pdf") {
|
|
|
const token = await getFileToken(options.file.type.split("/")[1]);
|
|
@@ -256,7 +239,7 @@ const handleChange = async (options) => {
|
|
|
console.warn(result);
|
|
|
},
|
|
|
error: () => {
|
|
|
- message.error("上传图片失败");
|
|
|
+ message.error("上传失败");
|
|
|
},
|
|
|
complete: (res) => {
|
|
|
pdf2.value = res.key;
|
|
@@ -266,23 +249,21 @@ const handleChange = async (options) => {
|
|
|
};
|
|
|
|
|
|
// 全选
|
|
|
-// const handleSelectAll = (i) => {
|
|
|
-// formValue.VerifyTemplateMapData[i].T_value = classList.value.map(
|
|
|
-// (item) => item.value
|
|
|
-// );
|
|
|
-// };
|
|
|
+const handleSelectAll = (i) => {
|
|
|
+ templateList.value[i].T_value = classList.value.map((item) => item.value);
|
|
|
+};
|
|
|
|
|
|
// 反选
|
|
|
-// const handleSelectReverse = (i) => {
|
|
|
-// const arr = classList.value.map((item) => item.value);
|
|
|
-// formValue.VerifyTemplateMapData[i].T_value = arr.filter(
|
|
|
-// (item) => formValue.VerifyTemplateMapData[i].T_value.indexOf(item) === -1
|
|
|
-// );
|
|
|
-// };
|
|
|
+const handleSelectReverse = (i) => {
|
|
|
+ const arr = classList.value.map((item) => item.value);
|
|
|
+ templateList.value[i].T_value = arr.filter(
|
|
|
+ (item) => !templateList.value[i].T_value.includes(item)
|
|
|
+ );
|
|
|
+};
|
|
|
|
|
|
//
|
|
|
const showUploadModal = () => {
|
|
|
- modal.title = "上传验证实施方案";
|
|
|
+ modal.title = "上传验证";
|
|
|
modal.showModal = true;
|
|
|
};
|
|
|
|
|
@@ -291,7 +272,7 @@ const editTaskInfo = async () => {
|
|
|
try {
|
|
|
const { data: res } = await editTask({
|
|
|
T_task_id: queryData.T_task_id,
|
|
|
- T_pdf1: pdf2.value,
|
|
|
+ T_pdf2: pdf2.value,
|
|
|
});
|
|
|
if (res.Code === 200) {
|
|
|
message.success(res.Msg);
|
|
@@ -326,17 +307,17 @@ const showCreateDialog = async () => {
|
|
|
console.warn(result);
|
|
|
},
|
|
|
error: () => {
|
|
|
- message.error("上传图片失败");
|
|
|
+ message.error("上传失败");
|
|
|
},
|
|
|
complete: (res) => {
|
|
|
item.T_value = res.key;
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
- item.T_value = item.T_value[0].url;
|
|
|
+ item.T_value = Array.isArray(item.T_value)
|
|
|
+ ? item.T_value[0].url
|
|
|
+ : item.T_value;
|
|
|
}
|
|
|
- } else if (item.T_label === 3 || item.T_label === 9) {
|
|
|
- item.T_value = item.T_value.join("|");
|
|
|
}
|
|
|
}
|
|
|
dialog.info({
|
|
@@ -353,13 +334,26 @@ const showCreateDialog = async () => {
|
|
|
//
|
|
|
const putTemplateData = async () => {
|
|
|
try {
|
|
|
+ const VerifyTemplateMapData = templateData.map((item) => {
|
|
|
+ if (item.T_label === 3 || item.T_label === 9) {
|
|
|
+ return {
|
|
|
+ T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
|
+ T_value: item.T_value.join("|"),
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
|
+ T_value: item.T_value + "",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
const token = getToken();
|
|
|
const { data: res } = await putVerifyTemplateMapData({
|
|
|
User_tokey: token,
|
|
|
T_source: queryData.T_source,
|
|
|
T_task_id: queryData.T_task_id,
|
|
|
T_VerifyTemplate_id: queryData.T_VerifyTemplate_id,
|
|
|
- VerifyTemplateMapData: templateData,
|
|
|
+ VerifyTemplateMapData,
|
|
|
});
|
|
|
message.success(res.Msg);
|
|
|
} catch (e) {
|
|
@@ -385,10 +379,12 @@ const getClassList = async () => {
|
|
|
const getTemplateList = async () => {
|
|
|
try {
|
|
|
const { data: res } = await getVerifyTemplateMapDataList(queryData);
|
|
|
- templateList.value = res.Data || [];
|
|
|
+ templateList.value = res.Data;
|
|
|
templateList.value.forEach((item) => {
|
|
|
if (item.T_label === 10 || item.T_label === 11) {
|
|
|
- item.T_value = item.T_value ? [{ url: item.T_value, status: "finished" }] : [];
|
|
|
+ item.T_value = item.T_value
|
|
|
+ ? [{ url: item.T_value, status: "finished" }]
|
|
|
+ : [];
|
|
|
} else if (item.T_label === 7) {
|
|
|
item.T_value = item.T_value ? item.T_value : null;
|
|
|
} else if (item.T_label === 9) {
|