From e888346ebcd8e3e099a15c7edd7bf367c057193a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 04 三月 2025 15:33:33 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev'

---
 src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue |  306 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 306 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue b/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue
new file mode 100644
index 0000000..14dc270
--- /dev/null
+++ b/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue
@@ -0,0 +1,306 @@
+<template>
+  <div>
+    <div class="search-background">
+      <span class="search-group">
+        <span style="width: 160px">璇勫鍦扮偣锛�</span>
+        <el-input v-model="searchForm.judgingLocation" clearable size="small"></el-input>
+        <el-button size="medium" style="margin-left: 10px" @click="resetSearchForm">閲� 缃�</el-button>
+        <el-button size="medium" type="primary" @click="searchList">鏌� 璇�</el-button>
+      </span>
+      <span class="search-group">
+        <el-button size="medium" type="primary" @click="openFormDia('add')">鏂� 澧�</el-button>
+      </span>
+    </div>
+    <div class="table">
+      <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
+        :table-loading="tableLoading" style="padding: 0 10px;margin-bottom: 16px" :page="page" @pagination="pagination">
+      </limsTable>
+    </div>
+    <management-form-d-ia v-if="managementFormDIa" ref="managementFormDIa"
+      @closeImplementDia="closeImplementDia"></management-form-d-ia>
+    <el-dialog :visible.sync="listDialogVisible" title="鏂囦欢鏌ョ湅" top="15vh" width="400px">
+      <div style="max-height:60vh;overflow-y: auto;">
+        <p v-for="(item, index) in fileList" :key="index">
+          <span>{{ item.fileName }}</span>
+          <el-button icon="el-icon-view" size="small" style="margin-left: 20px;" type="text"
+            @click="lookFile(item.url, item.fileName)">棰勮</el-button>
+          <el-button icon="el-icon-bottom" size="small" style="margin-left: 20px;" type="text"
+            @click="handleDown0(item.url, item.fileName)">涓嬭浇</el-button>
+        </p>
+      </div>
+    </el-dialog>
+    <el-dialog :visible.sync="lookDialogVisible" fullscreen title="鏌ョ湅闄勪欢" top="5vh" width="800px">
+      <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/word/' + currentInfo.url"
+        style="height: 90vh;overflow-y: auto;" />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import ManagementFormDIa from './managementFormDIa.vue';
+import filePreview from "@/components/Preview/filePreview.vue";
+import {
+  addReviewProgramFile,
+  selectReviewProgramFile,
+  getPageReviewProgram,
+  deleteReviewProgram,
+  exportReviewProgram,
+} from '@/api/cnas/systemManagement/managementReview.js'
+
+export default {
+  name: 'managementReviewPlan',
+  // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+  components: { ManagementFormDIa, limsTable, filePreview },
+  data() {
+    // 杩欓噷瀛樻斁鏁版嵁
+    return {
+      searchForm: {
+        judgingLocation: '',
+      },
+      listDialogVisible: false,
+      lookDialogVisible: false,
+      fileList: [],
+      currentInfo: {},
+      tableColumn: [
+        {
+          label: '璇勫鏃堕棿',
+          prop: 'reviewTime',
+        },
+        {
+          label: '璇勫鍦扮偣',
+          prop: 'judgingLocation',
+        },
+        {
+          label: '璇勫鐩殑',
+          prop: 'judgingPurpose',
+        },
+        {
+          label: '璇勫鏂瑰紡',
+          prop: 'judgingMethod',
+        },
+        {
+          label: '璇勫鑼冨洿',
+          prop: 'judgingScope',
+        },
+        // {
+        //   dataType: 'tag',
+        //   label: '鎵瑰噯鐘舵��',
+        //   prop: 'approve',
+        //   minWidth: '100',
+        //   formatData: (params) => {
+        //     if (params === 0) {
+        //       return '涓嶉�氳繃';
+        //     } else if (params === 1) {
+        //       return '閫氳繃';
+        //     } else {
+        //       return null;
+        //     }
+        //   },
+        //   formatType: (params) => {
+        //     if (params === 0) {
+        //       return 'danger';
+        //     } else if (params === 1) {
+        //       return 'success';
+        //     } else {
+        //       return null;
+        //     }
+        //   }
+        // },
+        {
+          dataType: 'action',
+          minWidth: '110',
+          label: '鎿嶄綔',
+          operation: [
+            {
+              name: '缂栬緫',
+              type: 'text',
+              clickFun: (row) => {
+                this.openFormDia('edit', row);
+              },
+              disabled: (row) => {
+                return !!row.approve
+              },
+            },
+            {
+              name: '涓婁紶',
+              type: 'upload',
+              multiple: true,
+              limit: 20,
+              accept: '.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png,.pdf',
+              clickFun: async (row, file, fileList) => {
+                const formData = new FormData();
+                formData.append('file', file.raw); // 鏂囦欢瀛楁
+                formData.append('id', row.id); // 鏂囦欢鍚嶅瓧娈�
+                let res = await addReviewProgramFile(formData)
+                if (res.code == 200) {
+                  this.$message({ message: '涓婁紶鎴愬姛', type: 'success' });
+                  // this.searchList()
+                  return
+                } else {
+                  this.$message({ message: '涓婁紶澶辫触', type: 'error' });
+                  return
+                }
+              },
+              disabled: (row) => {
+                return !!row.approve
+              },
+            },
+            {
+              name: '鏌ョ湅闄勪欢',
+              type: 'text',
+              clickFun: (row) => {
+                selectReviewProgramFile({ id: row.id }).then(res => {
+                  this.listDialogVisible = true;
+                  this.fileList = res.data.fileList
+                });
+              },
+            },
+            {
+              name: '鎵瑰噯',
+              type: 'text',
+              clickFun: (row) => {
+                this.openFormDia('ratify', row);
+              },
+              disabled: (row) => {
+                return !!row.approve
+              },
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              color: '#f56c6c',
+              clickFun: (row) => {
+                this.delPlan(row)
+              },
+              disabled: (row) => {
+                if (row.qualityStatus === 1) {
+                  return true
+                } else {
+                  return false
+                }
+              },
+            },
+            {
+              name: '涓嬭浇',
+              type: 'text',
+              clickFun: (row) => {
+                this.handleDown(row)
+              }
+            },
+          ]
+        }
+      ],
+      tableData: [],
+      tableLoading: false,
+      page: {
+        size: 20,
+        current: 1,
+        total: 0,
+      },
+      managementFormDIa: false,
+    };
+  },
+  mounted() {
+    this.searchList()
+  },
+  // 鏂规硶闆嗗悎
+  methods: {
+    // 鏌ヨ鍒楄〃
+    searchList() {
+      this.tableLoading = true
+      getPageReviewProgram({
+        judgingLocation: this.searchForm.judgingLocation,
+        pages: this.page.current,
+        size: this.page.size
+      }).then(res => {
+        this.tableLoading = false
+        if (res.code === 201) return
+        this.tableData = res.data.records
+        this.page.total = res.data.total
+      }).catch(err => {
+        console.log('err---', err);
+        this.tableLoading = false
+      })
+    },
+    // 鏂板锛岀紪杈戯紝鎵瑰噯寮规
+    openFormDia(type, row) {
+      this.managementFormDIa = true
+      this.$nextTick(() => {
+        this.$refs.managementFormDIa.openDia(type, row)
+      })
+    },
+    closeImplementDia() {
+      this.managementFormDIa = false
+      this.searchList()
+    },
+    // 閲嶇疆鏌ヨ鏉′欢
+    resetSearchForm() {
+      this.searchForm.judgingLocation = '';
+      this.searchList()
+    },
+    // 鍒犻櫎
+    delPlan(row) {
+      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        this.tableLoading = true
+        deleteReviewProgram({ id: row.id }).then(res => {
+          this.tableLoading = false
+          if (res.code === 201) return
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.searchList()
+        }).catch(err => {
+          this.tableLoading = false
+          console.log('err---', err);
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
+    // 鍒嗛〉
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
+      this.searchList();
+    },
+    handleDown(row) {
+      exportReviewProgram({ id: row.id }).then(res => {
+        const blob = new Blob([res], { type: 'application/octet-stream' });
+        this.$download.saveAs(blob, '璇勫璁″垝.docx');
+      })
+    },
+    lookFile(url, name) {
+      this.currentInfo.url = url
+      this.currentInfo.name = name
+      this.lookDialogVisible = true
+    },
+    handleDown0(url, name) {
+      if (!url) return this.$message.warning('鏂囦欢鏈笂浼�')
+      let url0 = this.javaApi + '/word/' + url
+      this.$download.saveAs(url0, name);
+    }
+  }
+};
+</script>
+
+<style scoped>
+.search-background {
+  width: 100%;
+  height: 60px;
+  line-height: 60px;
+  display: flex;
+  justify-content: space-between;
+}
+
+.search-group {
+  display: flex;
+  align-items: center;
+  margin: 0 20px;
+}
+</style>

--
Gitblit v1.9.3