档案管理页面完成
This commit is contained in:
parent
ffba326409
commit
d0d0851358
@ -27,14 +27,14 @@
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option label="假勤" value="1"></el-option>
|
||||
<el-option label="行政" value="2"></el-option>
|
||||
<el-option label="财务" value="3"></el-option>
|
||||
<el-option label="人事" value="3"></el-option>
|
||||
<el-option label="其他" value="3"></el-option>
|
||||
<el-option label="报销" value="3"></el-option>
|
||||
<el-option label="发票" value="3"></el-option>
|
||||
<el-option label="合同" value="3"></el-option>
|
||||
<el-option label="假勤" :value="1"></el-option>
|
||||
<el-option label="行政" :value="2"></el-option>
|
||||
<el-option label="财务" :value="3"></el-option>
|
||||
<el-option label="人事" :value="3"></el-option>
|
||||
<el-option label="其他" :value="3"></el-option>
|
||||
<el-option label="报销" :value="3"></el-option>
|
||||
<el-option label="发票" :value="3"></el-option>
|
||||
<el-option label="合同" :value="3"></el-option>
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
@ -67,15 +67,10 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="流程类型"
|
||||
prop="check_type"
|
||||
prop="flow_detail.check_type"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<!-- <el-select v-model="formData.check_type">
|
||||
<el-option label="固定审批" value="1"></el-option>
|
||||
<el-option label="授权审批人" value="2"></el-option>
|
||||
<el-option label="可回退审批" value="3"></el-option>
|
||||
</el-select> -->
|
||||
<el-radio-group
|
||||
v-model="formData.flow_detail.type"
|
||||
@change="checkTypeFn"
|
||||
@ -107,7 +102,7 @@
|
||||
<el-form-item label="指定人员">
|
||||
<el-input
|
||||
clearable
|
||||
v-model="item.user.name"
|
||||
v-model="item.user[0].name"
|
||||
placeholder="指定人员"
|
||||
@click="test(index)"
|
||||
/>
|
||||
@ -148,7 +143,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="指定人员">
|
||||
<el-input
|
||||
v-model="item.user.name"
|
||||
v-model="item.user[0].name"
|
||||
@click="test(index)"
|
||||
clearable
|
||||
placeholder="指定人员"
|
||||
@ -245,11 +240,11 @@ const formData = reactive({
|
||||
// },
|
||||
|
||||
id: "",
|
||||
name: "4444",
|
||||
check_type: 1,
|
||||
type: "1",
|
||||
flow_cate: "6",
|
||||
remark: "666666",
|
||||
name: "",
|
||||
check_type: "",
|
||||
type: "",
|
||||
flow_cate: "",
|
||||
remark: "",
|
||||
// admin_id: "",
|
||||
flow_detail: {
|
||||
type: 1,
|
||||
@ -261,7 +256,7 @@ const formData = reactive({
|
||||
// flowName: [""],
|
||||
// flowUnamesB: [""],
|
||||
// flowUidsB: [],
|
||||
copy_to: [{ id: "", name: "4524545" }],
|
||||
copy_to: [{ id: "", name: "" }],
|
||||
});
|
||||
//单选框改变时清空单选下的表单数据
|
||||
const checkTypeFn = () => {
|
||||
@ -318,34 +313,32 @@ function customEvent(data: any) {
|
||||
formData.copy_to[0].id = data.id;
|
||||
formData.copy_to[0].name = data.name;
|
||||
} else {
|
||||
formData.flow_detail.step[i].user.id = data.id;
|
||||
formData.flow_detail.step[i].user.name = data.name;
|
||||
formData.flow_detail.step[i].user[0].id = data.id;
|
||||
formData.flow_detail.step[i].user[0].name = data.name;
|
||||
}
|
||||
i = -1;
|
||||
}
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
let res = await apiFlowDetil(data.id);
|
||||
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = res[key];
|
||||
}
|
||||
}
|
||||
console.log(formData);
|
||||
formData.flow_detail.type = Number(formData.flow_detail.type);
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFlowDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
// const data = await apiFlowDetail({
|
||||
// id: row.id,
|
||||
// });
|
||||
// setFormData(data);
|
||||
};
|
||||
const a = {};
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
console.log(formData);
|
||||
await formRef.value?.validate();
|
||||
mode.value == "edit"
|
||||
? await apiFlowCreat(formData)
|
||||
|
@ -36,11 +36,25 @@
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<!-- <el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status == 1" style="color: #67c23a">正常</span>
|
||||
<span v-else style="color: #fe0000">禁用</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="账号状态"
|
||||
min-width="100"
|
||||
v-perms="['auth.admin/edit']"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="changeStatus(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
@ -86,7 +100,7 @@
|
||||
<script lang="ts" setup name="flowTypeLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCateLists } from "@/api/examined";
|
||||
import { apiCateLists, apiCateStatus } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
// import { getRoutePath } from "router";
|
||||
@ -144,6 +158,9 @@ const handleDelete = async (id: number | any[]) => {
|
||||
await apiFlowTypeDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
// 状态
|
||||
const changeStatus = (row: any) => {
|
||||
apiCateStatus({ id: row.id, status: row.status });
|
||||
};
|
||||
getLists();
|
||||
</script>
|
||||
|
@ -111,11 +111,26 @@
|
||||
prop="admin_id"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<!-- <el-table-column label="状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status == 1">启用</span>
|
||||
<span v-if="row.status == 0">禁用</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="账号状态"
|
||||
min-width="100"
|
||||
v-perms="['auth.admin/edit']"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-if="row.root != 1"
|
||||
v-model="row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="changeStatus(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="删除人ID"
|
||||
@ -161,7 +176,7 @@
|
||||
<script lang="ts" setup name="flowLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiFlowLists, apiFlowDetil } from "@/api/examined";
|
||||
import { apiFlowLists, apiFlowDetil, apiFlowStatus } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./editFlow.vue";
|
||||
@ -216,6 +231,11 @@ const handleEdit = async (data: any) => {
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
// 状态
|
||||
const changeStatus = (row: any) => {
|
||||
console.log(row.status);
|
||||
apiFlowStatus({ id: row.id, status: row.status });
|
||||
};
|
||||
|
||||
// 删除
|
||||
// const handleDelete = async (id: number | any[]) => {
|
||||
|
2408
src/views/fileManagement/detil.vue
Normal file
2408
src/views/fileManagement/detil.vue
Normal file
File diff suppressed because it is too large
Load Diff
126
src/views/fileManagement/editCate.vue
Normal file
126
src/views/fileManagement/editCate.vue
Normal file
@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="84px">
|
||||
<el-col class="pt-6 !border-none">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="名称" prop="title">
|
||||
<el-input
|
||||
v-model="formData.title"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="标识" prop="name">
|
||||
<el-input
|
||||
v-model="formData.name"
|
||||
placeholder="请输入审批类型标识"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="图标" prop="icon">
|
||||
<el-input
|
||||
v-model="formData.icon"
|
||||
placeholder="请输入审批类型图标"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowTypeEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiCateCreat } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import type { PropType } from "vue";
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "编辑审批类型" : "新增审批类型";
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: "",
|
||||
type: "",
|
||||
title: "",
|
||||
name: "",
|
||||
icon: "",
|
||||
department_ids: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiFlowTypeDetail({
|
||||
id: row.id,
|
||||
});
|
||||
setFormData(data);
|
||||
};
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
const data = { ...formData };
|
||||
mode.value == "edit" ? await apiCateCreat(data) : await apiCateCreat(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = "add") => {
|
||||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit("close");
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail,
|
||||
});
|
||||
</script>
|
171
src/views/fileManagement/index.vue
Normal file
171
src/views/fileManagement/index.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-form class="mb-[-16px]" inline>
|
||||
<el-form-item label="公司名称" prop="company_id">
|
||||
<el-input class="w-[280px]" clearable placeholder="请输入公司" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同类型" prop="contract_type">
|
||||
<el-input class="w-[280px]" clearable placeholder="请输入合同类型" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">查询</el-button>
|
||||
<el-button>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button v-perms="['flow_type/add']" type="primary" @click="">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
label="用户编号"
|
||||
prop="title"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="用户名"
|
||||
prop="department"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系方式"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="地址"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="所属生产队队长"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="所属镇管理"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="所属区域经理"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="最近更新时间"
|
||||
prop="type_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="auto"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['flow/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['flow/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="flowTypeLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCateLists, apiCateStatus } from "@/api/examined";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
// import { getRoutePath } from "router";
|
||||
import EditPopup from "./editCate.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
type: "",
|
||||
title: "",
|
||||
name: "",
|
||||
icon: "",
|
||||
department_ids: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCateLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiFlowTypeDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
// 状态
|
||||
const changeStatus = (row: any) => {
|
||||
apiCateStatus({ id: row.id, status: row.status });
|
||||
};
|
||||
getLists();
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user