| | |
| | | <div> |
| | | <span class="search_title">姓名:</span> |
| | | <el-input |
| | | v-model="searchForm.customerName" |
| | | v-model="searchForm.staffName" |
| | | style="width: 240px" |
| | | placeholder="请输入名称搜索" |
| | | placeholder="请输入姓名搜索" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">新增离职</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | :total="total" |
| | | ></PIMTable> |
| | | </div> |
| | | <form-dia ref="formDia"></form-dia> |
| | | <form-dia ref="formDia" @close="handleQuery"></form-dia> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { ref } from "vue"; |
| | | import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue"; |
| | | import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | customerName: "", |
| | | }, |
| | | form: { |
| | | salesLedgerId: "", |
| | | customerName: "", |
| | | salesman: "", |
| | | projectName: "", |
| | | productData: [], |
| | | }, |
| | | rules: { |
| | | salesLedgerId: [{ required: true, message: "请选择", trigger: "change" }], |
| | | staffName: "", |
| | | }, |
| | | }); |
| | | const { searchForm, form, rules } = toRefs(data); |
| | | const { searchForm } = toRefs(data); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "状态", |
| | | prop: "paymentDate", |
| | | prop: "staffState", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "在职"; |
| | | } else if (params == 1) { |
| | | return "离职"; |
| | | } else if (params == 1) { |
| | | return "在职"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 0) { |
| | | return "primary"; |
| | | } else if (params == 1) { |
| | | return "danger"; |
| | | } else if (params == 1) { |
| | | return "primary"; |
| | | } else { |
| | | return null; |
| | | } |
| | |
| | | }, |
| | | { |
| | | label: "员工编号", |
| | | prop: "supplierName", |
| | | prop: "staffNo", |
| | | }, |
| | | { |
| | | label: "姓名", |
| | | prop: "currentPaymentAmount", |
| | | prop: "staffName", |
| | | }, |
| | | { |
| | | label: "性别", |
| | | prop: "paymentMethod", |
| | | prop: "sex", |
| | | }, |
| | | { |
| | | label: "籍贯", |
| | | prop: "registrant", |
| | | prop: "nativePlace", |
| | | }, |
| | | { |
| | | label: "岗位", |
| | | prop: "registrationtDate", |
| | | prop: "postJob", |
| | | }, |
| | | { |
| | | label: "家庭住址", |
| | | prop: "registrationtDate", |
| | | prop: "adress", |
| | | }, |
| | | { |
| | | label: "第一学历", |
| | | prop: "registrationtDate", |
| | | prop: "firstStudy", |
| | | }, |
| | | { |
| | | label: "专业", |
| | | prop: "registrationtDate", |
| | | prop: "profession", |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | | prop: "registrationtDate", |
| | | prop: "identityCard", |
| | | }, |
| | | { |
| | | label: "年龄", |
| | | prop: "registrationtDate", |
| | | prop: "age", |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "registrationtDate", |
| | | prop: "phone", |
| | | }, |
| | | { |
| | | label: "紧急联系人", |
| | | prop: "registrationtDate", |
| | | prop: "emergencyContact", |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "registrationtDate", |
| | | prop: "emergencyContactPhone", |
| | | }, |
| | | { |
| | | label: "合同年限", |
| | | prop: "registrationtDate", |
| | | prop: "contractTerm", |
| | | }, |
| | | { |
| | | label: "合同开始日期", |
| | | prop: "registrationtDate", |
| | | prop: "contractStartTime", |
| | | }, |
| | | { |
| | | label: "合同结束日期", |
| | | prop: "registrationtDate", |
| | | prop: "contractEndTime", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | align: "center", |
| | | operation: [ |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | |
| | | staffJoinListPage({...page, ...searchForm.value, staffState: 0}).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records |
| | | total.value = res.data.total; |
| | | }).catch(err => { |
| | | tableLoading.value = false; |
| | | }) |
| | | }; |
| | | // 表格选择数据 |
| | | const handleSelectionChange = (selection) => { |
| | | console.log("selection", selection); |
| | | selectedRows.value = selection.filter( |
| | | (item) => item.salesContractNo !== undefined |
| | | ); |
| | | selectedRows.value = selection; |
| | | }; |
| | | |
| | | // 打开弹框 |
| | |
| | | formDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | |
| | | // 删除 |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | staffJoinDel(ids).then((res) => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 0}, "人员离职.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |