maven
4 天以前 70ecfcddb4a414e58cdde6dcb8246b7b80ed9ed8
src/views/personnelManagement/onboarding/index.vue
@@ -11,6 +11,22 @@
          clearable
          :prefix-icon="Search"
        />
        <span style="margin-left: 10px;"  class="search_title">合同开始日期:</span>
        <el-date-picker
            v-model="searchForm.entryDateStart"
            type="date"
            placeholder="请选择合同开始日期"
            size="default"
            @change="(date) => handleDateChange(date,1)"
        />
        <span style="margin-left: 10px;" class="search_title">合同结束日期:</span>
        <el-date-picker
            v-model="searchForm.entryDateEnd"
            type="date"
            placeholder="请选择合同结束日期"
            size="default"
            @change="(date) => handleDateChange(date,2)"
        />
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
          >搜索</el-button
        >
@@ -31,7 +47,7 @@
        @selection-change="handleSelectionChange"
        :tableLoading="tableLoading"
        @pagination="pagination"
        :total="total"
        :total="page.total"
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -44,6 +60,7 @@
import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue";
import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
import {ElMessageBox} from "element-plus";
import dayjs from "dayjs";
const data = reactive({
  searchForm: {
@@ -60,7 +77,7 @@
      if (params == 0) {
        return "离职";
      } else if (params == 1) {
        return "在职";
        return "入职";
      } else {
        return null;
      }
@@ -98,6 +115,7 @@
  {
    label: "家庭住址",
    prop: "adress",
    width:200
  },
  {
    label: "第一学历",
@@ -106,10 +124,12 @@
  {
    label: "专业",
    prop: "profession",
    width:100
  },
  {
    label: "身份证号",
    prop: "identityCard",
    width:200
  },
  {
    label: "年龄",
@@ -118,14 +138,17 @@
  {
    label: "联系电话",
    prop: "phone",
    width:150
  },
  {
    label: "紧急联系人",
    prop: "emergencyContact",
    width: 120
  },
  {
    label: "联系电话",
    prop: "emergencyContactPhone",
    width:150
  },
  {
    label: "合同年限",
@@ -134,10 +157,12 @@
  {
    label: "合同开始日期",
    prop: "contractStartTime",
    width: 120
  },
  {
    label: "合同结束日期",
    prop: "contractEndTime",
    width: 120
  },
  {
    dataType: "action",
@@ -161,11 +186,25 @@
const page = reactive({
  current: 1,
  size: 100,
  total: 0,
});
const total = ref(0);
const formDia = ref()
const { proxy } = getCurrentInstance()
const handleDateChange = (value,type) => {
  searchForm.value.entryDateEnd = null
  searchForm.value.entryDateStart = null
  if(type === 1){
    if (value) {
      searchForm.value.entryDateStart = dayjs(value).format("YYYY-MM-DD");
    }
  }else{
    if (value) {
      searchForm.value.entryDateEnd = dayjs(value).format("YYYY-MM-DD");
    }
  }
  getList();
};
// 查询列表
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -182,7 +221,7 @@
  staffJoinListPage({...page, ...searchForm.value, staffState: 1}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    total.value = res.data.total;
    page.total = res.data.total;
  }).catch(err => {
    tableLoading.value = false;
  })