From 0d11525aa58ec5e35ea22ff4b0d6d5863d73649b Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 04 三月 2025 16:43:52 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before-ruoyi
---
src/views/CNAS/process/ensureResults/ensureResultsValidity/components/ViewRecord.vue | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 171 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/ViewRecord.vue b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/ViewRecord.vue
new file mode 100644
index 0000000..0db2c44
--- /dev/null
+++ b/src/views/CNAS/process/ensureResults/ensureResultsValidity/components/ViewRecord.vue
@@ -0,0 +1,171 @@
+<template>
+ <div>
+ <el-dialog :visible.sync="filesDialogVisible" title="闄勪欢涓婁紶" width="80%" @closed="closeFilesLook">
+ <div style="display: flex;justify-content: space-between;">
+ <el-upload ref='upload' :action="fileAction" :auto-upload="true" :before-upload="fileBeforeUpload"
+ :data="{ detailsEvaluateId: info.detailsEvaluateId }" :headers="uploadHeader" :on-error="onError"
+ :on-success="handleSuccessUp" :show-file-list="false"
+ accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;">
+ <el-button size="small" style="height: 38px" type="primary">闄勪欢涓婁紶</el-button>
+ </el-upload>
+ </div>
+ <div>
+ <limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 47em)'" :highlightCurrentRow="true"
+ :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;">
+ </limsTable>
+ </div>
+ </el-dialog>
+ <el-dialog :visible.sync="lookDialogVisible" fullscreen title="鏌ョ湅闄勪欢" width="800px">
+ <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/word/' + currentInfo.fileUrl"
+ style="height: 90vh;overflow-y: auto;top: 0" />
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from "@/components/Preview/filePreview.vue";
+import {
+ delVerifyEvaluateFileList,
+ getEvaluateFileList,
+} from '@/api/cnas/process/ensureResults/ensureResultsValidity.js'
+export default {
+ name: 'ViewRecord',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: { filePreview, limsTable },
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ filesDialogVisible: false,
+ tableLoading: false,
+ filesLookInfo: {},
+ columnData: [
+ {
+ label: '鏂囦欢鍚嶇О',
+ prop: 'fileName',
+ minWidth: '150px'
+ },
+ {
+ dataType: 'action',
+ minWidth: '100',
+ label: '鎿嶄綔',
+ fixed: 'right',
+ operation: [
+ {
+ name: '棰勮',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleLook(row)
+ }
+ },
+ {
+ name: '涓嬭浇',
+ type: 'text',
+ clickFun: (row) => {
+ this.upload(row)
+ }
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delete(row)
+ }
+ }
+ ]
+ }
+ ],
+ tableData: [],
+ info: {},
+ currentInfo: {},
+ lookDialogVisible: false,
+ };
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ openDia(row) {
+ this.filesDialogVisible = true
+ console.log(1111, row)
+ this.info = row
+ this.searchTableList()
+ },
+ // 鏌ヨ闄勪欢鍒楄〃
+ searchTableList() {
+ this.tableLoading = true
+ getEvaluateFileList({ detailsEvaluateId: this.info.detailsEvaluateId }).then(res => {
+ this.tableLoading = false
+ if (res.code === 201) return
+ this.tableData = res.data
+ }).catch(err => {
+ this.tableLoading = false
+ console.log('err---', err);
+ })
+ },
+ closeFilesLook() {
+ this.filesDialogVisible = false
+ },
+ // 涓嬭浇
+ upload(row) {
+ let url = '';
+ if (row.type == 1) {
+ url = this.javaApi + '/img/' + row.fileUrl
+ this.$download.saveAs(url, row.fileName)
+ } else {
+ url = this.javaApi + '/word/' + row.fileUrlrow.fileName;
+ link.click();
+ this.$download.saveAs(url, row.fileName)
+ }
+ },
+ // 鍒犻櫎
+ delete(row) {
+ this.tableLoading = true
+ delVerifyEvaluateFileList({ evaluateFileId: row.evaluateFileId }).then(res => {
+ this.tableLoading = false
+ if (res.code === 201) return
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.searchTableList()
+ }).catch(err => {
+ this.tableLoading = false
+ console.log('err---', err);
+ })
+ },
+ // 涓婁紶楠岃瘉
+ fileBeforeUpload(file) {
+ let flag = true
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ flag = false
+ }
+ if (!flag) {
+ return Promise.reject(flag); //姝g‘鐨勭粓姝�
+ }
+ },
+ onError(err, file, fileList, type) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ handleSuccessUp(response,) {
+ this.upLoading = false;
+ if (response.code == 200) {
+ this.$message.success('涓婁紶鎴愬姛');
+ this.searchTableList()
+ }
+ },
+ // 鏌ョ湅鏂囦欢
+ handleLook(row) {
+ this.currentInfo = row
+ this.lookDialogVisible = true
+ },
+ },
+ computed: {
+ fileAction() {
+ return this.javaApi + '/qualityMonitor/uploadEvaluateFile'
+
+ }
+ },
+};
+</script>
+
+<style scoped></style>
--
Gitblit v1.9.3