yuan
5 天以前 9ea5ff67655241271bdf04bb50ca3a8d60c4e22a
src/views/personnelManagement/dimission/index.vue
@@ -3,25 +3,27 @@
    <div class="search_form mb20">
      <div>
        <span class="search_title">姓名:</span>
        <el-input v-model="searchForm.staffName"
        <el-input
            v-model="searchForm.staffName"
                  style="width: 240px"
                  placeholder="请输入姓名搜索"
                  @change="handleQuery"
                  clearable
                  :prefix-icon="Search" />
        <el-button type="primary"
                   @click="handleQuery"
                   style="margin-left: 10px">搜索</el-button>
            :prefix-icon="Search"
        />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
        >搜索</el-button
        >
      </div>
      <div>
        <el-button type="primary"
                   @click="openForm('add')">新增离职</el-button>
        <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">
      <PIMTable rowKey="id"
      <PIMTable
          rowKey="id"
                :column="tableColumn"
                :tableData="tableData"
                :page="page"
@@ -29,10 +31,10 @@
                @selection-change="handleSelectionChange"
                :tableLoading="tableLoading"
                @pagination="pagination"
                :total="page.total"></PIMTable>
          :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia"
              @close="handleQuery"></form-dia>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
  </div>
</template>
@@ -40,10 +42,7 @@
  import { Search } from "@element-plus/icons-vue";
  import { onMounted, ref } from "vue";
  import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue";
  import {
    findStaffLeaveListPage,
    batchDeleteStaffLeaves,
  } from "@/api/personnelManagement/staffLeave.js";
import {findStaffLeaveListPage, batchDeleteStaffLeaves} from "@/api/personnelManagement/staffLeave.js";
  import { ElMessageBox } from "element-plus";
  const data = reactive({
@@ -57,7 +56,7 @@
      label: "状态",
      prop: "staffState",
      dataType: "tag",
      formatData: params => {
    formatData: (params) => {
        if (params == 0) {
          return "离职";
        } else if (params == 1) {
@@ -66,7 +65,7 @@
          return null;
        }
      },
      formatType: params => {
    formatType: (params) => {
        if (params == 0) {
          return "danger";
        } else if (params == 1) {
@@ -93,6 +92,10 @@
      prop: "sex",
    },
    {
    label: "户籍住址",
    prop: "nativePlace",
  },
  {
      label: "部门",
      prop: "deptName",
    },
@@ -101,13 +104,18 @@
      prop: "postName",
    },
    {
    label: "现住址",
    prop: "adress",
    width:200
  },
  {
      label: "第一学历",
      prop: "firstStudy",
    },
    {
      label: "专业",
      prop: "profession",
      width: 100,
    width:100
    },
    {
      label: "年龄",
@@ -116,28 +124,28 @@
    {
      label: "联系电话",
      prop: "phone",
      width: 150,
    width:150
    },
    {
      label: "紧急联系人",
      prop: "emergencyContact",
      width: 120,
    width: 120
    },
    {
      label: "紧急联系人电话",
      prop: "emergencyContactPhone",
      width: 150,
    width:150
    },
    {
      dataType: "action",
      label: "操作",
      align: "center",
      fixed: "right",
    fixed: 'right',
      operation: [
        {
          name: "编辑",
          type: "text",
          clickFun: row => {
        clickFun: (row) => {
            openForm("edit", row);
          },
        },
@@ -152,8 +160,9 @@
    size: 100,
    total: 0,
  });
  const formDia = ref();
  const { proxy } = getCurrentInstance();
const formDia = ref()
const { proxy } = getCurrentInstance()
  // 查询列表
  /** 搜索按钮操作 */
@@ -161,40 +170,38 @@
    page.current = 1;
    getList();
  };
  const pagination = obj => {
const pagination = (obj) => {
    page.current = obj.page;
    page.size = obj.limit;
    getList();
  };
  const getList = () => {
    tableLoading.value = true;
    findStaffLeaveListPage({ ...page, ...searchForm.value })
      .then(res => {
  findStaffLeaveListPage({...page, ...searchForm.value}).then(res => {
        tableLoading.value = false;
        tableData.value = res.data.records;
    tableData.value = res.data.records
        page.total = res.data.total;
      })
      .catch(err => {
  }).catch(err => {
        tableLoading.value = false;
      });
  })
  };
  // 表格选择数据
  const handleSelectionChange = selection => {
const handleSelectionChange = (selection) => {
    selectedRows.value = selection;
  };
  // 打开弹框
  const openForm = (type, row) => {
    nextTick(() => {
      formDia.value?.openDialog(type, row);
    });
    formDia.value?.openDialog(type, row)
  })
  };
  // 删除
  const handleDelete = () => {
    let ids = [];
    if (selectedRows.value.length > 0) {
      ids = selectedRows.value.map(item => item.id);
    ids = selectedRows.value.map((item) => item.id);
    } else {
      proxy.$modal.msgWarning("请选择数据");
      return;
@@ -205,7 +212,7 @@
      type: "warning",
    })
      .then(() => {
        batchDeleteStaffLeaves(ids).then(res => {
        batchDeleteStaffLeaves(ids).then((res) => {
          proxy.$modal.msgSuccess("删除成功");
          getList();
        });