From 14d29f928b24d203e76f1dcefc1a51182657cd45 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 10 三月 2025 16:29:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
---
src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 213 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue
new file mode 100644
index 0000000..086b96b
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/index.vue
@@ -0,0 +1,213 @@
+<template>
+ <div class="flex_column">
+ <TableCard :showForm="isDepartment" title="娌熼�氳褰�">
+ <template v-slot:form>
+ <div v-if="isDepartment" class="w100 items_center justify_between">
+ <div></div>
+ <div>
+ <el-button size="small" type="primary" @click="openDialog">鏂板</el-button>
+ </div>
+ </div>
+ </template>
+ <template v-slot:table>
+ <limsTable :column="columnData" :height="'calc(100vh - 21em)'" :table-data="tableData"
+ :table-loading="loading" style="margin-top: 18px; padding: 0 15px;" :page="page"
+ @pagination="pagination"></limsTable>
+ </template>
+ </TableCard>
+ <Add ref="communicateModal" @submit="getTableData"></Add>
+ </div>
+</template>
+<script>
+import TableCard from '@/components/TableCard/index.vue';
+import limsTable from "@/components/Table/lims-table.vue";
+import Add from "./Add.vue"
+import {
+ personPersonCommunicationAbilityPage,
+ deletePersonCommunicationAbility,
+ exportPersonCommunicationAbility
+} from '@/api/cnas/personnel/personnelInfo.js'
+
+export default {
+ components: {
+ TableCard,
+ limsTable,
+ Add
+ },
+ props: {
+ departId: {
+ type: Number,
+ default: () => {
+ return null;
+ }
+ },
+ isDepartment: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ // departId: 0,
+ columnData: [
+ {
+ label: '搴忓彿',
+ prop: 'id'
+ }, {
+ label: '娌熼�氫汉',
+ prop: 'userName'
+ }, {
+ label: '娌熼�氭椂闂�',
+ prop: 'communicationTime'
+ }, {
+ label: '娌熼�氬湴鐐�',
+ prop: 'communicationPlace'
+ }, {
+ label: '娌熼�氬唴瀹�',
+ prop: 'communicationContent'
+ }, {
+ label: '鎿嶄綔',
+ dataType: 'action',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.openDialog(row, true)
+ }
+ }, {
+ name: '瀵煎嚭',
+ type: 'text',
+ clickFun: (row) => {
+ this.handleDown(row)
+ }
+ }, {
+ name: '鍒犻櫎',
+ type: 'text',
+ color: '#f56c6c',
+ clickFun: (row) => {
+ this.delPerson(row.id)
+ }
+ }
+ ]
+ },
+ ],
+ tableData: [],
+ page: {
+ current: 1,
+ pageSize: 20,
+ total: 0
+ },
+ loading: false
+ }
+ },
+ mounted() {
+ this.getTableData()
+ },
+ methods: {
+ openDialog(row, type = false) {
+ this.$refs.communicateModal.openDialog(row, type)
+ },
+ async getTableData() {
+ this.loading = true
+ const params = this.isDepartment ? {
+ departLimsId: this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ } : {
+ userId: this.departId,
+ current: this.page.current,
+ size: this.page.pageSize
+ }
+ const { code, data } = await personPersonCommunicationAbilityPage(params)
+ if (code == 200) {
+ this.page.total = data.total
+ this.tableData = data.records
+ this.loading = false
+ }
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getTableData();
+ },
+ /**
+ * @desc 鑾峰彇璁惧id
+ */
+ getDepart(id) {
+ this.departId = id
+ this.getTableData()
+ },
+ /**
+ * @desc 鍒犻櫎娌熼�氳褰�
+ */
+ delPerson(id) {
+ this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ let formData = new FormData()
+ formData.append('id', id)
+ const { code } = await deletePersonCommunicationAbility(formData)
+ if (code == 200) {
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ this.getTableData()
+ }
+ })
+ },
+ async handleDown(row) {
+ exportPersonCommunicationAbility({ id: row.id }).then(res => {
+ if (res.code == 201) {
+ this.$message.error(res.message)
+ return
+ }
+ const blob = new Blob([res], { type: 'application/octet-stream' });
+ this.$download.saveAs(blob, row.userName + '-娌熼�氳褰�' + '.docx')
+ })
+ }
+ },
+ watch: {
+ departId: {
+ handler(newId, oldId) {
+ if (newId) {
+ this.getTableData();
+ }
+ }
+ }
+ }
+}
+</script>
+<style scoped>
+.flex_column {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.w100 {
+ width: 100%;
+}
+
+
+.items_center {
+ display: flex;
+ align-items: center;
+}
+
+.justify_between {
+ justify-content: space-between
+}
+
+.date_box {
+ margin: 0 5px;
+}
+
+.search {
+ width: 150px;
+ padding: 0 16px;
+}
+</style>
--
Gitblit v1.9.3