2023-08-02 20:04:26 +08:00

131 lines
4.3 KiB
Vue

<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>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="用户编号" prop="id" show-overflow-tooltip />
<el-table-column label="用户名" prop="name" show-overflow-tooltip />
<el-table-column label="联系方式" prop="phone" show-overflow-tooltip />
<el-table-column label="地址" show-overflow-tooltip>
<template #default="{ row }">
<!-- <dict-value :options="dictData.show_status" :value="row.status" /> -->
{{
row.area_name +
row.street_name +
row.village_name +
row.brigade_name
}}
</template>
</el-table-column>
<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>
<router-link :to="{
path: 'user/user_informationgdetil',
query: {
id: row.id,
},
}">
详情
</router-link>
</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 { fileManagelist, fileManageDetil } from "@/api/informationg";
import { getRoutePath } from "@/router";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
// import { getRoutePath } from "router";
import EditPopup from "./editCate.vue";
console.log(getRoutePath);
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: fileManagelist,
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>