From dc3af0cbb4a6d105bdff497b510cc0a87b3e8d0a Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期五, 28 二月 2025 17:53:44 +0800 Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev --- src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 153 insertions(+), 0 deletions(-) diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue b/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue new file mode 100644 index 0000000..186ee8e --- /dev/null +++ b/src/views/CNAS/personnel/personnelInfo/tabs/communicate.vue @@ -0,0 +1,153 @@ +<template> + <div class="flex_column"> + <div v-if="isDepartment" style="display: flex;justify-content: space-between;margin-bottom: 10px"> + <el-button size="small" type="primary" @click="getTableData">鍒锋柊</el-button> + <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog">鏂板</el-button> + </div> + <lims-table :tableData="tableData" :column="columnData" + @pagination="page" :height="'calc(100vh - 18em)'" + :page="pagination" :tableLoading="loading"></lims-table> + <Add ref="communicateModal" @submit="getTableData"></Add> + </div> +</template> +<script> +import CommunicateAdd from "../components/communicateAdd.vue" +import limsTable from "@/components/Table/lims-table.vue"; +import { + deletePersonCommunicationAbility, exportPersonCommunicationAbility, + personPersonCommunicationAbilityPage +} from "@/api/cnas/personal/personPersonCommunicationAbilityPage"; + +export default { + components: { + limsTable, + Add: CommunicateAdd + }, + props: { + departId: { + type: Number, + default: () => { + return null; + } + }, + isDepartment: { + type: Boolean, + default: false + } + }, + data() { + return { + columnData: [ + { + 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: [], + pagination: { + current: 1, + size: 20, + total: 0 + }, + loading: false + } + }, + mounted() { + this.getTableData() + }, + methods: { + openDialog(row, type=false) { + this.$refs.communicateModal.openDialog(row, type) + }, + getTableData() { + this.loading = true + const params = this.isDepartment ? { + departLimsId: this.departId, + current: this.pagination.current, + size: this.pagination.size + } : { + userId: this.departId, + current: this.pagination.current, + size: this.pagination.size + } + personPersonCommunicationAbilityPage(params).then(res => { + this.loading = false + this.tableData = res.data.records + this.pagination.total = res.data.total + }).catch(err => { + this.loading = false + }) + }, + page (page) { + this.pagination.size = page.limit + this.getTableData() + }, + /** + * @desc 鍒犻櫎娌熼�氳褰� + */ + delPerson(id) { + this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ユ枃浠�, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(async () => { + deletePersonCommunicationAbility({id: id}).then(res => { + this.$message.success('鍒犻櫎鎴愬姛!'); + this.getTableData() + }) + }) + }, + async handleDown(row){ + exportPersonCommunicationAbility({id:row.id}).then(res => { + 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> +</style> -- Gitblit v1.9.3