This commit is contained in:
weipengfei 2023-08-28 13:42:27 +08:00
parent d0b6b584b9
commit 2f89d580ba
2 changed files with 145 additions and 0 deletions

View File

@ -0,0 +1,102 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="负责人名称" prop="name">
<el-input
class="w-[280px]"
v-model="queryParams.name"
clearable
placeholder="请输入负责人名称"
/>
</el-form-item>
<el-form-item label="请选择负责人角色" prop="role_id">
<el-select class="w-[280px]" v-model="queryParams.role_id">
<el-option label="全部" value />
<el-option
v-for="(item, index) in optionsData.role"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
<el-table-column label="账号" prop="account" min-width="120" />
<el-table-column label="名称" prop="name" min-width="100" />
<el-table-column
label="角色"
prop="role_name"
min-width="140"
show-tooltip-when-overflow
/>
<el-table-column
label="部门"
prop="dept_name"
min-width="100"
show-tooltip-when-overflow
/>
<el-table-column
label="创建时间"
prop="create_time"
min-width="180"
/>
<el-table-column
label="最近登录时间"
prop="login_time"
min-width="180"
/>
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from "@/hooks/usePaging";
import { roleAll } from "@/api/perms/role";
import { useDictData, useDictOptions } from "@/hooks/useDictOptions";
import { adminLists } from "@/api/perms/admin";
import Popup from "@/components/popup/index.vue";
import { defineEmits } from "vue";
const { optionsData } = useDictOptions<{
role: any[];
}>({
role: {
api: roleAll,
},
});
//
const queryParams = reactive({
name: "",
role_id: "",
});
//
const emits = defineEmits(["customEvent"]);
//
const handleCurrentChange = (value: any) => {
emits("customEvent", value);
};
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: adminLists,
params: queryParams,
});
getLists();
</script>

View File

@ -65,6 +65,18 @@
:value="formData.extend?.terminus?.address"
/>
</el-form-item>
<el-form-item
v-if="formData.type == 35"
label="负责人"
prop="task_admin"
@click="clickTaskAdmin"
>
<el-input
placeholder="请选择负责人"
readonly
v-model="formData.task_admin_name"
/>
</el-form-item>
<el-form-item label="阶段类型" prop="types">
<el-select
v-model="formData.types"
@ -155,6 +167,14 @@
@success="setMap"
@close=""
></taskMap>
<el-dialog
v-model="personnelShow"
ref="personnelRef"
title="选择负责人"
width="60%"
>
<personnelPopup @custom-event="changePersonner"></personnelPopup>
</el-dialog>
</popup>
</div>
</template>
@ -171,6 +191,7 @@ import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { dictDataLists } from "@/api/setting/dict";
import taskMap from "./map.vue";
import personnelPopup from "./dialog_index_personnel.vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
@ -204,6 +225,8 @@ const formData = reactive({
money_two: 0, //
money_three: 0, //
types: "", //
task_admin: "", //
task_admin_name: "", //
extend: {
// origin: {
// address: "",
@ -264,6 +287,13 @@ const formRules = reactive<any>({
trigger: ["blur"],
},
],
task_admin: [
{
required: true,
message: "请选择负责人",
trigger: ["blur"],
},
],
"extend.origin.address": [
{
required: true,
@ -349,6 +379,19 @@ const setMap = (e: any) => {
formData.extend[mapType.value] = e[0];
};
//
const personnelShow = ref(false);
const personnelRef = shallowRef<InstanceType<typeof personnelPopup>>();
const changePersonner = (e: any) => {
formData.task_admin = e.id;
formData.task_admin_name = e.name;
personnelShow.value = false;
};
const clickTaskAdmin = async () => {
personnelShow.value = true;
};
//
const handleSubmit = async () => {
await formRef.value?.validate();