This commit is contained in:
mkm 2023-08-12 16:05:13 +08:00
parent 434165994b
commit efd4824abd
9 changed files with 955 additions and 1076 deletions

View File

@ -1,25 +1,14 @@
import request from "@/utils/request";
//任务详情
export function apiTaskView(params: any) {
return request.get({ url: "/task/view", params });
}
//任务列表
export function apiTaskIndex(params: any) {
return request.get({ url: "/task/index", params });
}
//添加和修改
export function apiTaskCreat(params: any) {
return request.post({ url: "/task/create", params });
}
import request from '@/utils/request'
//添加任务
export function apiTaskAdd(params: any) {
return request.post({ url: "/task.task/add", params });
return request.post({ url: '/task_scheduling_plan.task_scheduling_plan/add', params })
}
//任务日程-列表
//任务日程-列表
export function apiTaskList(params: any) {
return request.get({ url: "/task_scheduling_plan.task_scheduling_plan/lists", params });
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/lists', params })
}
//任务日程-详情
export function apiTaskDetails(params: any) {
return request.get({ url: "/task_scheduling_plan.task_scheduling_plan/detail", params });
return request.get({ url: '/task_scheduling_plan.task_scheduling_plan/detail', params })
}

View File

@ -1,143 +1,124 @@
<template>
<div class="admin">
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="formData" inline>
<el-form-item label="管理员名称">
<el-input
v-model="formData.name"
class="w-[280px]"
clearable
@keyup.enter="resetPage"
/>
</el-form-item>
<el-form-item label="管理员角色">
<el-select class="w-[280px]" v-model="formData.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>
<export-data
class="ml-2.5"
:fetch-fun="adminLists"
:params="formData"
:page-size="pager.size"
/>
</el-form-item>
</el-form>
</el-card>
<el-card v-loading="pager.loading" class="mt-4 !border-none" shadow="never">
<el-button v-perms="['auth.admin/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" size="large">
<el-table-column label="ID" prop="id" min-width="60" />>
<el-table-column label="头像" min-width="100">
<template #default="{ row }">
<el-avatar :size="50" :src="row.avatar"></el-avatar>
</template>
</el-table-column>
<el-table-column label="姓名" prop="name" min-width="100" />
<el-table-column label="联系方式" prop="account" min-width="130" />
<el-table-column
label="隶属公司"
prop="company.company_name"
min-width="120"
align="center"
>
<template #default="{ row }">
{{ row.company.company_name || "/" }}
</template>
</el-table-column>
<el-table-column
label="所在乡镇"
prop="street_name"
min-width="120"
/>
<el-table-column label="授权身份" prop="role_name" min-width="120" />
<el-table-column
label="是否签约"
prop="is_contract"
align="center"
min-width="120"
>
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a"
>已签约</span
>
<span v-else style="color: #fe0000">未签约</span>
</template>
</el-table-column>
<el-table-column
label="最近登录时间"
prop="login_time"
min-width="180"
/>
<el-table-column
label="创建时间"
prop="create_time"
min-width="180"
align="center"
/>
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
<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.disable"
:active-value="0"
:inactive-value="1"
@change="changeStatus(row)"
/>
</template>
</el-table-column>
<div class="admin">
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="formData" inline>
<el-form-item label="管理员名称">
<el-input
v-model="formData.name"
class="w-[280px]"
clearable
@keyup.enter="resetPage"
/>
</el-form-item>
<el-form-item label="管理员角色">
<el-select class="w-[280px]" v-model="formData.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>
<export-data
class="ml-2.5"
:fetch-fun="adminLists"
:params="formData"
:page-size="pager.size"
/>
</el-form-item>
</el-form>
</el-card>
<el-card v-loading="pager.loading" class="mt-4 !border-none" shadow="never">
<el-button v-perms="['auth.admin/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" size="large">
<el-table-column label="ID" prop="id" min-width="60" />>
<el-table-column label="头像" min-width="100">
<template #default="{ row }">
<el-avatar :size="50" :src="row.avatar"></el-avatar>
</template>
</el-table-column>
<el-table-column label="姓名" prop="name" min-width="100" />
<el-table-column label="联系方式" prop="account" min-width="130" />
<el-table-column
label="隶属公司"
prop="company.company_name"
min-width="120"
align="center"
>
<template #default="{ row }">
{{ row.company.company_name || '/' }}
</template>
</el-table-column>
<el-table-column label="所在乡镇" prop="street_name" min-width="120" />
<el-table-column label="授权身份" prop="role_name" min-width="120" />
<el-table-column
label="是否签约"
prop="is_contract"
align="center"
min-width="120"
>
<template #default="{ row }">
<span v-if="row.is_contract == 1" style="color: #67c23a">已签约</span>
<span v-else style="color: #fe0000">未签约</span>
</template>
</el-table-column>
<el-table-column label="最近登录时间" prop="login_time" min-width="180" />
<el-table-column
label="创建时间"
prop="create_time"
min-width="180"
align="center"
/>
<el-table-column label="最近登录IP" prop="login_ip" min-width="120" />
<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.disable"
:active-value="0"
:inactive-value="1"
@change="changeStatus(row)"
/>
</template>
</el-table-column>
<el-table-column
label="操作"
width="230"
align="center"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button
v-perms="['auth.admin/view']"
type="primary"
link
@click="handleView(row)"
>查看</el-button
>
<el-button
v-perms="['auth.admin/edit']"
type="primary"
link
@click="handleEdit(row)"
>编辑</el-button
>
<el-button
v-if="row.root != 1"
v-perms="['auth.admin/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>删除</el-button
>
<!-- <el-button
<el-table-column label="操作" width="230" align="center" fixed="right">
<template #default="{ row }">
<div style="display: flex">
<el-button
v-perms="['auth.admin/view']"
type="primary"
link
@click="handleView(row)"
>查看</el-button
>
<el-button
v-perms="['auth.admin/edit']"
type="primary"
link
@click="handleEdit(row)"
>编辑</el-button
>
<el-button
v-if="row.root != 1"
v-perms="['auth.admin/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>删除</el-button
>
<!-- <el-button
v-if="row.is_contract == 1"
v-perms="['auth.admin/abolition']"
type="danger"
@ -145,7 +126,7 @@
@click="handleAbolition(row.id)"
>废除合同</el-button
> -->
<!-- <template v-if="row.company_id != 0 && row.is_contract == 0">
<!-- <template v-if="row.company_id != 0 && row.is_contract == 0">
<el-button
v-perms="['auth.admin/Draftingcontracts']"
type="primary"
@ -165,188 +146,182 @@
>重新短信</el-button
>
</template> -->
</div>
</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"
:isCheck="isCheck"
@success="getLists"
@close="showEdit = false"
/>
<el-dialog v-model="showPop" @close="offPop">
<h1>重要提醒</h1>
<div class="content" v-if="showConctactPop">
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button
type="primary"
size="large"
v-if="showConctactPop"
@click="creContct"
>确认创建</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg"
>确认</el-button
>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
</div>
</div>
</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"
:isCheck="isCheck"
@success="getLists"
@close="showEdit = false"
/>
<el-dialog v-model="showPop" @close="offPop">
<h1>重要提醒</h1>
<div class="content" v-if="showConctactPop">
请确认信息是否有误,发送合同,请确认信息是否有误,发送电子合同后短时间内将不可再次发送.
</div>
<div class="content" v-else>
确认签约短信将在60秒后发送,请注意查收,并点击短信链接进行线上合同签约
</div>
<p class="btn_menu">
<el-button type="primary" size="large" v-if="showConctactPop" @click="creContct"
>确认创建</el-button
>
<el-button type="primary" size="large" v-else @click="sendMsg">确认</el-button>
<el-button type="info" size="large" @click="offPop">返回</el-button>
</p>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="admin">
import {
adminEdit,
adminLists,
adminDelete,
generateGontract,
sendMsgApi,
abolition,
} from "@/api/perms/admin";
import { roleAll } from "@/api/perms/role";
import { useDictOptions } from "@/hooks/useDictOptions";
import { usePaging } from "@/hooks/usePaging";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const route = useRoute();
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
adminEdit,
adminLists,
adminDelete,
generateGontract,
sendMsgApi,
abolition
} from '@/api/perms/admin'
import { roleAll } from '@/api/perms/role'
import { useDictOptions } from '@/hooks/useDictOptions'
import { usePaging } from '@/hooks/usePaging'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const route = useRoute()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const formData = reactive({
name: "",
role_id: "",
company_id: "",
});
const contractId = ref("");
name: '',
role_id: '',
company_id: ''
})
const contractId = ref('')
//
const showPop = ref(false);
const showConctactPop = ref(false);
const showPop = ref(false)
const showConctactPop = ref(false)
const offPop = () => {
showPop.value = false;
showConctactPop.value = false;
};
showPop.value = false
showConctactPop.value = false
}
const creContct = () => {
// feedback.msgSuccess("");
generateGontract({ id: contractId.value }).then(() => {
feedback.msgSuccess("发送成功");
});
offPop();
};
// feedback.msgSuccess("");
generateGontract({ id: contractId.value }).then(() => {
feedback.msgSuccess('发送成功')
})
offPop()
}
const sendMsg = () => {
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess("发送成功");
});
offPop();
};
sendMsgApi({ id: contractId.value }).then((res) => {
feedback.msgSuccess('发送成功')
})
offPop()
}
//
const showEdit = ref(false);
const showEdit = ref(false)
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: adminLists,
params: formData,
});
fetchFun: adminLists,
params: formData
})
const changeStatus = (data: any) => {
adminEdit({
id: data.id,
account: data.account,
name: data.name,
role_id: data.role_id,
disable: data.disable,
multipoint_login: data.multipoint_login,
}).finally(() => {
getLists();
});
};
adminEdit({
id: data.id,
account: data.account,
name: data.name,
role_id: data.role_id,
disable: data.disable,
multipoint_login: data.multipoint_login
}).finally(() => {
getLists()
})
}
//
const isCheck = ref(false);
const isCheck = ref(false)
const handleCheck = async (data: any) => {
isCheck.value = true;
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
isCheck.value = true
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
const handleAdd = async () => {
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
const handleEdit = async (data: any) => {
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
const handleView = async (data: any) => {
isCheck.value = false;
showEdit.value = true;
await nextTick();
editRef.value?.open("view");
editRef.value?.setFormData(data);
};
isCheck.value = false
showEdit.value = true
await nextTick()
editRef.value?.open('view')
editRef.value?.setFormData(data)
}
const handleDelete = async (id: number) => {
await feedback.confirm("确定要删除?");
await adminDelete({ id });
getLists();
};
await feedback.confirm('确定要删除?')
await adminDelete({ id })
getLists()
}
const handleAbolition = async (id: number) => {
await feedback.confirm("确定要废除合同?");
await abolition({ id });
getLists();
};
await feedback.confirm('确定要废除合同?')
await abolition({ id })
getLists()
}
const { optionsData } = useDictOptions<{
role: any[];
role: any[]
}>({
role: {
api: roleAll,
},
});
role: {
api: roleAll
}
})
if (route.query.company_id) {
formData.company_id = route.query.company_id?.toString();
formData.company_id = route.query.company_id?.toString()
}
onMounted(() => {
getLists();
});
getLists()
})
</script>
<style lang="scss" scoped>
h1 {
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
}
.content {
font-size: 20px;
font-size: 20px;
}
.info {
color: red;
font-weight: bold;
font-size: 18px;
display: inline-block;
margin: 0 5px;
color: red;
font-weight: bold;
font-size: 18px;
display: inline-block;
margin: 0 5px;
}
.btn_menu {
margin-top: 10vh;
display: flex;
justify-content: space-around;
margin-top: 10vh;
display: flex;
justify-content: space-around;
}
</style>

View File

@ -1,145 +1,136 @@
<template>
<div>
<el-card class="!border-none" v-loading="loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-calendar v-model="dateValue">
<template #dateCell="{ data }">
<div
style="width: 100%; height: 100%; background-color: aquamarine"
>
<p :class="data.isSelected ? 'is-selected' : ''">
{{ data.day.split("-").slice(1).join("-") }}
<!-- {{ data.isSelected ? '✔️' : '' }} -->
</p>
<div
class="task"
:class="{
fou: item.priority == 4,
tow: item.priority == 2,
the: item.priority == 3,
}"
v-if="taskList[data.day]"
@click="handleEdit(item)"
v-for="(item, index) in taskList[data.day]"
:key="index"
>
{{ item.title }}
</div>
<div>
<el-card class="!border-none" v-loading="loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-calendar v-model="dateValue">
<template #dateCell="{ data }">
<div style="width: 100%; height: 100%; background-color: aquamarine">
<p :class="data.isSelected ? 'is-selected' : ''">
{{ data.day.split('-').slice(1).join('-') }}
<!-- {{ data.isSelected ? '✔️' : '' }} -->
</p>
<div
class="task"
:class="{
fou: item.priority == 4,
tow: item.priority == 2,
the: item.priority == 3
}"
v-if="taskList[data.day]"
@click="handleEdit(item)"
v-for="(item, index) in taskList[data.day]"
:key="index"
>
{{ item.title }}
</div>
</div>
</template>
</el-calendar>
</div>
<!-- <div class="task" style="color: var(--el-color-primary);">完成BUG测试</div>
<div class="task" style="color: var(--el-color-danger);">完成BUG测试</div> -->
</template>
</el-calendar>
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
:dateValue="dateValue"
@success="loadTask"
@close="showEdit = false"
/>
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
:dateValue="dateValue"
@success="loadTask"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="task">
import { useDictData } from "@/hooks/useDictOptions";
import { apiTaskIndex } from "@/api/task";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import { useDictData } from '@/hooks/useDictOptions'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
// import { getRoutePath } from "router";
import EditPopup from "./edit.vue";
import { reactive, watch } from "vue";
import EditPopup from './edit.vue'
import { reactive, watch } from 'vue'
const route = useRoute()
const dateValue = ref(new Date());
const dateValue = ref(new Date())
watch(
() => dateValue,
(newValue, oldValue) => {
initShowDate(timeFormat(newValue.value.getTime()));
},
{ deep: true }
);
() => dateValue,
(newValue, oldValue) => {
initShowDate(timeFormat(newValue.value.getTime()))
},
{ deep: true }
)
const test = (e: any) => {
console.log(e);
};
console.log(e)
}
//
const loading = ref(true);
const loading = ref(true)
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false);
const showEdit = ref(false)
//
const queryParams = reactive({
start_time: "",
end_time: "",
day: 1,
page_no: 1,
pageSize: 150,
});
start_time: '',
end_time: '',
day: 1,
page_no: 1,
pageSize: 150
})
const taskList = ref<any>([]);
const taskList = ref<any>([])
//
const loadTask = async () => {
let res: any = await apiTaskIndex(queryParams);
taskList.value = res.lists;
loading.value = false;
};
const start_date = ref("");
const end_date = ref("");
const start_date = ref('')
const end_date = ref('')
//
const initShowDate = (dateStr = "") => {
const currentDate = dateStr ? new Date(dateStr) : new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth();
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay(); //
const startDay = new Date(currentYear, currentMonth, 1).getDay(); //
// console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
start_date.value = timeFormat(
new Date(currentYear, currentMonth, 1 - startDay).getTime()
); //
end_date.value = timeFormat(
new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()
); //
if (queryParams.start_time != start_date.value) {
queryParams.start_time = start_date.value;
queryParams.end_time = end_date.value;
loading.value = true;
loadTask();
}
};
initShowDate();
const initShowDate = (dateStr = '') => {
const currentDate = dateStr ? new Date(dateStr) : new Date()
const currentYear = currentDate.getFullYear()
const currentMonth = currentDate.getMonth()
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay() //
const startDay = new Date(currentYear, currentMonth, 1).getDay() //
// console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
start_date.value = timeFormat(new Date(currentYear, currentMonth, 1 - startDay).getTime()) //
end_date.value = timeFormat(new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()) //
if (queryParams.start_time != start_date.value) {
queryParams.start_time = start_date.value
queryParams.end_time = end_date.value
loading.value = true
}
}
initShowDate()
//
const { dictData } = useDictData("");
const { dictData } = useDictData('')
//
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
console.log(2232)
showEdit.value = true
await nextTick()
editRef.value?.open('add')
if (route.query.id) {
console.log(22)
const emits = defineEmits(['scheduling_id'])
emits('scheduling_id', route.query.id)
}
}
//
const handleEdit = async (data: any) => {
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
// const handleDelete = async (id: number | any[]) => {
@ -153,25 +144,25 @@ const handleEdit = async (data: any) => {
<style lang="scss">
.is-selected {
color: #1989fa;
color: #1989fa;
}
.el-calendar-table .el-calendar-day {
height: 6.2rem;
height: 6.2rem;
}
.task {
font-size: 0.8rem;
color: #f7ba2a;
white-space: nowrap; /* 设置文本不换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
font-size: 0.8rem;
color: #f7ba2a;
white-space: nowrap; /* 设置文本不换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
}
.the {
color: #ff5100;
color: #ff5100;
}
.tow {
color: #f38200;
color: #f38200;
}
.fou {
color: red;
color: red;
}
</style>

View File

@ -1,203 +1,115 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="创建日程安排"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form class="formdata" :model="detailsdt" label-width="120px">
<el-form-item class="datatime" label="时间日程范围">
<el-date-picker
v-model="datetime"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
</el-form-item>
<el-form-item label="日程内容">
<el-input v-model="detailsdt.task_info.content"/>
</el-form-item>
<el-form-item label="日程描述">
<el-input type="textarea" v-model="detailsdt.task_info.title"/>
</el-form-item>
</el-form>
</popup>
</div>
<div class="edit-popup">
<popup
ref="popupRef"
title="创建日程安排"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form class="formdata" :model="detailsdt" label-width="120px">
<el-form-item class="datatime" label="时间日程范围">
<el-date-picker
v-model="datetime"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
</el-form-item>
<el-form-item label="日程内容">
<el-input v-model="detailsdt.task_info.content" disabled />
</el-form-item>
<el-form-item label="日程描述">
<el-input type="textarea" v-model="detailsdt.task_info.title" disabled />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="taskEidt">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { apiTaskCreat, apiTaskView } from "@/api/task";
import { timeFormat } from "@/utils/util";
import { reactive,onUpdated , type PropType } from "vue";
import DialogIndexMan from "./dialog_index_man.vue";
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { reactive, onUpdated, type PropType } from 'vue'
const props = defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
dateValue: {
type: Date,
default: () => null,
},
detailsdata:{
type:Object,
default:{}
}
});
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
const detailsdt = ref({});
const datetime = ref([]);
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
dateValue: {
type: Date,
default: () => null
},
detailsdata: {
type: Object,
default: {}
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const detailsdt = ref({})
const datetime = ref([])
//
// const popupTitle = computed(() => {
// return mode.value == "edit" ? "" : "";
// });
onUpdated(() => {
watchEffect(()=>{
detailsdt.value=props.detailsdata
const startTime=new Date(props.detailsdata.start_time)
const endTime=new Date(props.detailsdata.end_time)
datetime.value=[startTime,endTime]
})
});
const priorityList = reactive([
{
value: 1,
label: "低",
},
{
value: 2,
label: "中",
},
{
value: 3,
label: "高",
},
{
value: 4,
label: "紧急",
},
]);
const taskTypeList = reactive([
{
value: 0,
label: "测试",
},
{
value: 1,
label: "修复",
},
{
value: 2,
label: "新增",
},
]);
// const timeList = reactive([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24])
onUpdated(() => {
watchEffect(() => {
detailsdt.value = props.detailsdata
const startTime = new Date(props.detailsdata.start_time)
const endTime = new Date(props.detailsdata.end_time)
datetime.value = [startTime, endTime]
})
})
//
const formData = reactive({
id: "",
title: "", //
priority: "", //
type: "", //
is_bug: "", //bug
start_time: "", //
end_time: "", //
check_time: "", //
director_name: "", //
director_uid: "", //id
assist_admin_names: "", //
assist_admin_ids: "", //id
assist_check_names: "", //
assist_check_ids: "", //id
content: "", //
project_id: "", //id
});
id: '',
title: '', //
type: '', //
start_time: '', //
end_time: '', //
check_time: '', //
content: '' //
})
//
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];
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
};
const getDetail = async (id: number) => {
const data = await apiTaskView({
id,
});
setFormData(data.detail);
};
//
const isMan = ref(false);
//
const isManTow = ref(false);
//
const isManThe = ref(false);
function customEvent(data: any) {
isMan.value = false;
formData.director_name = data.name;
formData.director_uid = data.id;
}
function customEventMan(data: any) {
isManTow.value = false;
formData.assist_admin_names = data.name;
formData.assist_admin_ids = data.id;
}
function customEventManThe(data: any) {
isManThe.value = false;
formData.assist_check_names = data.name;
formData.assist_check_ids = data.id;
}
//
// const handleSubmit = async () => {
// const data = { ...formData };
// mode.value == "edit" ? await apiTaskCreat(data) : await apiTaskCreat(data);
// popupRef.value?.close();
// emit("success");
// };
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>
<style lang="scss" scoped>
.formdata{
.el-form-item{
.el-date-picker{
width: 100%;
}
}
emit('close')
}
defineExpose({
open,
setFormData
})
</script>
<style lang="scss" scoped>
.formdata {
.el-form-item {
.el-date-picker {
width: 100%;
}
}
}
</style>

View File

@ -1,93 +1,92 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="创建日程安排"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form class="formdata" :model="detailsdt" label-width="120px">
<el-form-item label="任务日期">
<el-date-picker
v-model="formData.time"
type="date"
placeholder="选择日期"
/>
</el-form-item>
<el-form-item label="任务模板">
<el-input v-model="formData.template_id" />
</el-form-item>
<el-form-item label="任务排期">
<el-input v-model="formData.scheduling_id" />
</el-form-item>
</el-form>
</popup>
</div>
<div class="edit-popup">
<popup
ref="popupRef"
title="创建日程安排"
:async="true"
width="800px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form class="formdata" :model="detailsdt" label-width="120px">
<el-form-item label="任务日期">
<el-date-picker v-model="formData.time" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="任务模板">
<el-input
v-model="formData.template_name"
@click="isShow = true"
clearable
placeholder="请输入任务模板"
/>
</el-form-item>
</el-form>
</popup>
<el-dialog v-model="isShow" title="选择任务" width="60%">
<DialogIndex @customEvent="customEvent" />
</el-dialog>
</div>
</template>
<script lang="ts" setup name="taskEidt">
import type { FormInstance } from "element-plus";
import Popup from "@/components/popup/index.vue";
import { apiTaskCreat, apiTaskView } from "@/api/task";
import { apiTaskTemplateLists } from "@/api/task_template";
import { timeFormat } from "@/utils/util";
import { reactive, onUpdated, type PropType } from "vue";
import DialogIndexMan from "./dialog_index_man.vue";
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiTaskAdd } from '@/api/task'
import { reactive, onUpdated, type PropType } from 'vue'
import DialogIndex from '@/views/task_template/list_two.vue'
const route = useRoute()
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
const detailsdt = ref({});
const datetime = ref([]);
const templateList = ref([]);
const getTemplateList = () => {
apiTaskTemplateLists().then((res) => {
templateList.value = res;
console.log(templateList.value);
});
};
getTemplateList();
const emit = defineEmits(['success', 'close'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const detailsdt = ref({})
const isShow = ref(false)
//
const formData = reactive({
time: "",
template_id: "",
scheduling_id: "",
});
time: '',
template_id: '',
scheduling_id: '',
template_name: ''
})
function customEvent(data: any) {
isShow.value = false
formData.template_id = data.id
formData.template_name = data.title
}
if (route.query.id) {
formData.scheduling_id = route.query.id.toString()
}
//
// const handleSubmit = async () => {
// const data = { ...formData };
// mode.value == "edit" ? await apiTaskCreat(data) : await apiTaskCreat(data);
// popupRef.value?.close();
// emit("success");
// };
const handleSubmit = async () => {
const data = { ...formData }
console.log(data)
mode.value == 'edit' ? await apiTaskAdd(data) : await apiTaskAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit("close");
};
emit('close')
}
defineExpose({
open,
});
open
})
</script>
<style lang="scss" scoped>
.formdata {
.el-form-item {
.el-date-picker {
width: 100%;
.el-form-item {
.el-date-picker {
width: 100%;
}
}
}
}
</style>

View File

@ -1,235 +1,205 @@
<template>
<div>
<el-card class="!border-none" v-loading="loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-calendar v-model="dateValue">
<template #dateCell="{ data }">
<div style="width: 100%; height: 100%">
<p
:class="data.isSelected ? 'is-selected' : ''"
style="padding: 8px 8px 0 8px"
>
{{ data.day.split("-").slice(1).join("-") }}
<!-- {{ data.isSelected ? '✔️' : '' }} -->
</p>
<div>{{ dateNow(data.day) }}</div>
<div
class="task"
:class="{
fou: item.priority == 4,
tow: item.priority == 2,
the: item.priority == 3,
}"
@click="handleEdit(item)"
v-for="(item, index) in taskList"
:key="index"
>
{{ item.title }}
</div>
</div>
<!-- <div class="task" style="color: var(--el-color-primary);">完成BUG测试</div>
<div>
<el-card class="!border-none" v-loading="loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-calendar v-model="dateValue">
<template #dateCell="{ data }">
<div style="width: 100%; height: 100%">
<p
:class="data.isSelected ? 'is-selected' : ''"
style="padding: 8px 8px 0 8px"
>
{{ data.day.split('-').slice(1).join('-') }}
<!-- {{ data.isSelected ? '✔️' : '' }} -->
</p>
<div>{{ dateNow(data.day) }}</div>
<div
class="task"
:class="{
fou: item.priority == 4,
tow: item.priority == 2,
the: item.priority == 3
}"
@click="handleEdit(item)"
v-for="(item, index) in taskList"
:key="index"
>
{{ item.title }}
</div>
</div>
<!-- <div class="task" style="color: var(--el-color-primary);">完成BUG测试</div>
<div class="task" style="color: var(--el-color-danger);">完成BUG测试</div> -->
</template>
</el-calendar>
</div>
</el-card>
</template>
</el-calendar>
</div>
</el-card>
<edit-popup
ref="editRef"
:dict-data="dictData"
:dateValue="dateValue"
:detailsdata="detailsdata"
@success="loadTask"
@close="showEdit = false"
/>
<EditTowPopup
ref="editTowRef"
:dict-data="dictData"
:dateValue="dateValue"
:detailsdata="detailsdata"
@success="loadTask"
@close="showEditTow = false"
/>
</div>
<edit-popup
ref="editRef"
:dict-data="dictData"
:dateValue="dateValue"
:detailsdata="detailsdata"
@success="loadTask"
@close="showEdit = false"
/>
<EditTowPopup
ref="editTowRef"
:dict-data="dictData"
:dateValue="dateValue"
:detailsdata="detailsdata"
@success="loadTask"
@close="showEditTow = false"
/>
</div>
</template>
<script lang="ts" setup name="task">
import { useDictData } from "@/hooks/useDictOptions";
import { apiTaskIndex } from "@/api/task";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
// import { getRoutePath } from "router";
import EditPopup from "./edit.vue";
import EditTowPopup from "./editTow.vue";
import { reactive, watch } from "vue";
import { apiTaskList, apiTaskDetails } from "@/api/task";
import { apiTaskSchedulingPlanAdd } from "@/api/task_scheduling_plan";
const dateValue = ref(new Date());
<script lang="ts" setup name="task">
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
// import { getRoutePath } from "router";
import EditPopup from './edit.vue'
import EditTowPopup from './editTow.vue'
import { reactive, watch } from 'vue'
import { apiTaskList, apiTaskDetails } from '@/api/task'
import { apiTaskSchedulingPlanAdd } from '@/api/task_scheduling_plan'
const route = useRoute()
const dateValue = ref(new Date())
const detailsdata = reactive({
create_time: "",
create_user_id: 0,
delete_time: "",
end_time: "",
extend: "",
id: "",
scheduling_id: "",
sn: "",
start_time: "",
status: "",
task_id: "",
task_info: {
admin_id: 0,
content: "",
create_time: "",
delete_time: "",
id: 0,
money: "",
status: 0,
title: "",
type: 0,
type_name: "",
update_time: "",
},
template_id: 0,
update_time: "",
});
create_time: '',
create_user_id: 0,
delete_time: '',
end_time: '',
extend: '',
id: '',
scheduling_id: '',
sn: '',
start_time: '',
status: '',
task_id: '',
task_info: {
admin_id: 0,
content: '',
create_time: '',
delete_time: '',
id: 0,
money: '',
status: 0,
title: '',
type: 0,
type_name: '',
update_time: ''
},
template_id: 0,
update_time: ''
})
watch(
() => dateValue,
async (newValue, oldValue) => {
const id = taskList.value.find(
(item) =>
item.start_time.split(" ")[0] == timeFormat(newValue.value.getTime())
)?.id;
if (id) {
const res = await apiTaskDetails({ id });
Object.keys(detailsdata).forEach((key) => {
res[key] ? (detailsdata[key] = res[key]) : null;
});
editRef.value?.open("add");
initShowDate(timeFormat(newValue.value.getTime()));
}
},
{ deep: true }
);
() => dateValue,
async (newValue, oldValue) => {
const id = taskList.value.find(
(item) => item.start_time.split(' ')[0] == timeFormat(newValue.value.getTime())
)?.id
if (id) {
const res = await apiTaskDetails({ id })
Object.keys(detailsdata).forEach((key) => {
res[key] ? (detailsdata[key] = res[key]) : null
})
editRef.value?.open('add')
initShowDate(timeFormat(newValue.value.getTime()))
}
},
{ deep: true }
)
//
const loading = ref(true);
const loading = ref(true)
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const editTowRef = shallowRef<InstanceType<typeof EditPopup>>();
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const editTowRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false);
const showEditTow = ref(false);
const showEdit = ref(false)
const showEditTow = ref(false)
//
const queryParams = reactive({
start_time: "",
end_time: "",
page_no: 1,
pageSize: 150,
});
start_time: '',
end_time: '',
page_no: 1,
pageSize: 150
})
const taskList = ref<any>([]);
const taskList = ref<any>([])
//
const loadTask = async () => {
// let res: any = await apiTaskIndex(queryParams);
// taskList.value = res.lists;
apiTaskList(queryParams).then((res) => {
taskList.value = res.lists;
});
loading.value = false;
};
apiTaskList(queryParams).then((res) => {
taskList.value = res.lists
})
loading.value = false
}
const start_date = ref("");
const end_date = ref("");
const start_date = ref('')
const end_date = ref('')
//
const initShowDate = (dateStr = "") => {
const currentDate = dateStr ? new Date(dateStr) : new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth();
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay(); //
const startDay = new Date(currentYear, currentMonth, 1).getDay(); //
// console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
start_date.value = timeFormat(
new Date(currentYear, currentMonth, 1 - startDay).getTime()
); //
end_date.value = timeFormat(
new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()
); //
if (queryParams.start_time != start_date.value) {
queryParams.start_time = start_date.value;
queryParams.end_time = end_date.value;
loading.value = true;
loadTask();
}
};
initShowDate();
const initShowDate = (dateStr = '') => {
const currentDate = dateStr ? new Date(dateStr) : new Date()
const currentYear = currentDate.getFullYear()
const currentMonth = currentDate.getMonth()
const lastDay = new Date(currentYear, currentMonth + 1, 0).getDay() //
const startDay = new Date(currentYear, currentMonth, 1).getDay() //
// console.log(new Date(currentYear, currentMonth, 1-startDay).getDate());
// console.log(new Date(currentYear, currentMonth + 1, 6-lastDay).getDate());
start_date.value = timeFormat(new Date(currentYear, currentMonth, 1 - startDay).getTime()) //
end_date.value = timeFormat(new Date(currentYear, currentMonth + 1, 6 - lastDay).getTime()) //
if (queryParams.start_time != start_date.value) {
queryParams.start_time = start_date.value
queryParams.end_time = end_date.value
loading.value = true
loadTask()
}
}
initShowDate()
const dateNow = (day) => {
return taskList.value.find((item) => item.start_time.split(" ")[0] == day)
?.template_name;
};
//
// const { dictData } = useDictData("");
return taskList.value.find((item) => item.start_time.split(' ')[0] == day)?.template_name
}
//
const handleAdd = async () => {
showEditTow.value = true;
await nextTick();
editTowRef.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();
// };
// getLists();
showEditTow.value = true
await nextTick()
editTowRef.value?.open('add')
}
</script>
<style lang="scss">
<style lang="scss">
.is-selected {
color: #1989fa;
color: #1989fa;
}
.el-calendar-table .el-calendar-day {
height: auto;
min-height: 6.2rem;
padding: 0;
height: auto;
min-height: 6.2rem;
padding: 0;
}
.task {
font-size: 0.8rem;
color: #f7ba2a;
white-space: nowrap; /* 设置文本不换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
font-size: 0.8rem;
color: #f7ba2a;
white-space: nowrap; /* 设置文本不换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 在溢出的部分显示省略号 */
}
.the {
color: #ff5100;
color: #ff5100;
}
.tow {
color: #f38200;
color: #f38200;
}
.fou {
color: red;
color: red;
}
</style>

View File

@ -1,196 +1,157 @@
<template>
<div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<!-- <el-button
<div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['flow_type/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<!-- <el-button
v-perms="['flow_type/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button> -->
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
{{ pager }}
<el-table-column
label="id"
prop="id"
show-overflow-tooltip
width="60"
/>
<el-table-column label="名称" prop="title" show-overflow-tooltip />
<el-table-column
label="优先级"
prop="title"
width="90"
show-overflow-tooltip
>
<template #default="{ row }">
<span
:class="{
one: row.priority == 1,
tow: row.priority == 2,
the: row.priority == 3,
fou: row.priority == 4,
}"
>{{ row.priority_name }}</span
>
</template>
</el-table-column>
<el-table-column
label="负责人"
prop="director_name"
width="90"
show-overflow-tooltip
/>
<el-table-column
label="协作人"
prop="assist_admin_names"
width="90"
show-overflow-tooltip
/>
<el-table-column
label="审查人"
prop="assist_check_names"
width="90"
show-overflow-tooltip
/>
<el-table-column
label="开始时间"
prop="start_time"
show-overflow-tooltip
/>
<el-table-column
label="结束时间"
prop="end_time"
show-overflow-tooltip
/>
<el-table-column
label="审查时间"
prop="check_time"
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="操作"
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>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
{{ pager }}
<el-table-column label="id" prop="id" show-overflow-tooltip width="60" />
<el-table-column label="名称" prop="title" show-overflow-tooltip />
<el-table-column label="优先级" prop="title" width="90" show-overflow-tooltip>
<template #default="{ row }">
<span
:class="{
one: row.priority == 1,
tow: row.priority == 2,
the: row.priority == 3,
fou: row.priority == 4
}"
>{{ row.priority_name }}</span
>
</template>
</el-table-column>
<el-table-column
label="负责人"
prop="director_name"
width="90"
show-overflow-tooltip
/>
<el-table-column
label="协作人"
prop="assist_admin_names"
width="90"
show-overflow-tooltip
/>
<el-table-column
label="审查人"
prop="assist_check_names"
width="90"
show-overflow-tooltip
/>
<el-table-column label="开始时间" prop="start_time" show-overflow-tooltip />
<el-table-column label="结束时间" prop="end_time" show-overflow-tooltip />
<el-table-column label="审查时间" prop="check_time" 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="操作" 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" >
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiTaskIndex } from "@/api/task";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
<script lang="ts">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false);
const showEdit = ref(false)
//
const queryParams = reactive({});
const queryParams = reactive({})
//
const selectData = ref<any[]>([]);
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskIndex,
params: queryParams,
});
const { dictData } = useDictData('')
//
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
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);
};
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();
};
getLists();
await feedback.confirm('确定要删除?')
}
</script>
<style lang="scss">
<style lang="scss">
.one {
color: #f7ba2a;
color: #f7ba2a;
}
.the {
color: #ff5100;
color: #ff5100;
}
.tow {
color: #f38200;
color: #f38200;
}
.fou {
color: red;
color: red;
}
</style>

View File

@ -25,7 +25,7 @@
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<!-- <el-button
<el-button
v-perms="['task_scheduling.task_scheduling/add']"
type="primary"
@click="handleAdd"
@ -35,6 +35,7 @@
</template>
新增
</el-button>
<!--
<el-button
v-perms="['task_scheduling.task_scheduling/delete']"
:disabled="!selectData.length"
@ -52,19 +53,24 @@
prop="company_type_name"
show-overflow-tooltip
/>
<el-table-column label="状态" prop="status" show-overflow-tooltip>
<el-table-column
label="状态"
min-width="100"
v-perms="['task_scheduling.task_scheduling/edit']"
>
<template #default="{ row }">
<span>{{ row.status == '1' ? '开启' : '关闭' }}</span>
<el-switch
v-model="row.status"
:active-value="1"
:inactive-value="0"
@change="changeStatus(row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['task.calendar']"
type="primary"
link
@click="handleCalendar(row)"
>
<el-button v-perms="['task.calendar']" type="primary" link>
<router-link
:to="{
path: getRoutePath('task.calendar'),
@ -75,22 +81,6 @@
>任务日程</router-link
>
</el-button>
<!-- <el-button
v-perms="['task_scheduling.task_scheduling/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button> -->
<!-- <el-button
v-perms="['task_scheduling.task_scheduling/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button> -->
</template>
</el-table-column>
</el-table>
@ -112,7 +102,7 @@
<script lang="ts" setup name="taskSchedulingLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiTaskSchedulingLists, apiTaskSchedulingDelete } from '@/api/task_scheduling'
import { apiTaskSchedulingLists, apiTaskSchedulingEdit } from '@/api/task_scheduling'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
@ -133,11 +123,6 @@ const queryParams = reactive({
status: ''
})
const statusdata = reactive([
{ value: '1', label: '显示' },
{ value: '0', label: '隐藏' }
])
//
const selectData = ref<any[]>([])
@ -161,28 +146,13 @@ const handleAdd = async () => {
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 handleCalendar = 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 apiTaskSchedulingDelete({ id })
getLists()
const changeStatus = (data: any) => {
apiTaskSchedulingEdit({
id: data.id,
status: data.status
}).finally(() => {
getLists()
})
}
dictDataLists({ type_id: 10 }).then((res) => {
datalist.value = res.lists
@ -194,6 +164,7 @@ getLists()
.formtabel {
.el-form-item {
width: 20%;
.el-btn {
margin-left: 100px;
}

View File

@ -0,0 +1,111 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formtabel" :model="queryParams" inline>
<el-form-item label-width="100px" label="主题" prop="title">
<el-input
class="w-[280px]"
v-model="queryParams.title"
clearable
placeholder="请输入主题"
/>
</el-form-item>
<el-form-item label-width="100px" label="">
<el-button class="el-btn" 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="handleSelectionChange">
<el-table-column label="主题" prop="title" show-overflow-tooltip />
<el-table-column label="创建人" prop="admin_name" show-overflow-tooltip />
<el-table-column label="金额" prop="money" show-overflow-tooltip />
<el-table-column label="任务类型" prop="type_name" show-overflow-tooltip />
<el-table-column label="状态" show-overflow-tooltip>
<template #default="{ row }">
<span>{{ row.status == 1 ? '显示' : '隐藏' }}</span>
</template>
</el-table-column>
<el-table-column label="任务描述" prop="content" show-overflow-tooltip />
</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="taskTemplateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiTaskTemplateLists, apiTaskTemplateDelete } from '@/api/task_template'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { dictDataLists } from '@/api/setting/dict'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const datalist = ref([])
//
const showEdit = ref(false)
//
const queryParams = reactive({
title: '',
admin_id: '',
money: '',
type: '',
status: '',
content: ''
})
const statusdata = reactive([
{ id: 1, name: '显示' },
{ id: 2, name: '隐藏' }
])
//
const selectData = ref<any[]>([])
const emits = defineEmits(['customEvent'])
//
const handleSelectionChange = (value: any) => {
emits('customEvent', value)
// selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskTemplateLists,
params: queryParams
})
//
// dictDataLists({ type_id: 10 }).then((res) => {
// datalist.value = res.lists
// })
getLists()
</script>
<style lang="scss" scoped>
.formtabel {
.el-form-item {
width: 20%;
.el-btn {
margin-left: 60px;
}
}
}
</style>