|
@@ -14,13 +14,13 @@
|
|
</n-space>
|
|
</n-space>
|
|
</template>
|
|
</template>
|
|
</n-page-header>
|
|
</n-page-header>
|
|
- <n-scrollbar :style="{ maxHeight: `${height - 200}px` }" trigger="none">
|
|
|
|
|
|
+ <n-scrollbar :style="{ maxHeight: `${height - 150}px` }" trigger="none">
|
|
<n-form
|
|
<n-form
|
|
label-placement="left"
|
|
label-placement="left"
|
|
label-width="auto"
|
|
label-width="auto"
|
|
size="large"
|
|
size="large"
|
|
show-require-mark
|
|
show-require-mark
|
|
- class="w-2/5 mx-auto"
|
|
|
|
|
|
+ class="w-[800px] mx-auto"
|
|
>
|
|
>
|
|
<template
|
|
<template
|
|
v-for="(item, index) of templateList"
|
|
v-for="(item, index) of templateList"
|
|
@@ -137,11 +137,12 @@
|
|
<n-form-item :label="item.T_name" v-else-if="item.T_label === 10">
|
|
<n-form-item :label="item.T_name" v-else-if="item.T_label === 10">
|
|
<n-image class="mr-5" width="100" :src="item.T_value" />
|
|
<n-image class="mr-5" width="100" :src="item.T_value" />
|
|
<n-upload
|
|
<n-upload
|
|
|
|
+ list-type="image-card"
|
|
@change="(options) => handleChangeByIndex(options, index)"
|
|
@change="(options) => handleChangeByIndex(options, index)"
|
|
:default-upload="false"
|
|
:default-upload="false"
|
|
:max="1"
|
|
:max="1"
|
|
>
|
|
>
|
|
- <n-button>点击上传</n-button>
|
|
|
|
|
|
+ 点击上传
|
|
</n-upload>
|
|
</n-upload>
|
|
<n-popover trigger="hover">
|
|
<n-popover trigger="hover">
|
|
<template #trigger>
|
|
<template #trigger>
|
|
@@ -175,31 +176,42 @@
|
|
v-model:show="modal.showModal"
|
|
v-model:show="modal.showModal"
|
|
:show-icon="false"
|
|
:show-icon="false"
|
|
preset="dialog"
|
|
preset="dialog"
|
|
|
|
+ :mask-closable="false"
|
|
:title="modal.title"
|
|
:title="modal.title"
|
|
|
|
+ @close="handleClose"
|
|
>
|
|
>
|
|
- <n-upload
|
|
|
|
- :default-upload="false"
|
|
|
|
- :max="1"
|
|
|
|
- @change="handleChange"
|
|
|
|
- v-if="modal.title === '上传验证'"
|
|
|
|
- >
|
|
|
|
- <n-button> 上传文件 </n-button>
|
|
|
|
- </n-upload>
|
|
|
|
- <n-alert
|
|
|
|
- :title="keyInfo.Msg"
|
|
|
|
- :type="code === 200 ? 'info' : code === 201 ? 'success' : 'error'"
|
|
|
|
- v-else
|
|
|
|
- >
|
|
|
|
- <div>进度:{{ keyInfo.Schedule }}%</div>
|
|
|
|
- <n-list>
|
|
|
|
- <n-list-item :key="index" v-for="(item, index) of items">
|
|
|
|
- <template #prefix>
|
|
|
|
- {{ index }}
|
|
|
|
- </template>
|
|
|
|
- {{ item }}
|
|
|
|
- </n-list-item>
|
|
|
|
- </n-list>
|
|
|
|
- </n-alert>
|
|
|
|
|
|
+ <n-scrollbar style="max-height: 200px" trigger="none" ref="scroll">
|
|
|
|
+ <n-upload
|
|
|
|
+ list-type="image-card"
|
|
|
|
+ :default-upload="false"
|
|
|
|
+ :max="1"
|
|
|
|
+ @change="handleChange"
|
|
|
|
+ v-if="modal.title === '上传验证'"
|
|
|
|
+ >
|
|
|
|
+ 上传文件
|
|
|
|
+ </n-upload>
|
|
|
|
+ <n-alert
|
|
|
|
+ :title="keyInfo.Msg"
|
|
|
|
+ :type="
|
|
|
|
+ keyInfo.Code === 600
|
|
|
|
+ ? 'info'
|
|
|
|
+ : keyInfo.Code === 601
|
|
|
|
+ ? 'success'
|
|
|
|
+ : 'error'
|
|
|
|
+ "
|
|
|
|
+ v-else
|
|
|
|
+ >
|
|
|
|
+ <div>进度:{{ keyInfo.Schedule }}%</div>
|
|
|
|
+ <n-list class="bg-transparent">
|
|
|
|
+ <n-list-item :key="index" v-for="(item, index) of items">
|
|
|
|
+ <template #prefix>
|
|
|
|
+ {{ index }}
|
|
|
|
+ </template>
|
|
|
|
+ {{ item }}
|
|
|
|
+ </n-list-item>
|
|
|
|
+ </n-list>
|
|
|
|
+ </n-alert>
|
|
|
|
+ </n-scrollbar>
|
|
<template #action>
|
|
<template #action>
|
|
<n-space v-if="modal.title === '上传验证'">
|
|
<n-space v-if="modal.title === '上传验证'">
|
|
<n-button @click="modal.showModal = false">取消</n-button>
|
|
<n-button @click="modal.showModal = false">取消</n-button>
|
|
@@ -208,8 +220,8 @@
|
|
<n-button
|
|
<n-button
|
|
v-else
|
|
v-else
|
|
type="primary"
|
|
type="primary"
|
|
- :disabled="code !== 201"
|
|
|
|
- @click="window.open(keyInfo.Data)"
|
|
|
|
|
|
+ :disabled="keyInfo.Code !== 601"
|
|
|
|
+ @click="handleDownload"
|
|
>下载文件</n-button
|
|
>下载文件</n-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -237,12 +249,17 @@ const { height } = useWindowSize();
|
|
|
|
|
|
const message = useMessage();
|
|
const message = useMessage();
|
|
|
|
|
|
|
|
+const scroll = ref(null);
|
|
|
|
+
|
|
const task = window.sessionStorage.getItem('task')
|
|
const task = window.sessionStorage.getItem('task')
|
|
? JSON.parse(window.sessionStorage.getItem('task'))
|
|
? JSON.parse(window.sessionStorage.getItem('task'))
|
|
: {};
|
|
: {};
|
|
|
|
|
|
-// 获取表项中收集到的值的对象
|
|
|
|
-const pdf2 = ref('');
|
|
|
|
|
|
+// 表单对象
|
|
|
|
+const formValue = reactive({
|
|
|
|
+ pdf: '',
|
|
|
|
+ templateList: [],
|
|
|
|
+});
|
|
|
|
|
|
// 查询数据
|
|
// 查询数据
|
|
const queryData = reactive({
|
|
const queryData = reactive({
|
|
@@ -263,7 +280,7 @@ const modal = reactive({
|
|
title: '',
|
|
title: '',
|
|
});
|
|
});
|
|
|
|
|
|
-// 刷新CAD
|
|
|
|
|
|
+// CAD刷新
|
|
const handleRefresh = (index) => {
|
|
const handleRefresh = (index) => {
|
|
templateList.value[
|
|
templateList.value[
|
|
index
|
|
index
|
|
@@ -304,7 +321,7 @@ const handleChangeByIndex = async ({ file }, i) => {
|
|
|
|
|
|
//
|
|
//
|
|
const handleChange = async ({ file }) => {
|
|
const handleChange = async ({ file }) => {
|
|
- const token = await getFileToken(file.name.split('/')[1]);
|
|
|
|
|
|
+ const token = await getFileToken(file.name.split('.')[1]);
|
|
const observable = qiniu.upload(
|
|
const observable = qiniu.upload(
|
|
file.file,
|
|
file.file,
|
|
file.name,
|
|
file.name,
|
|
@@ -323,7 +340,7 @@ const handleChange = async ({ file }) => {
|
|
message.error('上传失败');
|
|
message.error('上传失败');
|
|
},
|
|
},
|
|
complete: (res) => {
|
|
complete: (res) => {
|
|
- pdf2.value = res.key;
|
|
|
|
|
|
+ formValue.pdf = res.key;
|
|
},
|
|
},
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -344,31 +361,29 @@ const handleSelectReverse = (i) => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
-//
|
|
|
|
|
|
+// 显示上传验证对话框
|
|
const showUploadModal = () => {
|
|
const showUploadModal = () => {
|
|
modal.title = '上传验证';
|
|
modal.title = '上传验证';
|
|
modal.showModal = true;
|
|
modal.showModal = true;
|
|
};
|
|
};
|
|
|
|
|
|
-//
|
|
|
|
|
|
+// 上传验证
|
|
const editTaskInfo = async () => {
|
|
const editTaskInfo = async () => {
|
|
try {
|
|
try {
|
|
const { data: res } = await editTask({
|
|
const { data: res } = await editTask({
|
|
T_task_id: queryData.T_task_id,
|
|
T_task_id: queryData.T_task_id,
|
|
- T_pdf2: pdf2.value,
|
|
|
|
|
|
+ T_pdf2: formValue.pdf,
|
|
});
|
|
});
|
|
if (res.Code === 200) {
|
|
if (res.Code === 200) {
|
|
message.success(res.Msg);
|
|
message.success(res.Msg);
|
|
|
|
+ modal.showModal = false;
|
|
}
|
|
}
|
|
} catch (e) {
|
|
} catch (e) {
|
|
console.log(e);
|
|
console.log(e);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-/**
|
|
|
|
- * 生成报告
|
|
|
|
- * @returns {Promise<void>}
|
|
|
|
- */
|
|
|
|
|
|
+// 验证报告生成 报告
|
|
const generateReportInfo = async (obj) => {
|
|
const generateReportInfo = async (obj) => {
|
|
const { data: res } = await generateReport({
|
|
const { data: res } = await generateReport({
|
|
T_task_id: task.T_task_id,
|
|
T_task_id: task.T_task_id,
|
|
@@ -382,22 +397,19 @@ const generateReportInfo = async (obj) => {
|
|
|
|
|
|
let timer = 0;
|
|
let timer = 0;
|
|
const keyInfo = ref({});
|
|
const keyInfo = ref({});
|
|
-const code = ref(0);
|
|
|
|
const items = computed(() => {
|
|
const items = computed(() => {
|
|
- if (keyInfo.value.Item) {
|
|
|
|
- return keyInfo.value.Item.split('\n').filter((item) => item);
|
|
|
|
- } else {
|
|
|
|
- return [];
|
|
|
|
- }
|
|
|
|
|
|
+ return keyInfo.value.Item
|
|
|
|
+ ? keyInfo.value.Item.split('\n').filter((item) => item)
|
|
|
|
+ : [];
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+// 验证报告生成 获取生成结果
|
|
const generateKeyInfo = async (key) => {
|
|
const generateKeyInfo = async (key) => {
|
|
const { data: res } = await generateKey({
|
|
const { data: res } = await generateKey({
|
|
key,
|
|
key,
|
|
});
|
|
});
|
|
keyInfo.value = res;
|
|
keyInfo.value = res;
|
|
- code.value = res.Code;
|
|
|
|
- if (res.Code === 200) {
|
|
|
|
|
|
+ if (res.Code === 600) {
|
|
timer = setTimeout(() => {
|
|
timer = setTimeout(() => {
|
|
generateKeyInfo(key);
|
|
generateKeyInfo(key);
|
|
}, 3000);
|
|
}, 3000);
|
|
@@ -406,12 +418,20 @@ const generateKeyInfo = async (key) => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-/**
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
|
|
+// 关闭对话框时触发
|
|
|
|
+const handleClose = () => {
|
|
|
|
+ clearTimeout(timer);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 下载文件
|
|
|
|
+const handleDownload = () => {
|
|
|
|
+ window.open(keyInfo.value.Data);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 生成报告
|
|
const putTemplateData = async () => {
|
|
const putTemplateData = async () => {
|
|
try {
|
|
try {
|
|
- const arr = templateList.value.filter((item) => item.T_label !== 5);
|
|
|
|
|
|
+ const arr = toRaw(templateList.value);
|
|
const VerifyTemplateMapData = arr.map((item) => {
|
|
const VerifyTemplateMapData = arr.map((item) => {
|
|
if (item.T_label === 3 || item.T_label === 9) {
|
|
if (item.T_label === 3 || item.T_label === 9) {
|
|
return {
|
|
return {
|
|
@@ -442,13 +462,13 @@ const putTemplateData = async () => {
|
|
VerifyTemplateMapData,
|
|
VerifyTemplateMapData,
|
|
});
|
|
});
|
|
if (res.Code === 200) {
|
|
if (res.Code === 200) {
|
|
- const arr = toRaw(templateList.value);
|
|
|
|
const obj = {};
|
|
const obj = {};
|
|
for (let i of arr) {
|
|
for (let i of arr) {
|
|
if (i.T_label === 3 || i.T_label === 9) {
|
|
if (i.T_label === 3 || i.T_label === 9) {
|
|
- i.T_value = i.T_value.join('|');
|
|
|
|
|
|
+ obj[i.T_name] = i.T_value.join('|');
|
|
|
|
+ } else {
|
|
|
|
+ obj[i.T_name] = i.T_value;
|
|
}
|
|
}
|
|
- obj[i.T_name] = i.T_value;
|
|
|
|
}
|
|
}
|
|
modal.title = '生成报告';
|
|
modal.title = '生成报告';
|
|
modal.showModal = true;
|
|
modal.showModal = true;
|
|
@@ -477,12 +497,10 @@ const getTemplateList = async () => {
|
|
const { data: res } = await getVerifyTemplateMapDataList(queryData);
|
|
const { data: res } = await getVerifyTemplateMapDataList(queryData);
|
|
templateList.value = res.Data;
|
|
templateList.value = res.Data;
|
|
templateList.value.forEach((item) => {
|
|
templateList.value.forEach((item) => {
|
|
- if (item.T_label === 7) {
|
|
|
|
- item.T_value = item.T_value ? item.T_value : null;
|
|
|
|
- } else if (item.T_label === 9) {
|
|
|
|
|
|
+ if (item.T_label === 3 || item.T_label === 9) {
|
|
item.T_value = item.T_value ? item.T_value.split('|') : null;
|
|
item.T_value = item.T_value ? item.T_value.split('|') : null;
|
|
- } else if (item.T_label === 3) {
|
|
|
|
- item.T_value = item.T_value ? item.T_value.split('|') : [];
|
|
|
|
|
|
+ } else {
|
|
|
|
+ item.T_value = item.T_value ? item.T_value : null;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -491,6 +509,7 @@ const getTemplateList = async () => {
|
|
};
|
|
};
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
onBeforeUnmount(() => {
|
|
|
|
+ // 取消订阅
|
|
clearTimeout(timer);
|
|
clearTimeout(timer);
|
|
});
|
|
});
|
|
|
|
|