¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |