maven
12 小时以前 c1b5f6edeacfa0326931d06de6773b936dbabe27
src/views/personnelManagement/contractManagement/components/formDia.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,87 @@
<template>
  <div>
    <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>
  </div>
</template>
<script setup>
import {ref} from "vue";
import {staffOnJobInfo} from "@/api/personnelManagement/employeeRecord.js";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
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') {
    staffOnJobInfo({staffNo: row.staffNo}).then(res => {
      tableData.value = res.data
    })
  }
  // if (operationType.value === 'edit') {
  //   tableLoading.value = true; // æ·»åŠ åŠ è½½çŠ¶æ€
  //   staffOnJobInfo({staffNo: row.staffNo}).then(res => {
  //     tableLoading.value = false;
  //     // å°†å¯¹è±¡æ•°æ®è½¬æ¢ä¸ºæ•°ç»„格式
  //     tableData.value = [res.data];
  //   }).catch(err => {
  //     tableLoading.value = false;
  //     console.error('获取详情失败:', err);
  //     proxy.$modal.msgError('获取详情数据失败');
  //   })
  // }
}
// å…³é—­å¼¹æ¡†
const closeDia = () => {
  dialogFormVisible.value = false;
  emit('close')
};
defineExpose({
  openDialog,
});
</script>
<style scoped>
</style>