NASER change task orders and make daily report and end task when emploee exit

This commit is contained in:
Montzar.ah.01
2026-04-28 19:53:46 +00:00
parent d1d092359e
commit f4ce38e560
4 changed files with 94 additions and 28 deletions
+27 -14
View File
@@ -136,9 +136,9 @@ $state = [
$actionType = $ended_at ? 'start' : ($started_at ? 'end' : 'start');
$p_id = $lastDuration?->id ?? '';
@endphp
{{--@if($_COOKIE['user_identity'] == 'naser_me') {{dump($task)}} @endif--}}
{{--@if($_COOKIE['user_identity'] == 'naser_me') {{dump($task)}} @endif--}}
<tr class="hover:bg-gray-50">
<td class="px-2 py-2">
<td class="px-2 py-2 {{ $task->active ? 'border-s-4 border-cyan-400 ' : '' }}">
<div class="flex items-center gap-2">
<span class="inline-flex items-center justify-center w-5 h-5">{!! $stateIcon !!}</span>
<div>
@@ -336,7 +336,7 @@ $state = [
ویرایش کامل
</button>
<button id="modalDeleteTaskBtn" type="button"
class="px-4 py-2 rounded-lg font-medium text-gray-700 bg-red-100 hover:bg-gray-200 transition" >
class="px-4 py-2 rounded-lg font-medium text-gray-700 bg-red-100 hover:bg-gray-200 transition">
حذف
</button>
</div>
@@ -659,7 +659,7 @@ $state = [
if (at > 0 && /\S/.test(before[at - 1])) return null; // باید ابتدای کلمه باشد
const query = before.slice(at + 1);
if (/\s/.test(query)) return null;
return { atIndex: at, query };
return {atIndex: at, query};
}
function insertMention(textarea, atIndex, username) {
@@ -679,7 +679,7 @@ $state = [
const dropdown = document.getElementById('mentionDropdown');
if (!textarea || !dropdown) return;
let state = { open: false, atIndex: -1, query: '' };
let state = {open: false, atIndex: -1, query: ''};
function close() {
dropdown.classList.add('hidden');
@@ -688,7 +688,7 @@ $state = [
}
function open(items, atIndex, query) {
state = { open: true, atIndex, query };
state = {open: true, atIndex, query};
dropdown.innerHTML = items.map(u => {
const name = escapeHtml(u.name);
const uname = escapeHtml(u.user_name);
@@ -751,7 +751,7 @@ $state = [
// اپ
const appNameEl = document.getElementById('modalTaskAppName');
const appTypes = {1:'خانگی', 2:'همکار'};
const appTypes = {1: 'خانگی', 2: 'همکار'};
if (appNameEl) {
const app = (appsList || []).find(a => String(a.id) === String(task.app));
appNameEl.textContent = app ? `${app.name_fa} (${appTypes[app.type]})` : '-';
@@ -803,7 +803,7 @@ $state = [
'Content-Type': 'application/json',
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
body: JSON.stringify({ task_id: task.id })
body: JSON.stringify({task_id: task.id})
})
.then(res => res.json())
.then(data => {
@@ -963,7 +963,10 @@ $state = [
const tdEdit = $('#modalTaskTargetDateEdit');
if (sdEdit.length) {
try { sdEdit.persianDatepicker('destroy'); } catch (e) {}
try {
sdEdit.persianDatepicker('destroy');
} catch (e) {
}
sdEdit.persianDatepicker({
format: 'YYYY/MM/DD',
autoClose: true,
@@ -981,7 +984,10 @@ $state = [
}
if (tdEdit.length) {
try { tdEdit.persianDatepicker('destroy'); } catch (e) {}
try {
tdEdit.persianDatepicker('destroy');
} catch (e) {
}
tdEdit.persianDatepicker({
format: 'YYYY/MM/DD',
autoClose: true,
@@ -1024,7 +1030,7 @@ $state = [
fd.append('target_date', tdGreg?.value || '');
saveBtn.disabled = true;
fetch('{{ route('task.edit') }}', { method: 'POST', body: fd })
fetch('{{ route('task.edit') }}', {method: 'POST', body: fd})
.then(() => {
// backend redirect می‌دهد، ما فقط UI را آپدیت می‌کنیم
currentTaskDetails.priority = prEdit?.value || 'none';
@@ -1038,7 +1044,12 @@ $state = [
if (tdView) tdView.textContent = currentTaskDetails.target_date ? formatJalaliDate(currentTaskDetails.target_date) : '-';
// priority view
const priorityLabels = {'urgent': 'فوری', 'high': 'بالا', 'medium': 'متوسط', 'low': 'پایین'};
const priorityLabels = {
'urgent': 'فوری',
'high': 'بالا',
'medium': 'متوسط',
'low': 'پایین'
};
const priorityColors = {
'urgent': 'bg-red-100 text-red-800',
'high': 'bg-orange-100 text-orange-800',
@@ -1069,7 +1080,9 @@ $state = [
setQuickEditMode(false);
})
.catch(() => alert('خطا در ذخیره تغییرات'))
.finally(() => { saveBtn.disabled = false; });
.finally(() => {
saveBtn.disabled = false;
});
};
}
});
@@ -1099,6 +1112,6 @@ $state = [
// NOTE: مدیریت زمان از مودال جزئیات حذف شده و فقط در تب "زمان‌ها" انجام می‌شود.
</script>
</script>
@endsection