|
@@ -149,11 +149,20 @@ const getTableData = async () => {
|
|
|
}
|
|
|
|
|
|
//查看报告
|
|
|
-const rowView = ({ pdfUrl }) => {
|
|
|
- if (isNullES(pdfUrl)) {
|
|
|
- window?.$message.error('暂无报告文件')
|
|
|
+const rowView = async ({ testId }) => {
|
|
|
+ if (isNullES(testId)) {
|
|
|
+ window?.$message.error('暂未关联试验')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //获取PDF
|
|
|
+ const { error, code, msg, data } = await mainApi.getSamplePdfUrl({
|
|
|
+ contractId: searchForm.value.contractId,
|
|
|
+ testId: testId,
|
|
|
+ })
|
|
|
+ if (!error && code === 200 && !isNullES(data)) {
|
|
|
+ toPdfPage(data)
|
|
|
} else {
|
|
|
- toPdfPage(pdfUrl)
|
|
|
+ window.$message.error(msg || '暂无报告文件')
|
|
|
}
|
|
|
}
|
|
|
</script>
|