liding
118 分钟以前 382531132fc829de0b6b24e0aab90a13ab259d64
src/views/personnelManagement/contractManagement/components/formDia.vue
@@ -1,73 +1,93 @@
<template>
  <div>
    <el-dialog
        v-model="dialogFormVisible"
        title="详情"
        width="70%"
        @close="closeDia"
    >
      <PIMTable
          rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :tableLoading="tableLoading"
          height="600"
      ></PIMTable>
    <el-dialog v-model="dialogFormVisible"
               title="详情"
               width="70%"
               @close="closeDia">
      <PIMTable rowKey="id"
                :column="tableColumn"
                :tableData="tableData"
                :tableLoading="tableLoading"
                height="600"></PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
    <FileList v-if="fileDialogVisible"
              v-model:visible="fileDialogVisible"
              :record-type="'staff_contract'"
              :record-id="recordId" />
  </div>
</template>
<script setup>
import {ref} from "vue";
import {staffOnJobInfo} from "@/api/personnelManagement/employeeRecord.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['confirm'])
  import { ref, defineAsyncComponent, getCurrentInstance } from "vue";
  import { findStaffContractListPage } from "@/api/personnelManagement/staffContract.js";
  const FileList = defineAsyncComponent(() =>
    import("@/components/Dialog/FileList.vue")
  );
  const { proxy } = getCurrentInstance();
  const emit = defineEmits(["close"]);
  const fileDialogVisible = ref(false);
  const recordId = ref(0);
  const dialogFormVisible = ref(false);
  const operationType = ref("");
  const tableColumn = ref([
    {
      label: "合同年限",
      prop: "contractTerm",
    },
    {
      label: "合同开始日期",
      prop: "contractStartTime",
    },
    {
      label: "合同结束日期",
      prop: "contractEndTime",
    },
    {
      dataType: "action",
      label: "操作",
      align: "center",
      fixed: "right",
      width: 120,
      operation: [
        {
          name: "附件",
          type: "text",
          clickFun: row => {
            recordId.value = row.id;
            fileDialogVisible.value = true;
          },
        },
      ],
    },
  ]);
  const tableData = ref([]);
  const tableLoading = ref(false);
const dialogFormVisible = ref(false);
const operationType = ref('')
const tableColumn = ref([
  {
    label: "合同年限",
    prop: "contractTerm",
  },
  {
    label: "合同开始日期",
    prop: "contractStartTime",
  },
  {
    label: "合同结束日期",
    prop: "contractEndTime",
  },
]);
const tableData = ref([]);
const tableLoading = ref(false);
  // 打开弹框
  const openDialog = (type, row) => {
    operationType.value = type;
    dialogFormVisible.value = true;
    if (operationType.value === "edit") {
      findStaffContractListPage({ staffOnJobId: row.id }).then(res => {
        tableData.value = res.data.records;
      });
    }
  };
// 打开弹框
const openDialog = (type, row) => {
  operationType.value = type;
  dialogFormVisible.value = true;
  if (operationType.value === 'edit') {
    staffOnJobInfo({staffNo: row.staffNo}).then(res => {
      tableData.value = res.data
    })
  }
}
// 关闭弹框
const closeDia = () => {
  dialogFormVisible.value = false;
  emit('close')
};
defineExpose({
  openDialog,
});
  // 关闭弹框
  const closeDia = () => {
    dialogFormVisible.value = false;
    emit("close");
  };
  defineExpose({
    openDialog,
  });
</script>
<style scoped>
</style>