|
|
@ -57,8 +57,8 @@ |
|
|
|
<template v-for="item in text"> |
|
|
|
<template v-if="column.proId === item.proId"> |
|
|
|
<div class="mb-3" v-for="(task, key) in item.tasks" :key="key"> |
|
|
|
<PushpinOutlined v-if="task.cooperation === 1" title="协作任务" /> |
|
|
|
<span class="ml-2"> |
|
|
|
<PushpinOutlined class="mr-2" v-if="task.cooperation === 1" title="协作任务" /> |
|
|
|
<span> |
|
|
|
我今日计划结果{{ key + 1 }}是:{{ task.taskName }},交付物是:{{ task.deliverName }},截止时间:{{ |
|
|
|
dayjs(+task.deadline).format('MM-DD') |
|
|
|
}},时长:{{ task.duration / 3600000 }},检查人:{{ task.checker }} |
|
|
@ -93,6 +93,8 @@ |
|
|
|
style="padding: 0; max-height: 800px; overflow-y: auto" |
|
|
|
> |
|
|
|
<div style="padding: 0 96px"> |
|
|
|
<div class="mb-4">当前操作项目:{{ currProName }},当前操作成员:{{ currEmpName }}</div> |
|
|
|
|
|
|
|
<a-form :model="modalFormState"> |
|
|
|
<div v-for="(item, index) in modalFormState" :key="index"> |
|
|
|
<div class="flex justify-between items-center text-gray-400"> |
|
|
@ -216,12 +218,15 @@ const projectId = computed(() => store.getters['project/projectId']); |
|
|
|
const sessionProjectId = sessionStorage.getItem('projectId'); |
|
|
|
const roleId = computed(() => store.state.role.roleId); |
|
|
|
const members = computed(() => store.state.role.members); |
|
|
|
const userId = computed(() => store.getters['user/userId']); // 用户id |
|
|
|
const isFullScreen = computed(() => store.state.layout.isFullScreen); // 是否全屏 |
|
|
|
const visible = ref(false); // 是否显示弹框表单 |
|
|
|
const isDisabled = ref(false); // 是否允许编辑 |
|
|
|
const morningStatus = ref(false); // 早打卡 |
|
|
|
const nightStatus = ref(false); // 晚打卡 |
|
|
|
const checkerId = ref(null); // 打卡审核人id |
|
|
|
const recordId = ref(null); // 记录id |
|
|
|
const memberId = ref(null); // 成员id |
|
|
|
|
|
|
|
// 筛选表单 |
|
|
|
const formState = reactive({ |
|
|
@ -229,6 +234,8 @@ const formState = reactive({ |
|
|
|
staffRange: [], // 员工 |
|
|
|
programName: [], // 项目名称 |
|
|
|
}); |
|
|
|
const startTime = dayjs(+new Date().getTime()); |
|
|
|
const endTime = dayjs(+new Date().getTime()).add(1, 'day'); |
|
|
|
|
|
|
|
// 下拉选选项 |
|
|
|
const memberList = ref([]); // 成员列表 |
|
|
@ -246,28 +253,19 @@ const dataTotal = ref(0); // 数据总量 |
|
|
|
const columnDatas = ref([]); |
|
|
|
|
|
|
|
// 今日计划表单 |
|
|
|
const modalFormState = ref([ |
|
|
|
{ |
|
|
|
taskName: '', |
|
|
|
deliverName: '', |
|
|
|
showDeadLine: dayjs(+new Date().getTime()), |
|
|
|
deadline: '', |
|
|
|
showDuration: '2', |
|
|
|
duration: '', |
|
|
|
checker: '', |
|
|
|
cooperation: 0, |
|
|
|
deliverLink: '', |
|
|
|
sequence: 0, |
|
|
|
}, |
|
|
|
]); |
|
|
|
const modalFormState = ref([]); |
|
|
|
// 工作时长 |
|
|
|
const workDurations = [...Array(8)].map((_, i) => ({ value: `${i + 1}` })); |
|
|
|
const isSubmitDeliver = ref(false); // 是否提交交付物 |
|
|
|
const currEmpId = ref(null); // 当前点击的用户id |
|
|
|
const currEmpName = ref(null); // 当前点击的用户名 |
|
|
|
const currProId = ref(null); // 当前点击的项目id |
|
|
|
const currProName = ref(null); // 当前点击的项目名 |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
getClockQuery(); |
|
|
|
await getInfo(); |
|
|
|
await getQueryTasks({}); |
|
|
|
await getQueryTasks(); |
|
|
|
}); |
|
|
|
|
|
|
|
// 改变全屏状态 |
|
|
@ -284,18 +282,19 @@ async function getInfo() { |
|
|
|
pageSize.value = data.emps.length; |
|
|
|
proList.value = data.pros; |
|
|
|
} catch (error) { |
|
|
|
message.info(error); |
|
|
|
throw new Error(error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取任务列表 |
|
|
|
async function getQueryTasks(query) { |
|
|
|
async function getQueryTasks() { |
|
|
|
try { |
|
|
|
const { url } = store.state.projects.project; |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
startTime: query.startTime || formState.timeRange[0].startOf('day').valueOf(), |
|
|
|
endTime: query.endTime || formState.timeRange[1].startOf('day').valueOf(), |
|
|
|
startTime: startTime.value || formState.timeRange[0].startOf('day').valueOf(), |
|
|
|
endTime: endTime.value || formState.timeRange[1].startOf('day').valueOf(), |
|
|
|
emps: emps.value || [], |
|
|
|
pros: proDatas.value || [], |
|
|
|
}, |
|
|
@ -359,6 +358,7 @@ async function getQueryTasks(query) { |
|
|
|
columnDatas.value.push(obj); |
|
|
|
}); |
|
|
|
} catch (error) { |
|
|
|
message.info(error); |
|
|
|
throw new Error(error); |
|
|
|
} |
|
|
|
} |
|
|
@ -377,8 +377,9 @@ function handleSubmit() { |
|
|
|
if (index > -1) proDatas.value.push(item.id); |
|
|
|
}); |
|
|
|
|
|
|
|
const endTime = dayjs(+formState.timeRange[0].startOf('day')).add(1, 'day'); |
|
|
|
getQueryTasks({ endTime: dayjs(+endTime).valueOf() }); |
|
|
|
const end = dayjs(+formState.timeRange[0].startOf('day')).add(1, 'day'); |
|
|
|
endTime.value = dayjs(+end).valueOf(); |
|
|
|
getQueryTasks(); |
|
|
|
} |
|
|
|
|
|
|
|
// 重置 |
|
|
@ -392,16 +393,39 @@ function resetData() { |
|
|
|
|
|
|
|
// 分页改变 |
|
|
|
function handlePage(e) { |
|
|
|
const startTime = dayjs(+formState.timeRange[0].startOf('day')).add(e - 1, 'day'); |
|
|
|
const endTime = dayjs(+startTime).add(1, 'day'); |
|
|
|
getQueryTasks({ startTime: dayjs(+startTime).valueOf(), endTime: dayjs(+endTime).valueOf() }); |
|
|
|
const start = dayjs(+formState.timeRange[0].startOf('day')).add(e - 1, 'day'); |
|
|
|
const end = dayjs(+start).add(1, 'day'); |
|
|
|
startTime.value = dayjs(+start).valueOf(); |
|
|
|
endTime.value = dayjs(+end).valueOf(); |
|
|
|
getQueryTasks(); |
|
|
|
} |
|
|
|
|
|
|
|
// 打开今日计划编辑框 |
|
|
|
function showModal(data, proId) { |
|
|
|
currEmpId.value = data.empId; |
|
|
|
currProId.value = proId; |
|
|
|
const currEmpInfo = memberList.value.find(item => item.id === data.empId); |
|
|
|
currEmpName.value = currEmpInfo.empName; |
|
|
|
const currProInfo = proList.value.find(item => item.id === proId); |
|
|
|
currProName.value = currProInfo.projectName; |
|
|
|
|
|
|
|
isDisabled.value = dayjs(+new Date().getTime()).format('MM-DD') !== data.time; |
|
|
|
visible.value = true; |
|
|
|
|
|
|
|
modalFormState.value = [ |
|
|
|
{ |
|
|
|
taskName: '', |
|
|
|
deliverName: '', |
|
|
|
showDeadLine: dayjs(+new Date().getTime()), |
|
|
|
deadline: '', |
|
|
|
showDuration: '2', |
|
|
|
duration: '', |
|
|
|
checker: '', |
|
|
|
cooperation: 0, |
|
|
|
deliverLink: '', |
|
|
|
sequence: 0, |
|
|
|
}, |
|
|
|
]; |
|
|
|
data.program.forEach(item => { |
|
|
|
if (proId === item.proId) { |
|
|
|
modalFormState.value = [...item.tasks]; |
|
|
@ -417,7 +441,7 @@ function showModal(data, proId) { |
|
|
|
|
|
|
|
// 检查人筛选 |
|
|
|
function filterOption(input, option) { |
|
|
|
return option.emp_name.indexOf(input) >= 0; |
|
|
|
return option.empName.indexOf(input) >= 0; |
|
|
|
} |
|
|
|
|
|
|
|
// 选择工作时长 |
|
|
@ -500,8 +524,8 @@ async function submitForm() { |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
time: new Date().getTime(), |
|
|
|
empId: 1, |
|
|
|
proId: 1, |
|
|
|
empId: currEmpId.value, |
|
|
|
proId: currProId.value, |
|
|
|
tasks: modalFormState.value, |
|
|
|
}, |
|
|
|
}; |
|
|
@ -513,18 +537,27 @@ async function submitForm() { |
|
|
|
punch(); |
|
|
|
getQueryTasks(); |
|
|
|
} catch (error) { |
|
|
|
message.info(error); |
|
|
|
throw new Error(error); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取当前打卡信息 |
|
|
|
async function getClockQuery() { |
|
|
|
const startTime = dayjs(+new Date().getTime()).valueOf(); |
|
|
|
const endTime = dayjs(+new Date().getTime()) |
|
|
|
const start = dayjs(+new Date().getTime()).valueOf(); |
|
|
|
const end = dayjs(+new Date().getTime()) |
|
|
|
.add(1, 'day') |
|
|
|
.valueOf(); |
|
|
|
|
|
|
|
const params = { param: { projectId: projectId.value || sessionProjectId, roleId: roleId.value, memberIdList: [], startTime, endTime } }; |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
projectId: projectId.value || sessionProjectId, |
|
|
|
roleId: roleId.value, |
|
|
|
memberIdList: [], |
|
|
|
startTime: start, |
|
|
|
endTime: end, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
try { |
|
|
|
const { url } = store.state.projects.project; |
|
|
@ -539,9 +572,17 @@ async function getClockQuery() { |
|
|
|
checkerId.value = members.value[0].memberId; |
|
|
|
} |
|
|
|
|
|
|
|
// 成员id |
|
|
|
if (data[0].recordList[0].isMine === 1) { |
|
|
|
memberId.value = data[0].recordList[0].memberId; |
|
|
|
} |
|
|
|
|
|
|
|
recordId.value = data[0].recordList[0].id; |
|
|
|
|
|
|
|
morningStatus.value = data[0].recordList[0].morningStatus > 0; // 早打卡状态 |
|
|
|
nightStatus.value = data[0].recordList[0].nightStatus > 0; // 晚打卡状态 |
|
|
|
} catch (error) { |
|
|
|
message.info(error); |
|
|
|
throw new Error(error); |
|
|
|
} |
|
|
|
} |
|
|
@ -549,7 +590,8 @@ async function getClockQuery() { |
|
|
|
async function punch() { |
|
|
|
const clockType = isSubmitDeliver.value ? 1 : 0; // 打卡类型:1 晚打卡 0 早打卡 |
|
|
|
const dateTime = dayjs(+new Date().getTime()).valueOf(); // 打卡时间 |
|
|
|
const params = { param: { clockType, dateTime } }; |
|
|
|
|
|
|
|
const params = { param: { checkerId: checkerId.value, memberId: memberId.value, id: recordId.value, clockType, dateTime } }; |
|
|
|
try { |
|
|
|
const { url } = store.state.projects.project; |
|
|
|
const data = await clockPunch(params, url); |
|
|
@ -557,6 +599,7 @@ async function punch() { |
|
|
|
morningStatus.value = data[0].recordList[0].morningStatus > 0; // 早打卡状态 |
|
|
|
nightStatus.value = data[0].recordList[0].nightStatus > 0; // 晚打卡状态 |
|
|
|
} catch (error) { |
|
|
|
message.info(`打卡失败,${error}`); |
|
|
|
throw new Error(error); |
|
|
|
} |
|
|
|
} |
|
|
|