From 83be7ca0c138b64b3447cc207b63c7933690f6ec Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期二, 25 二月 2025 09:08:58 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev

---
 src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue |  448 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 307 insertions(+), 141 deletions(-)

diff --git a/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue b/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
index 0bcdb64..23651f0 100644
--- a/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
+++ b/src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
@@ -1,23 +1,21 @@
 <template>
   <!-- 澶栨潵鏂囦欢纭璁板綍 -->
   <div class="ExternalDocumentConfirmationRecords">
-    <el-row class="title">
-      <el-col :span="20" style="padding-left: 20px;text-align: left;">澶栨潵鏂囦欢纭璁板綍</el-col>
-    </el-row>
     <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="handleAdd0" style="margin-left: 20px;"
-            v-if="addPower">鏂板</el-button>
-          <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx' :headers="headers"
-            :on-change="beforeUpload" :on-error="onError" ref='upload' v-if="upPower" :on-success="handleSuccessUp"
-            style="display:inline-block;margin-left: 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"
+          <!-- <ValueTable ref="ValueTable0" :url="$api.manageRecordTotal.pageManageRecordVerify"
             :componentData="componentData0" :key="upIndex0" :delUrl="$api.manageRecordTotal.delManageRecordVerify"
-            :upUrl="$api.manageRecordTotal.doManageRecordVerify" />
+            :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%;">
@@ -25,8 +23,8 @@
           <div class="search_thing">
             <div class="search_label">骞达細</div>
             <div class="search_input">
-              <el-date-picker v-model="componentData.entity.year" type="year" placeholder="閫夋嫨骞�" format="yyyy"
-                value-format="yyyy" size="small" @change="refreshTable()">
+              <el-date-picker v-model="queryParams.year" type="year" placeholder="閫夋嫨骞�" format="yyyy" value-format="yyyy"
+                size="small" @change="refreshTable()">
               </el-date-picker>
             </div>
           </div>
@@ -36,8 +34,10 @@
           </div>
         </div>
         <div class="table">
-          <ValueTable ref="ValueTable" :url="$api.manageRecordTotal.pageManageRecordTotal"
-            :componentData="componentData" :key="upIndex" />
+          <!-- <ValueTable ref="ValueTable" :url="$api.manageRecordTotal.pageManageRecordTotal"
+            :componentData="componentData" :key="upIndex" /> -->
+          <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+            :height="'calc(100vh - 280px)'" @pagination="pagination"></lims-table>
         </div>
       </el-tab-pane>
     </el-tabs>
@@ -51,17 +51,65 @@
         <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 ValueTable from '@/components/Table/value-table.vue'
