From fe53187de649ff276bae8ecf160dc89c4b60e35b Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 04 三月 2025 13:54:59 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before-ruoyi

---
 src/views/CNAS/systemManagement/documentRecords/regularReviewsRecord.vue |  743 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 743 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/systemManagement/documentRecords/regularReviewsRecord.vue b/src/views/CNAS/systemManagement/documentRecords/regularReviewsRecord.vue
new file mode 100644
index 0000000..53f1e11
--- /dev/null
+++ b/src/views/CNAS/systemManagement/documentRecords/regularReviewsRecord.vue
@@ -0,0 +1,743 @@
+<template>
+  <!-- 鏂囦欢瀹氭湡瀹℃煡璁板綍 -->
+  <div class="PeriodicDocumentReviewRecords">
+    <el-tabs type="border-card" v-model="activeName" style="height: 100%;">
+      <el-tab-pane label="濉啓" name="濉啓" style="height: 100%;">
+        <div class="search">
+          <div class="search_thing">
+            <div class="search_label">鏂囦欢鍚嶇О锛�</div>
+            <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+                v-model="queryParams.documentName" @keyup.enter.native="refreshTable()"></el-input></div>
+          </div>
+          <div class="search_thing">
+            <div class="search_label">鏂囦欢缂栧彿锛�</div>
+            <div class="search_input">
+              <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.documentCode"
+                @keyup.enter.native="refreshTable()"></el-input>
+            </div>
+          </div>
+          <div class="search_thing" style="padding-left: 30px;">
+            <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+            <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+          </div>
+          <div class="btns">
+            <el-button size="small" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button>
+            <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx'
+              :headers="uploadHeader" :on-change="beforeUpload" :on-error="onError" ref='upload' v-if="upPower"
+              :on-success="handleSuccessUp" style="display:inline-block;margin-left: 20px;">
+              <el-button type="primary" size="small">瀵煎叆</el-button></el-upload>
+          </div>
+        </div>
+        <div class="table">
+          <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+            :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table>
+        </div>
+      </el-tab-pane>
+      <el-tab-pane label="鍘嗗彶璁板綍" name="鍘嗗彶璁板綍" style="height: 100%;">
+        <div class="search">
+          <div class="search_thing">
+            <div class="search_label">骞达細</div>
+            <div class="search_input">
+              <el-date-picker v-model="queryParams0.year" type="year" placeholder="閫夋嫨骞�" format="yyyy"
+                value-format="yyyy" size="small" @change="refreshTable(1)">
+              </el-date-picker>
+            </div>
+          </div>
+          <div class="search_thing" style="padding-left: 30px;">
+            <el-button size="small" @click="refresh(1)">閲� 缃�</el-button>
+            <el-button size="small" type="primary" @click="refreshTable(1)">鏌� 璇�</el-button>
+          </div>
+        </div>
+        <div class="table">
+          <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading"
+            :height="'calc(100vh - 290px)'" @pagination="pagination0"></lims-table>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+    <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px" top="6vh">
+      <el-row>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label"><span style="color: red;margin-left: 4px;">* </span>鏂囦欢缂栧彿锛�</div>
+            <div class="search_input">
+              <el-select v-model="addInfo.documentCode" size="small" style="width: 100%;" @change="getCurrentFile"
+                allow-create clearable filterable>
+                <el-option v-for="item in fileList" :key="item.documentCode" :label="item.title"
+                  :value="item.documentCode">
+                </el-option>
+              </el-select>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">鏂囦欢鍚嶇О锛�</div>
+            <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+                v-model="addInfo.documentName"></el-input></div>
+          </div>
+        </el-col>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">鐗堟湰鍙凤細</div>
+            <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+                v-model="addInfo.documentVersion"></el-input></div>
+          </div>
+        </el-col>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">淇鍙凤細</div>
+            <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
+                v-model="addInfo.revision"></el-input></div>
+          </div>
+        </el-col>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">閫傚疁鎬э細</div>
+            <div class="search_input">
+              <el-select v-model="addInfo.suitability" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+                <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value">
+                </el-option>
+              </el-select>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="24" style="margin-bottom: 16px;">
+          <div class="search_thing">
+            <div class="search_label">澶囨敞锛�</div>
+            <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.remark"
+                type="textarea" :rows="2"></el-input></div>
+          </div>
+        </el-col>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addDialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="handleAdd" :loading="addLoading">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
+    <!-- 璇︽儏/瀹℃牳 -->
+    <el-dialog :title="title0" :visible.sync="lookDialogVisible" width="800px" top="5vh">
+      <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.url" :currentFile="{}"
+        style="max-height: 70vh;overflow-y: auto;" />
+      <span slot="footer" class="dialog-footer" v-if="title0 == '瀹℃牳' || title0 == '鎵瑰噯'">
+        <el-button @click="submitCheck('涓嶉�氳繃')" :loading="noCheckLoading">涓嶉�氳繃</el-button>
+        <el-button type="primary" @click="submitCheck('閫氳繃')" :loading="checkLoading">閫� 杩�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from '@/components/Preview/filePreview.vue'
+import {
+  exportOutManageRecordIntervals,
+  addManageRecordIntervals,
+  doManageRecordIntervals,
+  ratifyManageRecordIntervalsTotal,
+  submitManageRecordIntervalsTotal,
+  pageManageRecordIntervals,
+  pageManageRecordIntervalsTotal,
+  delManageRecordIntervals,
+} from '@/api/cnas/systemManagement/documentRecords.js'
+import {
+  pageManageDocumentList,
+} from '@/api/cnas/systemManagement/documentControl.js'
+export default {
+  components: {
+    limsTable,
+    filePreview
+  },
+  data() {
+    return {
+      activeName: '濉啓',
+      title0: '鏂板',
+      addPower: true,
+      outPower: true,
+      upPower: true,
+      outLoading: false,
+      addLoading: false,
+      lookDialogVisible: false,
+      noCheckLoading: false,
+      checkLoading: false,
+      componentData: {
+        entity: {
+          documentName: null,
+          documentCode: null,
+          orderBy: {
+            field: 'id',
+            order: 'desc'
+          }
+        },
+        isIndex: true,
+        showSelect: false,
+        select: false,
+        // selectMethod: 'handleChangeTask',
+        do: [{
+          id: 'handleEdit',
+          font: '淇敼',
+          type: 'text',
+          method: 'handleEdit',
+          field: [],
+        }, {
+          id: 'delete',
+          font: '鍒犻櫎',
+          type: 'text',
+          method: 'doDiy',
+        }],
+        tagField: {
+          // documentType:{
+          //   select: []
+          // },
+          // receiveUserName:{
+          //   select: []
+          // },
+        },
+        selectField: {
+          // documentType:{
+          //   select: []
+          // },
+          // receiveUserName:{
+          //   select: []
+          // },
+        },
+        addUpload: ['signatoryUrl'],
+        requiredAdd: [],
+        requiredUp: [],
+        datePicker: ['receiveDate'],
+        noHead: ['signedUserName', 'signedDate', 'departLims'],//涓嶅弬涓庢柊澧炵紪杈戠殑瀛楁
+        needSort: [],
+        inputType: ''
+      },
+      componentData0: {
+        entity: {
+          year: null,
+          orderBy: {
+            field: 'id',
+            order: 'desc'
+          }
+        },
+        isIndex: true,
+        showSelect: false,
+        select: false,
+        do: [{
+          id: 'handleLook',
+          font: '鏌ョ湅',
+          type: 'text',
+          method: 'handleLook',
+          disabFun: (row, index) => {
+            return !row.url
+          }
+        }, {
+          id: 'handleDown0',
+          font: '涓嬭浇',
+          type: 'text',
+          method: 'handleDown0',
+          disabFun: (row, index) => {
+            return !row.url
+          }
+        },
+        {
+          id: 'handleSubmit',
+          font: '鎻愪氦',
+          type: 'text',
+          method: 'handleSubmit',
+          disabFun: (row, index) => {
+            return !!row.submitUserName
+          }
+        }, {
+          id: 'handleApproval',
+          font: '鎵瑰噯',
+          type: 'text',
+          method: 'handleApproval',
+          disabFun: (row, index) => {
+            return !row.submitUserName || !!row.ratifyUserName
+          }
+        }],
+        tagField: {},
+        selectField: {},
+        requiredAdd: [],
+        requiredUp: [],
+        needSort: [],
+        inputType: ''
+      },
+      entityCopy: {},
+      entityCopy0: {},
+      upIndex: 0,
+      addInfo: {},
+      title: '鏂板',
+      addInfo: {},
+      addDialogVisible: false,
+      fileList: [],
+      typeList: [],
+      currentInfo: {},
+      queryParams: {},
+      tableData: [],
+      column: [
+        { label: "鏂囦欢鍚嶇О", prop: "documentName" },
+        { label: "鏂囦欢缂栧彿", prop: "documentCode", width: "120px" },
+        {
+          label: "鐗堟湰鍙�",
+          prop: "documentVersion",
+        },
+        { label: "淇鍙�", prop: "revision" },
+        { label: "閫傚疁鎬�", prop: "suitability" },
+        { label: "澶囨敞", prop: "remark" },
+        {
+          dataType: "action",
+          fixed: "right",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "缂栬緫",
+              type: "text",
+              clickFun: (row) => {
+                this.handleEdit(row);
+              },
+            },
+            {
+              name: "鍒犻櫎",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDelete(row);
+              },
+            },
+          ],
+        },
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading: false,
+      queryParams0: {},
+      tableData0: [],
+      column0: [
+        { label: "骞翠唤", prop: "year" },
+        { label: "鎬绘暟閲�", prop: "totalNum", width: "120px" },
+        {
+          label: "鎷熷埗浜�",
+          prop: "submitUserName",
+        },
+        { label: "鎷熷埗鏃ユ湡", prop: "submitDate" },
+        { label: "鎵瑰噯浜�", prop: "ratifyUserName" },
+        { label: "鎵瑰噯鏃ユ湡", prop: "ratifyDate" },
+        { label: "鎵瑰噯缁撴灉", prop: "ratifyState" },
+        {
+          dataType: "action",
+          fixed: "right",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "鏌ョ湅",
+              type: "text",
+              clickFun: (row) => {
+                this.handleLook(row);
+              },
+              disabled: (row) => {
+                return !row.url
+              },
+            },
+            {
+              name: "涓嬭浇",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDown0(row);
+              },
+              disabled: (row) => {
+                return !row.url
+              },
+            },
+            {
+              name: "鎻愪氦",
+              type: "text",
+              clickFun: (row) => {
+                this.handleSubmit(row);
+              },
+              disabled: (row) => {
+                return !!row.submitUserName && row.ratifyState != '涓嶉�氳繃'
+              },
+            },
+            {
+              name: "鎵瑰噯",
+              type: "text",
+              clickFun: (row) => {
+                this.handleApproval(row);
+              },
+              disabled: (row) => {
+                return (!row.submitUserName || !!row.ratifyUserName) && row.ratifyState != '涓嶉�氳繃'
+              },
+            },
+          ],
+        },
+      ],
+      page0: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+    }
+  },
+  // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+  computed: {
+    action() {
+      return this.javaApi + '/manageRecordIntervals/exportInManageRecordIntervals'
+    }
+  },
+  mounted() {
+    // this.entityCopy = this.HaveJson(this.componentData.entity);
+    // this.entityCopy0 = this.HaveJson(this.componentData0.entity);
+    this.getList()
+    this.getList0()
+    this.getFileList()
+    this.selectEnumByCategory()
+  },
+  methods: {
+    getPower() {
+      let power = JSON.parse(sessionStorage.getItem('power'))
+      let add = false
+      let del = false
+      let up = false;
+      let out = false;
+      let submit = false
+      let ratify = false
+      for (var i = 0; i < power.length; i++) {
+        if (power[i].menuMethod == 'addManageRecordIntervals') {
+          add = true
+        }
+        if (power[i].menuMethod == 'delManageRecordIntervals') {
+          del = true
+        }
+        if (power[i].menuMethod == 'exportInManageRecordIntervals') {
+          up = true
+        }
+        if (power[i].menuMethod == 'exportOutManageRecordIntervals') {
+          out = true
+        }
+        if (power[i].menuMethod == 'submitManageRecordIntervalsTotal') {
+          submit = true
+        }
+        if (power[i].menuMethod == 'ratifyManageRecordIntervalsTotal') {
+          ratify = true
+        }
+      }
+      if (!ratify) {
+        this.componentData0.do.splice(3, 1)
+      }
+      if (!submit) {
+        this.componentData0.do.splice(2, 1)
+      }
+      if (!add) {
+        this.componentData.do.splice(1, 1)
+      }
+      if (!del) {
+        this.componentData.do.splice(0, 1)
+      }
+      this.addPower = add
+      this.outPower = out
+      this.upPower = up
+    },
+    // 鏂板
+    openAdd() {
+      // this.$refs.ValueTable.openAddDia(this.$api.manageRecordIssueRecycle.addManageRecordIssueRecycle);
+      this.addInfo = {}
+      this.title = '鏂板'
+      this.addDialogVisible = true;
+    },
+    // 瀵煎嚭
+    handleDown() {
+      this.outLoading = true
+      exportOutManageRecordIntervals(this.queryParams).then(res => {
+        this.outLoading = false
+        if (res.code == 201) return this.$message.error('瀵煎嚭澶辫触')
+        let url = this.javaApi + 'word/' + res.message
+        this.$download.saveAs(url, "鏂囦欢瀹氭湡瀹℃煡璁板綍");
+      })
+    },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.page };
+      delete param.total;
+      pageManageRecordIntervals({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData = res.data.records;
+            this.page.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
+      this.getList();
+    },
+    getList0() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams0, ...this.page0 };
+      delete param.total;
+      pageManageRecordIntervalsTotal({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData0 = res.data.records;
+            this.page0.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination0({ page, limit }) {
+      this.page0.current = page;
+      this.page0.size = limit;
+      this.getList0();
+    },
+    refreshTable(num) {
+      if (num) {
+        this.page0.current = 1;
+        this.getList0();
+      } else {
+        this.page.current = 1;
+        this.getList();
+      }
+    },
+    refresh(num) {
+      if (num) {
+        this.queryParams0 = {};
+        this.page0.current = 1;
+        this.getList0();
+      } else {
+        this.queryParams = {};
+        this.page.current = 1;
+        this.getList();
+      }
+    },
+    beforeUpload(file) {
+      if (file.size > 1024 * 1024 * 10) {
+        this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+        this.$refs.upload.clearFiles()
+        return false;
+      } else {
+        // this.upLoading = true;
+        return true;
+      }
+    },
+    onError(err, file, fileList) {
+      this.$message.error('涓婁紶澶辫触')
+      this.$refs.upload.clearFiles()
+    },
+    handleSuccessUp(response) {
+      this.upLoading = false;
+      if (response.code == 200) {
+        this.$message.success('涓婁紶鎴愬姛');
+        this.refreshTable()()
+      } else {
+        this.$message.error('涓婁紶澶辫触');
+      }
+    },
+    getCurrentFile(e) {
+      let obj = this.fileList.find(m => m.documentCode == e)
+      if (obj) {
+        this.$set(this.addInfo, 'documentName', obj.name)
+        this.$set(this.addInfo, 'documentVersion', obj.version)
+        // this.addInfo.documentName = obj.name
+        // this.addInfo.documentVersion = obj.version
+      }
+    },
+    // 鑾峰彇鏂囦欢鍒楄〃--鏂囦欢娓呭崟
+    getFileList() {
+      pageManageDocumentList({
+        current: -1,
+        size: -1
+      }).then(res => {
+        this.fileList = res.data.records.map(m => {
+          m.title = m.documentCode
+          return m
+        })
+      }).catch(err => { })
+    },
+    selectEnumByCategory() {
+      // 鏂囦欢绫诲埆
+      this.getDicts("suitability").then((response) => {
+        this.typeList = this.dictToValue(response.data);
+      });
+    },
+    // 鎻愪氦
+    handleAdd() {
+      if (!this.addInfo.documentCode) return this.$message.error('璇疯緭鍏ユ枃浠剁紪鍙�')
+      this.addLoading = true
+      let obj = {}
+      if (this.title == '鏂板') {
+        obj = this.HaveJson(this.addInfo)
+      } else {
+        let { id, documentCode, documentName, documentVersion, revision, suitability, remark } = this.addInfo
+        obj = { id, documentCode, documentName, documentVersion, revision, suitability, remark }
+      }
+      if (this.title == '鏂板') {
+        addManageRecordIntervals(obj).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { })
+      } else {
+        doManageRecordIntervals(obj).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { })
+      }
+    },
+    // 淇敼
+    handleEdit(row) {
+      this.addInfo = row
+      this.title = '缂栬緫'
+      this.addDialogVisible = true;
+    },
+    submitCheck(state) {
+      if (state == '閫氳繃') {
+        this.checkLoading = true
+      } else {
+        this.noCheckLoading = true
+      }
+      ratifyManageRecordIntervalsTotal({
+        id: this.currentInfo.id,
+        ratifyState: state
+      }).then(res => {
+        this.checkLoading = false
+        if (res.code == 201) {
+          return
+        }
+        this.noCheckLoading = false
+        this.$message({
+          type: 'success',
+          message: '鎿嶄綔鎴愬姛!'
+        });
+        this.refreshTable(1);
+        this.lookDialogVisible = false
+      }).catch(err => { });
+    },
+    // 鏌ョ湅
+    handleLook(row) {
+      this.title0 = '鏌ョ湅'
+      this.commonFun(row)
+    },
+    commonFun(row, callbanck) {
+      this.currentInfo = row
+      this.lookDialogVisible = true
+      if (callbanck) {
+        callbanck()
+      }
+    },
+    handleDown0(row) {
+      let url = this.javaApi + '/word/' + row.url
+      this.$download.saveAs(url, "鎵�鏈夋枃浠跺畾鏈熸鏌ヨ褰�");
+    },
+    // 鎻愪氦
+    handleSubmit(row) {
+      this.$confirm('鏄惁鎻愪氦 ' + row.year + ' 骞寸殑鏁版嵁', '鎻愪氦', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        submitManageRecordIntervalsTotal({
+          id: row.id
+        }).then(res => {
+          if (res.code === 201) return
+          this.$message({
+            type: 'success',
+            message: '鎻愪氦鎴愬姛!'
+          });
+          this.refreshTable(1);
+        }).catch(err => { });
+      })
+    },
+    // 鎵瑰噯
+    handleApproval(row) {
+      this.title0 = '鎵瑰噯'
+      this.commonFun(row)
+    },
+    handleDelete(row) {
+      this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          delManageRecordIntervals({ id: row.id }).then((res) => {
+            if (res.code == 201) return;
+            this.$message.success("鍒犻櫎鎴愬姛");
+            this.refreshTable();
+          });
+        })
+        .catch(() => { });
+    },
+  }
+}
+</script>
+
+<style scoped>
+.title {
+  height: 60px;
+  line-height: 60px;
+}
+
+.search {
+  background-color: #fff;
+  height: 40px;
+  display: flex;
+  align-items: center;
+  position: relative;
+}
+
+.search_thing {
+  width: 350px;
+  display: flex;
+  align-items: center;
+}
+
+.search_label {
+  width: 110px;
+  font-size: 14px;
+  text-align: right;
+}
+
+.search_input {
+  width: calc(100% - 110px);
+}
+
+.table {
+  margin-top: 10px;
+  background-color: #fff;
+  height: calc(100% - 60px - 140px);
+  padding: 20px;
+  padding-top: 0;
+}
+
+>>>.el-tabs__content {
+  height: 100%;
+}
+
+.btns {
+  position: absolute;
+  right: 20px;
+  top: 5px;
+}
+</style>

--
Gitblit v1.9.3