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

diff --git a/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue b/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
new file mode 100644
index 0000000..943f143
--- /dev/null
+++ b/src/views/CNAS/systemManagement/documentRecords/distributionCollectionRecord.vue
@@ -0,0 +1,522 @@
+<template>
+  <!-- 鎵�鏈夋枃浠讹紙鍐呫�佸閮ㄦ枃浠讹級鐨勫彂鏀句笌鍥炴敹璁板綍 -->
+  <div class="DistributionRetrievalRecordsAllDocuments">
+    <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="btn">
+        <el-button size="small" type="primary" @click="openAdd">鏂板</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 type="primary" size="small">瀵煎叆</el-button></el-upload>
+        <el-button size="small" type="primary" @click="handleDown" :loading="outLoading"
+          style="display:inline-block;margin-left: 20px;">瀵煎嚭</el-button>
+      </div>
+    </div>
+    <div class="table">
+      <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+        :height="'calc(100vh - 260px)'" @pagination="pagination"></lims-table>
+    </div>
+    <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.pages"></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.documentType" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+                <el-option v-for="item in fileType" :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.number"></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.receiveUser" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"
+                filterable="">
+                <el-option v-for="item in personList" :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-select v-model="addInfo.departLims" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+                <el-option v-for="item in list" :key="item.name" :label="item.name" :value="item.name">
+                </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-date-picker v-model="addInfo.receiveDate" type="date" size="small" placeholder="閫夋嫨鏃ユ湡"
+                format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;">
+              </el-date-picker>
+            </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>
+  </div>
+</template>
+
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {
+  getYearAndMonthAndDays
+} from '@/utils/date'
+import {
+  selectUserCondition,
+} from "@/api/system/user.js";
+import {
+  exportOutManageRecordIssueRecycle,
+  doManageRecordIssueRecycle,
+  addManageRecordIssueRecycle,
+  selectCNSAPersonTree,
+  pageManageRecordIssueRecycle,
+  delManageRecordIssueRecycle,
+} from '@/api/cnas/systemManagement/documentRecords.js'
+import {
+  pageManageDocumentList,
+} from '@/api/cnas/systemManagement/documentControl.js'
+import { mapGetters } from "vuex";
+export default {
+  components: {
+    limsTable
+  },
+  data() {
+    return {
+      addPower: true,
+      outPower: true,
+      upPower: true,
+      outLoading: false,
+      addLoading: false,
+      title: '鏂板',
+      addDialogVisible: false,
+      addInfo: {},
+      personList: [],
+      fileType: [],
+      fileList: [],
+      list: [],
+      queryParams: {},
+      tableData: [],
+      column: [
+        { label: "鏂囦欢缂栧彿", prop: "documentCode" },
+        { label: "鏂囦欢鍚嶇О", prop: "documentName", width: "120px" },
+        {
+          label: "鐗堝彿",
+          prop: "documentVersion",
+        },
+        { label: "浠芥暟", prop: "pages" },
+        { label: "鏂囦欢绫诲埆", prop: "documentType" },
+        { label: "鍒嗗彂鍙�", prop: "number" },
+        { label: "鎺ュ彈浜�", prop: "receiveUserName" },
+        { label: "鎺ユ敹閮ㄩ棬", prop: "departLims" },
+        { label: "鎺ュ彈鏃ユ湡", prop: "receiveDate" },
+        { label: "绛炬敹浜�", prop: "signedUserName" },
+        { label: "绛炬敹鏃ユ湡", prop: "signedDate" },
+        {
+          dataType: "action",
+          fixed: "right",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "缂栬緫",
+              type: "text",
+              clickFun: (row) => {
+                this.handleEdit(row);
+              },
+              disabled: (row) => {
+                return !!row.signedUser
+              },
+            },
+            {
+              name: "鍥炴敹",
+              type: "text",
+              clickFun: (row) => {
+                this.handleBack(row);
+              },
+              disabled: (row) => {
+                return !!row.signedUser
+              },
+            },
+            {
+              name: "鍒犻櫎",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDelete(row);
+              },
+              disabled: (row) => {
+                return !!row.signedUser
+              },
+            },
+          ],
+        },
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading: false,
+    }
+  },
+  // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+  computed: {
+    action() {
+      return this.javaApi + '/manageRecordIssueRecycle/exportInManageRecordIssueRecycle'
+    },
+    ...mapGetters(["userId"]),
+  },
+  mounted() {
+    // this.entityCopy = this.HaveJson(this.componentData.entity);
+    this.getList()
+    this.getAuthorizedPerson()
+    this.selectEnumByCategory()
+    this.getFileList()
+    // TODO 閮ㄩ棬鎺ュ彛闇�瑕侀噸鍐�
+    // this.selectTreeList()
+  },
+  methods: {
+    getPower() {
+      let power = JSON.parse(sessionStorage.getItem('power'))
+      let add = false
+      let del = false
+      let up = false;
+      let out = false;
+      let edit = false
+      for (var i = 0; i < power.length; i++) {
+        if (power[i].menuMethod == 'addManageRecordIssueRecycle') {
+          add = true
+        }
+        if (power[i].menuMethod == 'delManageRecordIssueRecycle') {
+          del = true
+        }
+        if (power[i].menuMethod == 'exportInManageRecordIssueRecycle') {
+          up = true
+        }
+        if (power[i].menuMethod == 'doManageRecordIssueRecycle') {
+          edit = true
+        }
+        if (power[i].menuMethod == 'exportOutManageRecordIssueRecycle') {
+          out = true
+        }
+      }
+      if (!add) {
+        this.componentData.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;
+    },
+    handleEdit(row) {
+      this.addInfo = row
+      this.title = '缂栬緫'
+      this.addDialogVisible = true;
+    },
+    // 瀵煎嚭
+    handleDown() {
+      this.outLoading = true
+      exportOutManageRecordIssueRecycle(this.queryParams).then(res => {
+        this.outLoading = false
+        if (res.code == 201) return this.$message.error('瀵煎嚭澶辫触')
+        let url = this.javaApi + '/word/' + res.data
+        this.$download.saveAs(url, '鏂囦欢鍙戞斁涓庡洖鏀惰褰�')
+      })
+    },
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.page };
+      delete param.total;
+      pageManageRecordIssueRecycle({ ...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();
+    },
+    refresh() {
+      this.queryParams = {};
+      this.page.current = 1;
+      this.getList();
+    },
+    refreshTable() {
+      this.page.current = 1;
+      this.getList();
+    },
+    getAuthorizedPerson() {
+      selectUserCondition().then(res => {
+        let data = []
+        res.data.forEach(a => {
+          data.push({
+            label: a.name,
+            value: a.id
+          })
+        })
+        this.personList = data
+      })
+    },
+    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('涓婁紶澶辫触');
+      }
+    },
+    selectEnumByCategory() {
+      // 鏂囦欢绫诲埆
+      this.getDicts("document_type").then((response) => {
+        this.fileType = this.dictToValue(response.data);
+      });
+    },
+    // 鑾峰彇鏂囦欢鍒楄〃--鏂囦欢娓呭崟
+    getFileList() {
+      pageManageDocumentList({
+        current: -1,
+        size: -1
+      }).then(res => {
+        this.fileList = res.data.records.map(m => {
+          m.title = m.documentCode
+          return m
+        })
+      }).catch(err => { })
+    },
+    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.$set(this.addInfo, 'documentType', obj.type)
+      }
+    },
+    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, pages, documentType, number, receiveUser, receiveDate, departLims } = this.addInfo
+        obj = { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims }
+      }
+      if (this.title == '鏂板') {
+        addManageRecordIssueRecycle(obj).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { })
+      } else {
+        doManageRecordIssueRecycle(obj).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { })
+      }
+    },
+    // 鍥炴敹
+    handleBack(row) {
+      this.$confirm('鏄惁纭鍥炴敹?', "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      }).then(() => {
+        let obj = {}
+        let { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims } = row
+        obj = { id, documentCode, documentName, documentVersion, pages, documentType, number, receiveUser, receiveDate, departLims, signedDate: getYearAndMonthAndDays(), signedUser: this.userId }
+        doManageRecordIssueRecycle(obj).then(res => {
+          this.addLoading = false
+          if (res.code == 201) {
+            return
+          }
+          this.addDialogVisible = false
+          this.$message({
+            type: 'success',
+            message: '鎿嶄綔鎴愬姛!'
+          });
+          this.refreshTable()
+        }).catch(err => { })
+      }).catch(() => { })
+    },
+    // 鏌ヨ鏍戝舰鍒楄〃
+    selectTreeList() {
+      selectCNSAPersonTree().then((res) => {
+        this.list = res.data[0].children;
+      });
+    },
+    handleDelete(row) {
+      this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          delManageRecordIssueRecycle({ id: row.id }).then((res) => {
+            if (res.code == 201) return;
+            this.$message.success("鍒犻櫎鎴愬姛");
+            this.refresh();
+          });
+        })
+        .catch(() => { });
+    },
+  }
+}
+</script>
+
+<style scoped>
+.title {
+  height: 60px;
+  line-height: 60px;
+}
+
+.search {
+  background-color: #fff;
+  height: 80px;
+  display: flex;
+  align-items: center;
+}
+
+.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 - 80px - 10px - 40px);
+  padding: 20px;
+  padding-top: 0;
+}
+</style>

--
Gitblit v1.9.3