zhangwencui
5 天以前 332eb3d94ead893f48348fdaab13f61ce9703a5f
合同管理的附件上传功能
已修改2个文件
118 ■■■■ 文件已修改
src/views/officeProcessAutomation/HrManage/staff-contract/components/formDia.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/contractManagement/components/formDia.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/officeProcessAutomation/HrManage/staff-contract/components/formDia.vue
@@ -1,37 +1,39 @@
<template>
  <div>
    <el-dialog
        v-model="dialogFormVisible"
    <el-dialog v-model="dialogFormVisible"
        title="详情"
        width="70%"
        @close="closeDia"
    >
      <PIMTable
          rowKey="id"
               @close="closeDia">
      <PIMTable rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :tableLoading="tableLoading"
          height="600"
      ></PIMTable>
                height="600"></PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
    <Files ref="filesDia"></Files>
    <FileList v-if="fileDialogVisible"
              v-model:visible="fileDialogVisible"
              :record-type="'staff_contract'"
              :record-id="recordId" />
  </div>
</template>
<script setup>
import {ref} from "vue";
  import { ref, defineAsyncComponent, getCurrentInstance } from "vue";
import {findStaffContractListPage} from "@/api/personnelManagement/staffContract.js";
const Files = defineAsyncComponent(() => import( "@/views/personnelManagement/contractManagement/filesDia.vue"));
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const filesDia = ref()
  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 operationType = ref("");
const tableColumn = ref([
  {
    label: "合同年限",
@@ -49,16 +51,17 @@
    dataType: "action",
    label: "操作",
    align: "center",
    fixed: 'right',
      fixed: "right",
    width: 120,
    operation: [
      {
        name: "上传附件",
          name: "附件",
        type: "text",
        clickFun: (row) => {
          filesDia.value.openDialog( row,'合同')
          clickFun: row => {
            recordId.value = row.id;
            fileDialogVisible.value = true;
        },
      }
        },
    ],
  },
]);
@@ -69,22 +72,17 @@
const openDialog = (type, row) => {
  operationType.value = type;
  dialogFormVisible.value = true;
  if (operationType.value === 'edit') {
    if (operationType.value === "edit") {
    findStaffContractListPage({staffOnJobId: row.id}).then(res => {
      tableData.value = res.data.records
    })
        tableData.value = res.data.records;
      });
  }
}
const openUploadFile = (row) => {
  filesDia.value.open = true
  filesDia.value.row = row
}
  };
// 关闭弹框
const closeDia = () => {
  dialogFormVisible.value = false;
  emit('close')
    emit("close");
};
defineExpose({
  openDialog,
@@ -92,5 +90,4 @@
</script>
<style scoped>
</style>
src/views/personnelManagement/contractManagement/components/formDia.vue
@@ -1,37 +1,39 @@
<template>
  <div>
    <el-dialog
        v-model="dialogFormVisible"
    <el-dialog v-model="dialogFormVisible"
        title="详情"
        width="70%"
        @close="closeDia"
    >
      <PIMTable
          rowKey="id"
               @close="closeDia">
      <PIMTable rowKey="id"
          :column="tableColumn"
          :tableData="tableData"
          :tableLoading="tableLoading"
          height="600"
      ></PIMTable>
                height="600"></PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
    </el-dialog>
    <Files ref="filesDia"></Files>
    <FileList v-if="fileDialogVisible"
              v-model:visible="fileDialogVisible"
              :record-type="'staff_contract'"
              :record-id="recordId" />
  </div>
</template>
<script setup>
import {ref} from "vue";
  import { ref, defineAsyncComponent, getCurrentInstance } from "vue";
import {findStaffContractListPage} from "@/api/personnelManagement/staffContract.js";
const Files = defineAsyncComponent(() => import( "@/views/personnelManagement/contractManagement/filesDia.vue"));
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const filesDia = ref()
  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 operationType = ref("");
const tableColumn = ref([
  {
    label: "合同年限",
@@ -49,16 +51,17 @@
    dataType: "action",
    label: "操作",
    align: "center",
    fixed: 'right',
      fixed: "right",
    width: 120,
    operation: [
      {
        name: "上传附件",
          name: "附件",
        type: "text",
        clickFun: (row) => {
          filesDia.value.openDialog( row,'合同')
          clickFun: row => {
            recordId.value = row.id;
            fileDialogVisible.value = true;
        },
      }
        },
    ],
  },
]);
@@ -69,22 +72,17 @@
const openDialog = (type, row) => {
  operationType.value = type;
  dialogFormVisible.value = true;
  if (operationType.value === 'edit') {
    if (operationType.value === "edit") {
    findStaffContractListPage({staffOnJobId: row.id}).then(res => {
      tableData.value = res.data.records
    })
        tableData.value = res.data.records;
      });
  }
}
const openUploadFile = (row) => {
  filesDia.value.open = true
  filesDia.value.row = row
}
  };
// 关闭弹框
const closeDia = () => {
  dialogFormVisible.value = false;
  emit('close')
    emit("close");
};
defineExpose({
  openDialog,
@@ -92,5 +90,4 @@
</script>
<style scoped>
</style>