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/mandate.vue | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 178 insertions(+), 0 deletions(-) diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/mandate.vue b/src/views/CNAS/personnel/personnelInfo/tabs/mandate.vue new file mode 100644 index 0000000..691970d --- /dev/null +++ b/src/views/CNAS/personnel/personnelInfo/tabs/mandate.vue @@ -0,0 +1,178 @@ +<template> + <div class="flex_column"> + <div> + <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> + </div> + <Add ref="mandateModal" @refresh="getTableData"></Add> + </div> +</template> +<script> +import Add from "../components/mandateAdd.vue" +import limsTable from "@/components/Table/lims-table.vue"; +import { + deletePersonPostAuthorizationRecord, exportPersonPostAuthorizationRecord, + PersonPostAuthorizationRecordPage +} from "@/api/cnas/personal/personPostAuthorizationRecord"; +import {delCustomById} from "@/api/system/customer"; + +export default { + components: { + limsTable, + Add + }, + props: { + departId: { + type: Number, + default: () => { + return null; + } + }, + isDepartment: { + type: Boolean, + default: false + } + }, + data() { + return { + columnData: [ + { + label: '搴忓彿', + prop: 'id' + }, { + label: '璇佷功缂栧彿', + prop: 'certificateNumber' + }, { + label: '琚换鑱屼汉鍛�', + prop: 'userName' + }, { + label: '浠昏亴宀椾綅', + prop: 'post' + }, { + label: '鐞嗚鑰冭瘯鎴愮哗', + prop: 'num1', + width: 120 + },{ + label: '鎿嶄綔鎶�鑳借�冭瘯鎴愮哗', + prop: 'num2', + width: 150 + },{ + label: '鎿嶄綔鏃堕棿', + prop: 'updateTime' + }, { + label: '澶囨敞', + prop: 'remarks', + width: 300 + }, { + label: '鎿嶄綔', + dataType: 'action', + width: 160, + fixed: 'right', + 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.deleteNotify(row.id) + } + } + ] + }, + ], + tableData: [], + pagination: { + current: 1, + size: 20, + total: 0 + }, + loading: false + } + }, + mounted() { + this.getTableData() + }, + methods: { + openDialog(row, type=false) { + this.$refs.mandateModal.openDialog(row, type) + }, + /** + * @desc 鏌ヨ琛ㄦ牸鏁版嵁 + */ + async getTableData() { + const params = this.isDepartment ? { + departLimsId: this.departId, + current: this.pagination.current, + size: this.pagination.pageSize + } : { + userId: this.departId, + current: this.pagination.current, + size: this.pagination.pageSize + } + this.loading = true + PersonPostAuthorizationRecordPage(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 鍒犻櫎浠昏亴璁板綍 + */ + deleteNotify(id) { + this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }).then(() => { + deletePersonPostAuthorizationRecord({id: id}).then(res => { + this.$message.success('鍒犻櫎鎴愬姛') + this.getTableData() + }).catch(e => { + this.$message.error('鍒犻櫎澶辫触') + }) + }).catch(() => {}) + }, + handleDown(row){ + exportPersonPostAuthorizationRecord({id:row.id}).then(res => { + const blob = new Blob([res],{ type: 'application/octet-stream' }); + this.$download.saveAs(blob, '浠昏亴鎺堟潈-'+row.certificateNumber+'-'+row.post + '.docx') + }) + } + }, + watch: { + departId: { + handler(newId, oldId) { + if (newId) { + this.getTableData(); + } + } + } + } +} +</script> +<style scoped> +</style> -- Gitblit v1.9.3