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/documentRecords/outDocumenRecordt.vue |  540 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 540 insertions(+), 0 deletions(-)

diff --git a/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue b/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
new file mode 100644
index 0000000..f323f0d
--- /dev/null
+++ b/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
@@ -0,0 +1,540 @@
+<template>
+  <!-- 澶栨潵鏂囦欢纭璁板綍 -->
+  <div class="ExternalDocumentConfirmationRecords">
+    <el-tabs type="border-card" v-model="activeName" style="height: 100%;">
+      <el-tab-pane label="濉啓" name="濉啓" style="height: 100%;">
+        <div style="display: flex;align-items: center;justify-content: flex-end;margin-right: 20px;">
+          <el-button size="small" type="primary" @click="openAdd('鏂板')" style="margin-left: 20px;">鏂板</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'
+            :on-success="handleSuccessUp" style="display:inline-block;margin-left: 20px;">
+            <el-button size="small" type="primary" :loading="upLoading">瀵煎叆</el-button></el-upload>
+        </div>
+        <div class="table" style="height: calc(100% - 200px)">
+          <!-- <ValueTable ref="ValueTable0" :url="$api.manageRecordTotal.pageManageRecordVerify"
+            :componentData="componentData0" :key="upIndex0" :delUrl="$api.manageRecordTotal.delManageRecordVerify"
+            :upUrl="$api.manageRecordTotal.doManageRecordVerify" /> -->
+          <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0"
+            :height="'calc(100vh - 270px)'" @pagination="pagination0"></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="queryParams.year" type="year" placeholder="閫夋嫨骞�" format="yyyy" value-format="yyyy"
+                size="small" @change="refreshTable()">
+              </el-date-picker>
+            </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>
+        <div class="table">
+          <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+            :height="'calc(100vh - 280px)'" @pagination="pagination"></lims-table>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+    <!-- 璇︽儏/涓嬭浇/瀹℃牳 -->
+    <el-dialog :title="title0" :visible.sync="lookDialogVisible" width="800px" :class="{ downPdf: title0 == '涓嬭浇' }"
+      :modal="title0 != '涓嬭浇'" 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>
+    <!-- 鏂板/缂栬緫 -->
+    <el-dialog :title="title" :visible.sync="addDia" width="500px">
+      <el-form :model="addForm" ref="addForm" :rules="addRules" label-position="right" label-width="120px">
+        <el-form-item label="澶栨潵鏂囦欢鍚嶇О" prop="documentName">
+          <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentName"></el-input>
+        </el-form-item>
+        <el-form-item label="鏂囦欢缂栧彿" prop="documentCode">
+          <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.documentCode">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="鏍囧噯瑙勮寖鍚嶇О" prop="standardName">
+          <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.standardName">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="鏍囧噯鍙�" prop="standardCode">
+          <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addForm.standardCode">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="鐢熸晥鏃ユ湡" prop="effectiveDate">
+          <el-date-picker v-model="addForm.effectiveDate" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+            style="width: 100%" type="date" value-format="yyyy-MM-dd">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="浣滃簾鏃ユ湡" prop="cancelDate">
+          <el-date-picker v-model="addForm.cancelDate" format="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" size="small"
+            style="width: 100%" type="date" value-format="yyyy-MM-dd">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="澶囨敞" prop="note">
+          <el-input size="small" placeholder="璇疯緭鍏�" type="textarea" :rows="2" clearable v-model="addForm.note">
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addDia = false">鍙� 娑�</el-button>
+        <el-button :loading="uploading" type="primary" @click="submitProduct('addForm')">纭� 璁�</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import filePreview from '@/components/Preview/filePreview.vue'
+import {
+  addManageRecordVerify,
+  pageManageRecordVerify,
+  submitManageRecordTotal,
+  ratifyManageRecordTotal,
+  delManageRecordVerify,
+  pageManageRecordTotal,
+  doManageRecordVerify
+} from '@/api/cnas/systemManagement/documentRecords.js'
+export default {
+  components: {
+    filePreview,
+    limsTable,
+  },
+  data() {
+    return {
+      title0: '鏌ョ湅',
+      activeName: '濉啓',
+      lookDialogVisible: false,
+      noCheckLoading: false,
+      checkLoading: false,
+      addPower: true,
+      upPower: true,
+      currentInfo: {},
+      upLoading: false,
+      queryParams: {},
+      tableData: [],
+      column: [
+        { 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
+              },
+            },
+            {
+              name: "鎵瑰噯",
+              type: "text",
+              clickFun: (handleApproval) => {
+                this.handleSubmit(row);
+              },
+              disabled: (row) => {
+                return !row.submitUserName || !!row.ratifyUserName
+              },
+            },
+          ],
+        },
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading: false,
+      tableData0: [],
+      column0: [
+        { label: "澶栨潵鏂囦欢鍚嶇О", prop: "documentName" },
+        { label: "鏂囦欢缂栧彿", prop: "documentCode", width: "120px" },
+        {
+          label: "鏍囧噯瑙勮寖鍚嶇О",
+          prop: "standardName",
+        },
+        { label: "鏍囧噯鍙�", prop: "standardCode" },
+        { label: "鐢熸晥鏃ユ湡", prop: "effectiveDate" },
+        { label: "浣滃簾鏃ユ湡", prop: "cancelDate" },
+        { label: "澶囨敞", prop: "note" },
+        {
+          dataType: "action",
+          fixed: "right",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "缂栬緫",
+              type: "text",
+              clickFun: (row) => {
+                this.openAdd("缂栬緫", row);
+              },
+            },
+            {
+              name: "鍒犻櫎",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDelete(row);
+              },
+            },
+          ],
+        },
+      ],
+      page0: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading0: false,
+      title: '鏂板',
+      addForm: {},
+      addDia: false,
+      addRules: {
+        documentName: [{ required: true, message: "璇疯緭鍏ュ鏉ユ枃浠跺悕绉�", trigger: "blur" }],
+        documentCode: [
+          { required: true, message: "璇疯緭鍏ユ枃浠剁紪鍙�", trigger: "blur" },
+        ],
+      },
+      uploading: false,
+    }
+  },
+  // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+  computed: {
+    action() {
+      return this.javaApi + '/manageRecordVerify/exportManageRecordVerify'
+    }
+  },
+  mounted() {
+    // this.entityCopy = this.HaveJson(this.componentData.entity);
+    this.getList()
+    this.getList0()
+  },
+  methods: {
+    getPower() {
+      let power = JSON.parse(sessionStorage.getItem('power'))
+      let add = false
+      let del = false
+      let up = false;
+      let sub = false
+      let ratify = false
+      for (var i = 0; i < power.length; i++) {
+        if (power[i].menuMethod == 'addManageRecordVerify') {
+          add = true
+        }
+        if (power[i].menuMethod == 'delManageRecordVerify') {
+          del = true
+        }
+        if (power[i].menuMethod == 'exportManageRecordVerify') {
+          up = true
+        }
+        if (power[i].menuMethod == 'submitManageRecordTotal') {
+          sub = true
+        }
+        if (power[i].menuMethod == 'ratifyManageRecordTotal') {
+          ratify = true
+        }
+      }
+      if (!ratify) {
+        this.componentData.do.splice(3, 1)
+      }
+      if (!sub) {
+        this.componentData.do.splice(2, 1)
+      }
+      if (!del) {
+        this.componentData0.do.splice(1, 1)
+      }
+      if (!add) {
+        this.componentData0.do.splice(0, 1)
+      }
+      this.addPower = add
+      this.upPower = up
+    },
+    openAdd(title, row) {
+      this.title = title;
+      if (row) {
+        this.addForm = row;
+      } else {
+        this.addForm = {};
+      }
+      this.addDia = true;
+    },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.page };
+      delete param.total;
+      pageManageRecordTotal({ ...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.tableLoading0 = true;
+      let param = { ...this.page0 };
+      delete param.total;
+      pageManageRecordVerify({ ...param })
+        .then((res) => {
+          this.tableLoading0 = false;
+          if (res.code === 200) {
+            this.tableData0 = res.data.records;
+            this.page0.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading0 = false;
+        });
+    },
+    pagination0({ page, limit }) {
+      this.pag0.current = page;
+      this.page0.size = limit;
+      this.getList0();
+    },
+    refresh() {
+      this.queryParams = {};
+      this.page.current = 1;
+      this.getList();
+    },
+    refreshTable() {
+      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.getList0();
+      } else {
+        this.$message.error('涓婁紶澶辫触');
+      }
+    },
+    submitCheck(type) { },
+    // 鏌ョ湅
+    handleLook(row) {
+      this.title0 = '鏌ョ湅'
+      this.commonFun(row)
+    },
+    // 鍏敤鏂规硶
+    commonFun(row, callbanck) {
+      this.currentInfo = row
+      pageManageRecordVerify({
+        current: -1,
+        size: -1,
+        manageRecordTotalId: row.id
+      }).then(res => {
+        this.currentInfo.arr = res.data.records
+        this.lookDialogVisible = true
+        if (callbanck) {
+          callbanck()
+        }
+      }).catch(err => { });
+    },
+    handleDown0(row) {
+      let url = this.javaApi + '/word/' + row.url
+      this.$download.saveAs(url, '澶栨潵鏂囦欢纭璁板綍')
+    },
+    // 鎻愪氦
+    handleSubmit(row) {
+      this.$confirm('鏄惁鎻愪氦 ' + row.year + ' 骞寸殑鏁版嵁', '鎻愪氦', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        submitManageRecordTotal({
+          id: row.id
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '鎻愪氦鎴愬姛!'
+          });
+          this.refreshTable()()
+        }).catch(err => { });
+      })
+    },
+    // 鎵瑰噯
+    handleApproval(row) {
+      this.title0 = '鎵瑰噯'
+      this.commonFun(row)
+    },
+    // 鎻愪氦瀹℃牳/鎵瑰噯
+    submitCheck(state) {
+      if (state == '閫氳繃') {
+        this.checkLoading = true
+      } else {
+        this.noCheckLoading = true
+      }
+      ratifyManageRecordTotal({
+        id: this.currentInfo.id,
+        ratifyState: state
+      }).then(res => {
+        this.checkLoading = false
+        this.noCheckLoading = false
+        if (res.code === 201) return
+        this.$message({
+          type: 'success',
+          message: '鎿嶄綔鎴愬姛!'
+        });
+        this.refreshTable()()
+        this.lookDialogVisible = false
+      }).catch(err => { });
+    },
+    handleDelete(row) {
+      this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          delManageRecordVerify({ id: row.id }).then((res) => {
+            if (res.code == 201) return;
+            this.$message.success("鍒犻櫎鎴愬姛");
+            this.getList0()
+          });
+        })
+        .catch(() => { });
+    },
+    submitProduct(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.uploading = true;
+          if (this.title == "鏂板") {
+            addManageRecordVerify(this.addForm)
+              .then((res) => {
+                this.uploading = false;
+                if (res.code != 200) {
+                  return;
+                }
+                this.$message.success("鎻愪氦鎴愬姛");
+                this.getList0()
+                this.addDia = false;
+              })
+              .catch((err) => {
+                this.uploading = false;
+              });
+          } else {
+            doManageRecordVerify(this.addForm)
+              .then((res) => {
+                this.uploading = false;
+                if (res.code != 200) {
+                  return;
+                }
+                this.$message.success("鎻愪氦鎴愬姛");
+                this.getList0()
+                this.addDia = false;
+              })
+              .catch((err) => {
+                this.uploading = false;
+              });
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+  }
+}
+</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: 30px;
+  font-size: 14px;
+  text-align: right;
+}
+
+.search_input {
+  width: calc(100% - 110px);
+}
+
+.table {
+  background-color: #fff;
+  height: 100%;
+  margin-top: 10px;
+}
+
+>>>.el-tabs__content {
+  height: 100%;
+}
+</style>

--
Gitblit v1.9.3