123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861 |
- <template>
- <div class="m-container">
- <h2>
- <div class="squrt"></div>
- 人力资源表
- </h2>
- <div class="m-core">
- <!-- 搜索标题 -->
- <saveform
- :inline="true"
- ref="searchForm"
- class="searchForm"
- :model.sync="searchForm"
- >
- <el-form-item prop="userNameOrIdOrMobile">
- <el-input
- placeholder="姓名手机号"
- v-model.trim="searchForm.userNameOrIdOrMobile"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item prop="sourceFrom">
- <el-select
- v-model.trim="searchForm.sourceFrom"
- clearable
- filterable
- placeholder="请选择信息来源"
- >
- <el-option label="BOSS" value="BOSS"></el-option>
- <el-option label="转介绍" value="转介绍"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="status">
- <el-select
- v-model.trim="searchForm.status"
- clearable
- filterable
- placeholder="请选择人员状态"
- >
- <el-option label="未录用" value="NOT_EMPLOYED"></el-option>
- <el-option label="面试中" value="INTERVIEWING"></el-option>
- <el-option label="储备" value="RESERVE"></el-option>
- <el-option label="兼职" value="PART_TIME"></el-option>
- <el-option label="全职" value="FULL_TIME"></el-option>
- <el-option label="离职" value="DIMISSION"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="position">
- <el-select
- v-model.trim="searchForm.position"
- clearable
- filterable
- placeholder="请选择职位"
- >
- <el-option label="指导老师" value="ADVISER"></el-option>
- <el-option label="乐团主管" value="ACADEMIC"></el-option>
- <el-option label="乐队指导" value="TEACHING"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="organId">
- <el-select
- v-model.trim="searchForm.organId"
- placeholder="请选择分部"
- clearable
- filterable
- >
- <el-option
- v-for="(item, index) in organList"
- :key="index"
- :value="item.id"
- :label="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="subjectId" :label-width="formLabelWidth">
- <el-select
- v-model.trim="searchForm.subjectId"
- clearable
- filterable
- placeholder="请选择声部"
- >
- <el-option
- v-for="(item, index) in subjectList"
- :key="index"
- :value="item.id"
- :label="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="notMobileAndWechat">
- <el-select
- v-model.trim="searchForm.notMobileAndWechat"
- clearable
- filterable
- placeholder="是否手机微信双无"
- >
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="dates" :label-width="formLabelWidth">
- <el-date-picker
- v-model="searchForm.dates"
- type="daterange"
- style="width: 405px"
- range-separator="至"
- start-placeholder="操作开始日期"
- end-placeholder="操作结束日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item prop="hrbp">
- <!-- <el-input
- placeholder="归属管理HR"
- v-model.trim="searchForm.operator"
- clearable
- ></el-input> -->
- <el-select
- v-model.trim="searchForm.hrbp"
- clearable
- filterable
- placeholder="请选择HRBP"
- >
- <el-option
- v-for="(item, index) in roleList"
- :key="index"
- :value="item.userId"
- :label="item.userName"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="intentionCity">
- <el-input
- placeholder="意向城市"
- v-model.trim="searchForm.intentionCity"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button @click="search" type="danger">搜索</el-button>
- <el-button @click="onReSet" type="primary">重置</el-button>
- <el-button
- type="primary"
- v-if="$helpers.permission('export/employeeInfo')"
- @click="employeeExport"
- >导出</el-button
- >
- <!-- style="background-color: #409eff; border-color: #409eff" -->
- </el-form-item>
- </saveform>
- <el-button
- v-permission="'employeeInfo/insert'"
- @click="openTypes('create')"
- type="primary"
- style="margin-bottom:20px"
- >
- 添加
- </el-button>
- <div class="tableWrap">
- <el-table
- :data="tableList"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- >
- <el-table-column
- width="120px"
- align="center"
- prop="id"
- label="编号"
- ></el-table-column>
- <el-table-column align="center" prop="realName" label="姓名">
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="dark"
- :content="scope.row.realName"
- placement="top"
- >
- <copy-text>{{ scope.row.realName }}</copy-text>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="mobileNo" label="手机号" width="140px">
- <template slot-scope="scope">
- <div>
- <copy-text>{{ scope.row.mobileNo }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="wechatNo"
- label="微信"
- ></el-table-column>
- <el-table-column align="center" label="学历信息">
- <template slot-scope="scope">
- <el-button @click="openEducation(scope.row)" type="text"
- >查看学历</el-button
- >
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="subjectName"
- label="声部"
- width="200px"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="dark"
- :content="scope.row.subjectName"
- placement="top"
- >
- <span>{{ scope.row.subjectName }}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="liveCity"
- label="所在城市"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="intentionCity"
- label="意向城市"
- width="100px"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="dark"
- :content="scope.row.intentionCity"
- placement="top"
- >
- <span>{{ scope.row.intentionCity }}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <!-- <el-table-column
- align="center"
- prop="assessmentResult"
- label="评估结果"
- width="200px"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="dark"
- :content="scope.row.assessmentResult"
- placement="top"
- >
- <span>{{ scope.row.assessmentResult }}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="otherComment"
- label="其它综合情况"
- width="200px"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="dark"
- :content="scope.row.otherComment"
- placement="top"
- >
- <span>{{ scope.row.otherComment }}</span>
- </el-tooltip>
- </template>
- </el-table-column> -->
- <el-table-column
- align="center"
- prop="sourceFrom"
- label="信息来源"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="nextVisitDate"
- label="下次沟通时间"
- width="150px"
- >
- <template slot-scope="scope">
- {{ scope.row.nextVisitDate | dayjsFormat }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="entryDate"
- label="入职时间"
- width="150px"
- >
- <template slot-scope="scope">
- {{ scope.row.entryDate | dayjsFormat }}
- </template>
- </el-table-column>
- <el-table-column align="center" prop="position" label="职位">
- <template slot-scope="scope">
- {{ scope.row.position | jobType }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="organName"
- label="分部"
- ></el-table-column>
- <!-- <el-table-column
- align="center"
- prop="isProbationPeriod"
- label="是否试用期"
- >
- <template slot-scope="scope">
- {{
- typeof scope.row.isProbationPeriod === "boolean"
- ? scope.row.isProbationPeriod
- ? "是"
- : "否"
- : ""
- }}
- </template>
- </el-table-column> -->
- <el-table-column align="center" prop="status" label="人员状态">
- <template slot-scope="scope">
- {{ scope.row.status | hrStatus }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="idCard"
- label="证件号码"
- width="200px"
- ></el-table-column>
- <el-table-column align="center" prop="age" label="年龄">
- <template slot-scope="scope">
- {{ scope.row.age > 0 ? scope.row.age : "" }}
- </template>
- </el-table-column>
- <el-table-column align="center" prop="gender" label="性别">
- <template slot-scope="scope">
- {{
- typeof scope.row.gender === "boolean"
- ? scope.row.gender
- ? "男"
- : "女"
- : ""
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="bankCardNo"
- label="银行卡号"
- width="200px"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="bankAddress"
- label="开户行"
- width="200px"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="emergencyContactName"
- label="紧急联系人"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="emergencyContactRelation"
- label="紧急联系人关系"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="emergencyContactPhone"
- label="紧急联系人电话"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="updateTime"
- label="最后一次操作时间时间"
- width="160px"
- ></el-table-column>
- <el-table-column align="center" label="HRBP">
- <template slot-scope="scope">
- <div>
- <copy-text>{{ roleFormat(scope.row.hrbp) }}</copy-text>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="resignationDate"
- label="离职时间"
- width="150px"
- >
- <template slot-scope="scope">
- {{ scope.row.resignationDate | dayjsFormat }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" fixed="right">
- <template slot-scope="scope">
- <el-button
- v-permission="'employeeInfo/update'"
- @click="openTypes('update', scope.row)"
- type="text"
- >修改</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- :total.sync="pageInfo.total"
- :page.sync="pageInfo.page"
- :limit.sync="pageInfo.limit"
- :page-sizes="pageInfo.page_size"
- sync
- @pagination="getList"
- />
- </div>
- </div>
- <el-dialog
- :title="formTitle[formActionTitle]"
- :visible.sync="typeStatus"
- destroy-on-close
- :close-on-click-modal="false"
- @close="onFormClose('ruleForm')"
- width="1150px"
- >
- <hrform
- :detail.sync="rowDetail"
- v-if="typeStatus"
- :organList="organList"
- :subjectList="subjectList"
- :roleList="roleList"
- :close="onFormClose"
- :formActionTitle="formActionTitle"
- :getList="getList"
- />
- </el-dialog>
- <el-dialog
- title="查看学历信息"
- :visible.sync="educationVisible"
- destroy-on-close
- :close-on-click-modal="false"
- @close="educationVisible = false"
- width="600px"
- >
- <el-table
- :data="educationList"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- >
- <el-table-column
- align="center"
- prop="level"
- label="学历"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="school"
- label="毕业学校"
- ></el-table-column>
- <el-table-column align="center" prop="year" label="毕业时间">
- <template slot-scope="scope">
- {{ scope.row.year | dayjsFormat }}
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import saveform from "@/components/save-form";
- import dayjs from "dayjs";
- import hrform from "./form";
- import { Export } from "@/utils/downLoadFile";
- import cleanDeep from "clean-deep";
- // import store from '@/store'
- import {
- helpCenterCatalogList,
- employeeInfo,
- helpCenterContentModify,
- helpCenterContentDelete,
- } from "@/api/appTenant";
- import { getEmployeeOrgan, getSubject } from "@/api/buildTeam";
- import { subjectListTree } from "@/api/specialSetting";
- export const getTimes = (times, keys = []) => {
- if (times && times.length) {
- return {
- [keys[0] || "start"]: dayjs(times[0]).format("YYYY-MM-DD"),
- [keys[1] || "start"]: dayjs(times[1]).format("YYYY-MM-DD"),
- };
- }
- return {};
- };
- const initSearch = {
- organId: "",
- jobNature: "",
- position: "",
- subjectId: "",
- userNameOrIdOrMobile: "",
- operator: "",
- dates: [],
- intentionCity: "",
- hrbp: "",
- notMobileAndWechat:""
- };
- export default {
- components: { pagination, hrform, saveform },
- name: "helpCategory",
- data() {
- return {
- searchForm: {
- ...initSearch,
- },
- educationVisible: false,
- treeList: [],
- tableList: [],
- educationList: [],
- formActionTitle: "create",
- formTitle: {
- create: "添加人员",
- update: "修改人员",
- },
- typeStatus: false, // 添加教学点
- formLabelWidth: "100px",
- form: {
- title: null, // 标题
- content: null, // 内容
- catalogId: null, // 分类编号
- },
- rules: {
- title: [{ required: true, message: "请输入标题", trigger: "blur" }],
- content: [{ required: true, message: "请输入内容", trigger: "blur" }],
- catalogId: [
- { required: true, message: "请输入选择分类", trigger: "blur" },
- ],
- // subjectIds: [{ required: true, message: "请选择声部组合", trigger: "change" }]
- },
- pageInfo: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- rowDetail: null,
- tempTreeList: [],
- organList: [],
- subjectList: [],
- roleList: [],
- };
- },
- activated() {
- this.getList();
- this.getSubjectList();
- //
- },
- async mounted() {
- this.getList();
- this.getSubjectList();
- this.getTreeList();
- },
- computed: {
- subjectListObj() {
- const data = {};
- for (let i = 0; i < this.subjectList.length; i++) {
- const item = this.subjectList[i];
- data[item.id] = item.name;
- }
- return data;
- },
- organListObj() {
- const data = {};
- for (let i = 0; i < this.organList.length; i++) {
- const item = this.organList[i];
- data[item.id] = item.name;
- }
- return data;
- },
- },
- async mounted() {
- await this.$store.dispatch("setOrganRole");
- this.roleList = this.selects.roles.hrId;
- this.getList();
- // this.getTreeList()
- getEmployeeOrgan().then((res) => {
- if (res.code == 200) {
- this.organList = res.data;
- }
- });
- this.getSubjectList();
- },
- methods: {
- employeeExport() {
- const { dates, ...rest } = this.searchForm;
- let params = {
- ...rest,
- ...getTimes(dates, ["startDate", "endDate"]),
- };
- Export(
- this,
- {
- url: "/api-web/export/employeeInfo",
- fileName: `人力资源导出.xls`,
- params: cleanDeep({
- ...params,
- }),
- },
- "是否确认导出人力资源?"
- );
- },
- getSubjectList() {
- getSubject({
- delFlag: 0,
- tenantId: 1,
- }).then((res) => {
- let result = res.data;
- if (res.code == 200) {
- // let tempArray = []
- // result.rows.forEach((item, index) => {
- // let subject = []
- // item.subjects.forEach(s => {
- // subject.push({
- // value: s.id,
- // label: s.name
- // })
- // })
- // tempArray[index] = {
- // label: item.name,
- // options: subject
- // }
- // })
- this.subjectList = result;
- }
- });
- },
- openEducation(row) {
- try {
- this.educationList = row.educationalBackground
- ? JSON.parse(row.educationalBackground)
- : [];
- this.educationVisible = true;
- } catch (error) {
- this.$message.error("数据解析失败");
- }
- },
- onTypeDelOpeation(row) {
- this.$confirm("您是否删除该内容?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- helpCenterContentDelete({ id: row.id }).then((res) => {
- this.messageTips("删除", res);
- });
- })
- .catch(() => {});
- },
- search() {
- this.$refs.searchForm.validate((valid) => {
- this.pageInfo = {
- ...this.pageInfo,
- page: 1,
- };
- this.getList();
- });
- },
- onReSet() {
- this.pageInfo = {
- ...this.pageInfo,
- page: 1,
- };
- this.$refs.searchForm.resetFields();
- this.getList();
- },
- onTypeSubmit(formName) {
- // 添加数据
- this.$refs[formName].validate((valid) => {
- if (valid) {
- if (this.formActionTitle == "create") {
- let params = {
- title: this.form.title, // 标题
- content: this.form.content, // 内容
- catalogId: this.form.catalogId[this.form.catalogId.length - 1], // 分类编号
- };
- helpCenterContentModify(params).then((res) => {
- this.messageTips("添加", res);
- });
- } else if (this.formActionTitle == "update") {
- let params = {
- id: this.form.id,
- title: this.form.title, // 标题
- content: this.form.content, // 内容
- catalogId: this.form.catalogId[this.form.catalogId.length - 1], // 分类编号
- };
- helpCenterContentModify(params).then((res) => {
- this.messageTips("修改", res);
- });
- }
- } else {
- return false;
- }
- });
- },
- messageTips(title, res) {
- if (res.code == 200) {
- this.$message.success(title + "成功");
- this.typeStatus = false;
- this.getList();
- } else {
- this.$message.error(res.msg);
- }
- },
- getList() {
- const { dates, ...rest } = this.searchForm;
- console.log(dates);
- let params = {
- ...rest,
- ...getTimes(dates, ["startDate", "endDate"]),
- page: this.pageInfo.page,
- rows: this.pageInfo.limit,
- };
- employeeInfo(params).then((res) => {
- let result = res.data;
- if (res.code == 200) {
- this.tableList = result.rows;
- this.pageInfo.total = result.total;
- }
- });
- },
- getTreeList() {
- helpCenterCatalogList({
- parentId: 0,
- }).then((res) => {
- let result = res.data;
- if (res.code == 200) {
- this.treeList = this.setTableData(result);
- }
- });
- },
- setTableData(result) {
- let list = [];
- list = result.map((res) => {
- let tempList = {};
- tempList = {
- value: res.id,
- label: res.text,
- parentId: res.parentId,
- };
- if (res.children && res.children.length > 0) {
- tempList.children = this.setTableData(res.children);
- }
- return tempList;
- });
- return list;
- },
- openTypes(type, row) {
- this.rowDetail = { ...row };
- this.typeStatus = true;
- this.formActionTitle = type;
- if (type == "update") {
- // 修改的时候赋值
- this.form = {
- id: row.id,
- title: row.title, // 标题
- content: row.content, // 内容
- catalogId: this.getAllIds(row), // 分类编号
- };
- }
- },
- onToUrl() {
- this.$router.push("/helpCategory");
- },
- getAllIds(row) {
- let idAndParent = []; // idAndParent保存 Tree所有节点的id和parentId
- this.getIdAndParent(this.treeList, idAndParent);
- let parentIds = []; // 用于保存选中节点的父节点及父节点的父节点
- this.getId(row.catalogId, parentIds, idAndParent);
- return parentIds.reverse(); //反转数组
- },
- getIdAndParent(tree, idAndParentIds) {
- // idAndParentIds用来保存所有节点的id,parentId
- // 对原有的数据结构进行遍历,拿出所有节点的id,parentId到一个一维数组中。
- tree.forEach((item) => {
- let mid = {
- id: item.value,
- parentId: item.parentId,
- };
- idAndParentIds.push(mid);
- if (item.children) {
- this.getIdAndParent(item.children, idAndParentIds);
- }
- });
- },
- getId(id, parentIds, idAndParent) {
- idAndParent.forEach((item) => {
- if (item.id == id) {
- parentIds.push(id);
- if (item.parentId != -1) {
- this.getId(item.parentId, parentIds, idAndParent);
- }
- }
- });
- },
- onFormClose(formName) {
- this.rowDetail = null;
- this.typeStatus = false;
- // 关闭弹窗重置验证
- this.form = {
- title: null, // 标题
- content: null, // 内容
- catalogId: [], // 分类编号
- };
- this.getList();
- // this.$refs.cascader.handleClear()
- // this.$refs[formName].resetFields();
- },
- roleFormat(value) {
- const roleList = this.roleList;
- let userName = null;
- roleList.forEach((item) => {
- if (item.userId == value) {
- userName = item.userName;
- }
- });
- return userName;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- /deep/.el-date-editor.el-input {
- width: 100% !important;
- }
- /deep/.el-select {
- width: 100% !important;
- }
- /deep/.el-table .cell {
- display: -webkit-box;
- overflow: hidden;
- max-height: 45px;
- text-overflow: ellipsis;
- -webkit-line-clamp: 3;
- -webkit-box-orient: vertical;
- }
- /deep/.el-dialog__body {
- padding: 10px 20px;
- }
- .newBand {
- display: inline-block;
- }
- </style>
|