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/personnel-list.vue | 317 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 317 insertions(+), 0 deletions(-) diff --git a/src/views/CNAS/personnel/personnelInfo/tabs/personnel-list.vue b/src/views/CNAS/personnel/personnelInfo/tabs/personnel-list.vue new file mode 100644 index 0000000..92e0233 --- /dev/null +++ b/src/views/CNAS/personnel/personnelInfo/tabs/personnel-list.vue @@ -0,0 +1,317 @@ +<template> + <div> + <div style="display: flex;justify-content: space-between;"> + <el-form :model="entity" ref="entity" size="small" :inline="true"> + <el-form-item label="浜哄憳鍚嶇О"> + <el-input v-model="entity.name" clearable></el-input> + </el-form-item> + <el-form-item> + <el-button size="small" style="margin-left: 10px" @click="refresh()">閲� 缃�</el-button> + <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> + </el-form-item> + </el-form> + <div> + <el-button + :loading="outLoading" + size="small" + type="primary" + @click="handleDown">瀵煎嚭</el-button> + <el-button size="small" type="primary" @click="openSelectUserDia">鏂板缓</el-button> + </div> + </div> + <div class="search-table"> + <el-table v-loading="tableLoading" :data="tableData" border height="calc(100vh - 21em)" style="width: 100%;"> + <el-table-column align="center" label="搴忓彿" type="index" width="60"></el-table-column> + <el-table-column label="鍛樺伐缂栧彿" prop="account" width="150"></el-table-column> + <el-table-column label="濮撳悕" prop="name" width="120"></el-table-column> + <el-table-column label="绫嶈疮" prop="nativePlace" width="120"></el-table-column> + <el-table-column label="璇佷欢鍦板潃" prop="idAddress" show-overflow-tooltip width="100"></el-table-column> + <el-table-column label="鎵嬫満鍙�" prop="telephone" show-overflow-tooltip width="100"></el-table-column> + <el-table-column label="姣曚笟闄㈡牎" prop="graduatedInstitutions1" width="100"></el-table-column> + <el-table-column label="鎵�瀛︿笓涓�" prop="major1" width="100"></el-table-column> + <el-table-column label="姣曚笟鏃堕棿" prop="graduationTime1" width="100"></el-table-column> + <el-table-column label="鏈�楂樺鍘�" prop="officialAcademicRedentials" width="100"></el-table-column> + <el-table-column label="鏈�楂樺浣�" prop="highestDegree" width="100"></el-table-column> + <el-table-column label="鑱岀О" prop="professionalTitle" width="100"></el-table-column> + <el-table-column fixed="right" label="鎿嶄綔" width="120" align="center"> + <template slot-scope="scope"> + <el-button size="small" type="text" @click="$emit('updatePerson', scope.row)">缂栬緫</el-button> + <el-button size="small" type="text" @click="deletePerson(scope.row)" style="color: #f56c6c">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + <el-pagination + :current-page="1" + :current-page.sync="page.current" + :page-size="page.size" + :page-sizes="[10, 20, 30, 50, 100]" + :total="page.total" + background + layout="->,total, sizes, prev, pager, next, jumper" + style="margin-top: 10px" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + > + </el-pagination> + </div> + <el-dialog :visible.sync="selectUserDia" title="閫夋嫨鐢ㄦ埛" width="70%"> + <div class="search" style="margin-bottom: 9px;"> + <div class="search_thing"> + <div class="search_label">鐢ㄦ埛鍚嶏細</div> + <div class="search_input"> + <el-input + v-model="addUserTableInfo.name" + clearable + placeholder="璇疯緭鍏�" + size="small" + @change="selectUserList" + ></el-input> + </div> + <el-button size="small" style="margin-left: 10px" type="primary" @click="selectUserList">鏌ヨ</el-button> + </div> + </div> + <div v-if="selectUserDia" class="body" style="height: 60vh;"> + <lims-table :tableData="tableData1" :column="column1" + :isSelection="true" :handleSelectionChange="selectMethod" + :height="'calc(100vh - 290px)'" + :tableLoading="tableLoading1"></lims-table> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="selectUserDia = false">鍙� 娑�</el-button> + <el-button type="primary" @click="selectUser">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import {selectUserCondition} from "@/api/business/inspectionTask"; +import limsTable from "@/components/Table/lims-table.vue"; +import { + basicInformationOfPersonnelSelectPage, + delUserDepardLimsId, + exportPersonBasicInfo, + upUserDepardLimsId +} from "@/api/cnas/personal/personalList"; +import store from "@/store"; +import {Message} from "element-ui"; + +export default { + name: 'PersonnelList', + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {limsTable}, + props: { + departId: { + type: Number, + default: () => { + return null; + } + }, + isDepartment: { + type: Boolean, + default: false + }, + currentCompaniesList: { + type: Array, + default: [] + } + }, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + page: { + size: 20, + current: 1, + }, + outLoading: false, + tableLoading: false, + tableData: [], // 浜哄憳鎬诲垪琛ㄦ暟鎹� + tableData1: [], + tableLoading1: false, + column1: [ + {label: '濮撳悕', prop: 'name'}, + {label: '璐﹀彿', prop: 'account'}, + {label: '瑙掕壊', prop: 'roleName'}, + { + dataType: 'tag', + label: '鐘舵��', + prop: 'status', + formatData: (params) => { + if (params == 0) { + return '鍚敤' + } else { + return '' + } + }, + formatType: (params) => { + if (params == 0) { + return 'success' + } else { + return 'danger' + } + } + }, + {label: '鐢佃瘽鍙风爜', prop: 'phone'}, + ], + page1: { + total:0, + size:10, + current:1 + }, + selectUserDia: false, // 娣诲姞浜哄憳寮规 + entity: { + name: '', + orderBy: { + field: 'id', + order: 'asc' + } + }, + addUserTableInfo: { + name: null, + isCustom: 0, + }, + multipleSelection: [] + }; + }, + mounted() { + this.refreshTable(); + }, + // 鏂规硶闆嗗悎 + methods: { + /** + * @desc 鑾峰彇璁惧id + */ + // 閲嶇疆 + refresh() { + this.page = { + size: 20, + current: 1, + }; + this.entity.name = '' + this.refreshTable(); + }, + // 鏌ヨ浜哄憳鍒楄〃鏁版嵁 + refreshTable() { + this.tableLoading = true; + this.entity.departLimsId = this.departId; + const params = { + size: this.page.size, + current: this.page.current, + departmentId: this.entity.departLimsId, + name: this.entity.name, + } + basicInformationOfPersonnelSelectPage(params).then(res => { + this.tableLoading = false; + this.page.total = res.data.total; + this.tableData = res.data.records; + }).catch(err => { + this.tableLoading = false; + }) + }, + // 鍒犻櫎浜哄憳 + deletePerson(row) { + this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', '璀﹀憡', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + delUserDepardLimsId({id: row.userId}).then(res => { + this.$message.success('鍒犻櫎鎴愬姛'); + this.refreshTable(); + this.$emit('refreshTree') + }).catch(e => { + this.$message.error('鍒犻櫎澶辫触'); + }); + }).catch(() => { + }); + }, + handleSizeChange(val) { + this.page.size = val; + this.refreshTable(); + }, + handleCurrentChange(val) { + this.page.current = val; + this.refreshTable(); + }, + // 鎵撳紑鏂板浜哄憳寮规 + openSelectUserDia () { + this.selectUserDia = true; + this.selectUserList() + }, + // 鏌ヨ鏂板寮规鐨勪汉鍛樺垪琛� + selectUserList () { + this.tableLoading1 = true + selectUserCondition().then(res => { + this.tableLoading1 = false + this.tableData1 = res.data + }).catch(err => { + this.tableLoading1 = false + }) + }, + // 琛ㄦ牸閫夋嫨鏂规硶 + selectMethod(val) { + this.multipleSelection = val + }, + // 鎻愪氦闇�瑕佹坊鍔犵殑浜哄憳 + selectUser() { + if (!this.currentCompaniesList.length > 0) { + this.$message.warning("璇烽�夋嫨閮ㄩ棬锛�") + return; + } + let selects = this.HaveJson(this.multipleSelection) + if (selects.length === 0) { + this.$message.error('鏈�夋嫨鏁版嵁'); + return; + } + let ids = []; + selects.forEach(a => { + ids.push(a.id); + }); + let str = ''; + this.currentCompaniesList.forEach(a => { + if (a) { + str += a + ','; + } + }); + upUserDepardLimsId({ + ids: JSON.stringify(ids), + id: str + }).then(res => { + this.selectUserDia = false; + this.$message.success('娣诲姞鎴愬姛'); + this.refreshTable(); + this.$emit('refreshTree') + }); + }, + // 瀵煎嚭浜哄憳淇℃伅 + handleDown() { + this.outLoading = true; + let entity = this.HaveJson(this.entity) + delete entity.orderBy; + exportPersonBasicInfo({...entity}).then(res => { + this.outLoading = false; + const blob = new Blob([res], {type: 'application/octet-stream'}); + this.$download.saveAs(blob, '浜哄憳淇℃伅.xlsx') + this.$message.success('瀵煎嚭鎴愬姛') + }) + }, + }, + watch: { + departId: { + handler(newId, oldId) { + if (newId) { + this.page.current = 1 + this.refreshTable(); + } + } + } + } +}; +</script> + +<style scoped> +.search_thing { + display: flex; + align-items: center; +} +</style> -- Gitblit v1.9.3