-import { getToken } from "@/utils/auth";
+import {
+  addManageRecordVerify,
+  pageManageRecordVerify,
+  submitManageRecordTotal,
+  ratifyManageRecordTotal,
+  delManageRecordVerify,
+  pageManageRecordTotal,
+  doManageRecordVerify
+} from '@/api/cnas/systemManagement/documentRecords.js'
 export default {
   components: {
     ValueTable,
     filePreview,
+    limsTable,
   },
   data() {
     return {
@@ -70,112 +118,139 @@
       lookDialogVisible: false,
       noCheckLoading: false,
       checkLoading: false,
-      componentData: {
-        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: ''
-      },
-      // 鏍峰搧鍒楄〃
-      componentData0: {
-        entity: {
-          manageRecordTotalId: null,
-          orderBy: {
-            field: 'id',
-            order: 'desc'
-          }
-        },
-        isIndex: true,
-        showSelect: false,
-        select: false,
-        do: [{
-          id: 'update',
-          font: '淇敼',
-          type: 'text',
-          method: 'doDiy'
-        }, {
-          id: 'delete',
-          font: '鍒犻櫎',
-          type: 'text',
-          method: 'doDiy'
-        }],
-        tagField: {},
-        selectField: {},
-        requiredAdd: ['documentName', 'documentCode'],
-        requiredUp: ['documentName', 'documentCode'],
-        datePicker: ['effectiveDate', 'cancelDate'],
-        needSort: [],
-        inputType: ''
-      },
-      upIndex0: 100,
-      entityCopy: {},
-      upIndex: 0,
       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: {
-    headers() {
-      return {
-        'Authorization': "Bearer " + getToken()
-      }
-    },
     action() {
-      return this.javaApi + this.$api.manageRecordTotal.exportManageRecordVerify
+      return this.javaApi + '/manageRecordVerify/exportManageRecordVerify'
     }
   },
   mounted() {
-    this.entityCopy = this.HaveJson(this.componentData.entity);
-    this.getPower()
+    // this.entityCopy = this.HaveJson(this.componentData.entity);
+    this.getList()
+    this.getList0()
   },
   methods: {
     getPower() {
@@ -217,11 +292,65 @@
       this.addPower = add
       this.upPower = up
     },
-    handleAdd0() {
-      this.$refs.ValueTable0.openAddDia(this.$api.manageRecordTotal.addManageRecordVerify);
+    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.refreshTable()()
+      this.page.current = 1;
+      this.getList();
     },
     beforeUpload(file) {
       if (file.size > 1024 * 1024 * 10) {
@@ -241,15 +370,10 @@
       this.upLoading = false;
       if (response.code == 200) {
         this.$message.success('涓婁紶鎴愬姛');
-        this.$refs['ValueTable0'].selectList()
+        this.getList0();
       } else {
         this.$message.error('涓婁紶澶辫触');
       }
-    },
-    refresh() {
-      this.componentData.entity = this.HaveJson(this.entityCopy)
-      this.upIndex++
-      this.refreshTable()
     },
     submitCheck(type) { },
     // 鏌ョ湅
@@ -260,19 +384,12 @@
     // 鍏敤鏂规硶
     commonFun(row, callbanck) {
       this.currentInfo = row
-      this.componentData0.entity.manageRecordTotalId = row.id
-      this.$axios.post(this.$api.manageRecordTotal.pageManageRecordVerify, {
-        entity: this.componentData0.entity,
-        page: {
-          current: -1,
-          size: -1
-        }
-      }, {
-        headers: {
-          'Content-Type': 'application/json'
-        }, noQs: true
+      pageManageRecordVerify({
+        current: -1,
+        size: -1,
+        manageRecordTotalId: row.id
       }).then(res => {
-        this.currentInfo.arr = res.data.body.records
+        this.currentInfo.arr = res.data.records
         this.lookDialogVisible = true
         if (callbanck) {
           callbanck()
@@ -280,11 +397,8 @@
       }).catch(err => { });
     },
     handleDown0(row) {
-      let url = this.javaApi + 'word/' + row.url
-      const link = document.createElement('a');
-      link.href = url;
-      link.download = row.month + ' 澶栨潵鏂囦欢纭璁板綍';
-      link.click();
+      let url = this.javaApi + '/word/' + row.url
+      this.$download.saveAs(url, '澶栨潵鏂囦欢纭璁板綍')
     },
     // 鎻愪氦
     handleSubmit(row) {
@@ -293,7 +407,7 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.post(this.$api.manageRecordTotal.submitManageRecordTotal, {
+        submitManageRecordTotal({
           id: row.id
         }).then(res => {
           this.$message({
@@ -316,7 +430,7 @@
       } else {
         this.noCheckLoading = true
       }
-      this.$axios.post(this.$api.manageRecordTotal.ratifyManageRecordTotal, {
+      ratifyManageRecordTotal({
         id: this.currentInfo.id,
         ratifyState: state
       }).then(res => {
@@ -330,6 +444,59 @@
         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;
+        }
+      });
     },
   }
 }
@@ -356,7 +523,7 @@
 }
 
 .search_label {
-  width: 110px;
+  width: 30px;
   font-size: 14px;
   text-align: right;
 }
@@ -367,9 +534,8 @@
 
 .table {
   background-color: #fff;
-  width: calc(100% - 40px);
-  height: calc(100% - 60px - 140px);
-  padding: 20px;
+  height: 100%;
+  margin-top: 10px;
 }
 
 >>>.el-tabs__content {

--
Gitblit v1.9.3