add WorkshopSettingsPage in client
This commit is contained in:
@@ -1,216 +0,0 @@
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Infrastructure;
|
||||
using AccountManagement.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using AccountManagement.Application.Contracts.CameraAccount;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
[Authorize]
|
||||
[NeedsPermission(SubAccountPermissionHelper.CameraAccountSettingsPermissionCode)]
|
||||
public class CameraAccountsModel : PageModel
|
||||
{
|
||||
public string Mess { get; set; }
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly ICameraAccountApplication _cameraAccountApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly ISubAccountApplication _subAccountApplication;
|
||||
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
|
||||
public CameraAccountsModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, ICameraAccountApplication cameraAccountApplication, IAccountApplication accountApplication, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, ISubAccountApplication subAccountApplication)
|
||||
{
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
_cameraAccountApplication = cameraAccountApplication;
|
||||
_accountApplication = accountApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_contextAccessor = contextAccessor;
|
||||
_subAccountApplication = subAccountApplication;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
WorkshopFullName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName;
|
||||
}
|
||||
|
||||
public IActionResult OnPostSendSms()
|
||||
{
|
||||
var accountInfo = _authHelper.CurrentAccountInfo();
|
||||
if (accountInfo.SubAccountId == 0)
|
||||
{
|
||||
var accountId = accountInfo.Id;
|
||||
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
|
||||
if (result != null)
|
||||
{
|
||||
_accountApplication.SendVerifyCodeToChangingPass(result.Mobile, accountId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
|
||||
if (result != null && result != default)
|
||||
{
|
||||
_subAccountApplication.SendVerifyCodeForPasswordChange(result.PhoneNumber, accountInfo.SubAccountId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public IActionResult OnPostCheckCode(string code)
|
||||
{
|
||||
var accountInfo = _authHelper.CurrentAccountInfo();
|
||||
if (accountInfo.SubAccountId == 0)
|
||||
{
|
||||
var accountId = accountInfo.Id;
|
||||
|
||||
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
|
||||
var verfiyResult = _accountApplication.GetByVerifyCode(code, result.Mobile);
|
||||
if (verfiyResult != null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
exist = true,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var subAccountId = accountInfo.SubAccountId;
|
||||
|
||||
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
|
||||
if (result != null && result != default)
|
||||
{
|
||||
var verfiyResult = _subAccountApplication.GetByVerifyCodeAndPhoneNumber(code, result.PhoneNumber);
|
||||
if (verfiyResult != null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
exist = true,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
exist = false,
|
||||
});
|
||||
}
|
||||
|
||||
#region Camera Account
|
||||
public IActionResult OnGetCameraAccounts()
|
||||
{
|
||||
var authModel = _authHelper.CurrentAccountInfo();
|
||||
List<(long Id, string Name)> workshops = authModel.WorkshopList.Select(x => (x.Id, x.Name)).ToList();
|
||||
|
||||
var result = _cameraAccountApplication.GetAllByWorkshopIdAndAccountId(authModel.Id, workshops);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = result
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetChangeCameraPassword(long id)
|
||||
{
|
||||
var camera = _cameraAccountApplication.GetDetails(id);
|
||||
var command = new CameraAccountViewModel()
|
||||
{
|
||||
Id = id,
|
||||
Username = camera.Username,
|
||||
WorkshopName = camera.WorkshopName,
|
||||
};
|
||||
return Partial("ModalCameraAccountChangePassword", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeCameraPassword(ChangePassword command)
|
||||
{
|
||||
var result = _cameraAccountApplication.ChangePass(command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetCameraValidation(string password, string rePassword)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(rePassword))
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "رمز عبور و تکرار آن نباید خالی باشد"
|
||||
});
|
||||
}
|
||||
|
||||
if (password != rePassword)
|
||||
{
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "رمز عبور یکسان نیست",
|
||||
});
|
||||
}
|
||||
|
||||
if (password.Length < 8)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "رمز عبور نمی تواند کمتر از 8 کاراکتر باشد",
|
||||
});
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostCameraAccountChangeStatus(long id, string type)
|
||||
{
|
||||
OperationResult result = type == "active" ? _cameraAccountApplication.Active(id) : _cameraAccountApplication.DeActive(id);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccountsModel
|
||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
|
||||
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
@@ -201,12 +201,12 @@
|
||||
<script src="~/AssetsClient/js/dropdown.js?ver=@clientVersion"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var loadCameraAccountsAjax = `@Url.Page("CameraAccounts", "CameraAccounts")`;
|
||||
var changeCameraAccountStatusAjax = `@Url.Page("./CameraAccounts", "CameraAccountChangeStatus")`;
|
||||
var loadCameraAccountsAjax = `@Url.Page("./Index", "CameraAccounts")`;
|
||||
var changeCameraAccountStatusAjax = `@Url.Page("./Index", "CameraAccountChangeStatus")`;
|
||||
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using AccountManagement.Application.Contracts.CameraAccount;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Infrastructure;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.Application;
|
||||
using System.Transactions;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts
|
||||
{
|
||||
[Authorize]
|
||||
[NeedsPermission(SubAccountPermissionHelper.CameraAccountSettingsPermissionCode)]
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
public string Mess { get; set; }
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly ICameraAccountApplication _cameraAccountApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly ISubAccountApplication _subAccountApplication;
|
||||
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
public bool HasCamera;
|
||||
|
||||
public IndexModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, ICameraAccountApplication cameraAccountApplication, IAccountApplication accountApplication, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, ISubAccountApplication subAccountApplication)
|
||||
{
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
_cameraAccountApplication = cameraAccountApplication;
|
||||
_accountApplication = accountApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_contextAccessor = contextAccessor;
|
||||
_subAccountApplication = subAccountApplication;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
WorkshopFullName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName;
|
||||
|
||||
HasCamera = _cameraAccountApplication.HasCameraAccount(_workshopId, accountId);
|
||||
}
|
||||
|
||||
public IActionResult OnPostSendSms()
|
||||
{
|
||||
var accountInfo = _authHelper.CurrentAccountInfo();
|
||||
if (accountInfo.SubAccountId == 0)
|
||||
{
|
||||
var accountId = accountInfo.Id;
|
||||
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
|
||||
if (result != null)
|
||||
{
|
||||
_accountApplication.SendVerifyCodeToChangingPass(result.Mobile, accountId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
|
||||
if (result != null && result != default)
|
||||
{
|
||||
_subAccountApplication.SendVerifyCodeForPasswordChange(result.PhoneNumber, accountInfo.SubAccountId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public IActionResult OnPostCheckCode(string code)
|
||||
{
|
||||
var accountInfo = _authHelper.CurrentAccountInfo();
|
||||
if (accountInfo.SubAccountId == 0)
|
||||
{
|
||||
var accountId = accountInfo.Id;
|
||||
|
||||
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
|
||||
var verfiyResult = _accountApplication.GetByVerifyCode(code, result.Mobile);
|
||||
if (verfiyResult != null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
exist = true,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var subAccountId = accountInfo.SubAccountId;
|
||||
|
||||
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
|
||||
if (result != null && result != default)
|
||||
{
|
||||
var verfiyResult = _subAccountApplication.GetByVerifyCodeAndPhoneNumber(code, result.PhoneNumber);
|
||||
if (verfiyResult != null)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
exist = true,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
exist = false,
|
||||
});
|
||||
}
|
||||
|
||||
#region Create Camera
|
||||
public IActionResult OnGetCreateCameraAccount()
|
||||
{
|
||||
var command = new CreateCameraAccount();
|
||||
command.WorkshopName = _workshopApplication.GetWorkshopFullname(_workshopId);
|
||||
return Partial("_Partials/ModalCreateAccountSetting", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateCameraAccount(CreateCameraAccount command)
|
||||
{
|
||||
var createAccountCommand = new CreateCameraAccount()
|
||||
{
|
||||
WorkshopId = _workshopId,
|
||||
AccountId = _authHelper.CurrentAccountId(),
|
||||
Username = command.Username,
|
||||
Password = command.Password,
|
||||
RePassword = command.RePassword,
|
||||
WorkshopName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName,
|
||||
IsActiveString = "true",
|
||||
};
|
||||
var result = _cameraAccountApplication.Create(createAccountCommand);
|
||||
return new JsonResult(new
|
||||
{
|
||||
Success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Camera Account
|
||||
public IActionResult OnGetCameraAccounts()
|
||||
{
|
||||
var authModel = _authHelper.CurrentAccountInfo();
|
||||
List<(long Id, string Name)> workshops = authModel.WorkshopList.Select(x => (x.Id, x.Name)).ToList();
|
||||
|
||||
var result = _cameraAccountApplication.GetAllByWorkshopIdAndAccountId(authModel.Id, workshops);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = result
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetChangeCameraPassword(long id)
|
||||
{
|
||||
var camera = _cameraAccountApplication.GetDetails(id);
|
||||
var command = new CameraAccountViewModel()
|
||||
{
|
||||
Id = id,
|
||||
Username = camera.Username,
|
||||
WorkshopName = camera.WorkshopName,
|
||||
};
|
||||
return Partial("_Partials/ModalCameraAccountChangePassword", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeCameraPassword(ChangePassword command)
|
||||
{
|
||||
var result = _cameraAccountApplication.ChangePass(command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetCameraValidation(string password, string rePassword)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(rePassword))
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "رمز عبور و تکرار آن نباید خالی باشد"
|
||||
});
|
||||
}
|
||||
|
||||
if (password != rePassword)
|
||||
{
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "رمز عبور یکسان نیست",
|
||||
});
|
||||
}
|
||||
|
||||
if (password.Length < 8)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "رمز عبور نمی تواند کمتر از 8 کاراکتر باشد",
|
||||
});
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostCameraAccountChangeStatus(long id, string type)
|
||||
{
|
||||
OperationResult result = type == "active" ? _cameraAccountApplication.Active(id) : _cameraAccountApplication.DeActive(id);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
public IActionResult OnGetCheckAccount(string username)
|
||||
{
|
||||
var result = _cameraAccountApplication.CheckUsername(username);
|
||||
return new JsonResult(new
|
||||
{
|
||||
Success = result.IsSuccedded,
|
||||
message = result.IsSuccedded ? "نام کاربری با مورد تاییداست" : result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
@model AccountManagement.Application.Contracts.CameraAccount.CameraAccountViewModel
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/profile/css/modalcameraaccountchangepassword.css" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form2" id="create-form2" autocomplete="off">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header d-block text-center">
|
||||
<svg width="56" height="56" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M57.5025 30.5801C57.5025 44.0276 47.74 56.6226 34.4025 60.3076C33.495 60.5551 32.505 60.5551 31.5975 60.3076C18.26 56.6226 8.4975 44.0276 8.4975 30.5801V18.5075C8.4975 16.2525 10.2025 13.695 12.32 12.8425L27.6375 6.57263C31.075 5.17013 34.9525 5.17013 38.39 6.57263L53.7075 12.8425C55.7975 13.695 57.53 16.2525 57.53 18.5075L57.5025 30.5801Z" stroke="url(#paint0_linear_320_3375)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M33 34.375C36.0376 34.375 38.5 31.9126 38.5 28.875C38.5 25.8374 36.0376 23.375 33 23.375C29.9624 23.375 27.5 25.8374 27.5 28.875C27.5 31.9126 29.9624 34.375 33 34.375Z" stroke="url(#paint1_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M33 34.375V42.625" stroke="url(#paint2_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_320_3375" x1="33.0138" y1="5.52075" x2="33.0138" y2="60.4932" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2EC0C0" />
|
||||
<stop offset="1" stop-color="#087373" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_320_3375" x1="33" y1="23.375" x2="33" y2="34.375" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2EC0C0" />
|
||||
<stop offset="1" stop-color="#087373" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_320_3375" x1="33.5" y1="34.375" x2="33.5" y2="42.625" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#087373" />
|
||||
<stop offset="1" stop-color="#2EC0C0" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<h5 class="modal-title text-center" id="profilePasswordModalLabel">تغییر رمز دوربین</h5>
|
||||
<h6 class="modal-title text-center">@Model.WorkshopName</h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="codeDiv" style="display: none">
|
||||
<div class="otp" style="display: none">
|
||||
<input type="text" id="n0" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" autofocus data-next="1">
|
||||
<input type="text" id="n1" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="2">
|
||||
<input type="text" id="n2" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="3">
|
||||
<input type="text" id="n3" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="4">
|
||||
<input type="text" id="n4" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="5">
|
||||
<input type="text" id="n5" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off">
|
||||
</div>
|
||||
<div class="text-center mt-2">
|
||||
<div id="msg">
|
||||
<p class="m-0">با کلیک بروی دکمه "دریافت کد"، کد یکبار مصرف برای شما ارسال میگردد.</p></div>
|
||||
<div class="align-items-center justify-content-center" id="timerCount" style="display: none">
|
||||
<div>
|
||||
<p class="m-0">برای تغییر رمز ابتدا کد دریافتی را وارد کنید</p></div>
|
||||
<p class="mx-1">زمان باقی مانده تا انقضاء کد دریافتی</p>
|
||||
<p class="countdown" id="timer"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center loading" style="display: none">
|
||||
<div class="spinner-border" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container p-0 m-0" id="form">
|
||||
<div class="row">
|
||||
|
||||
<input type="hidden" name="Command.Id" value="@Model.Id" />
|
||||
|
||||
<div class="col-12">
|
||||
<div class="d-flex align-items-center justify-content-between" style="background: #e8e8e8;padding: 7px; border: 1px solid #E1E1E1;border-radius: 10px;">
|
||||
<span style="font-size: 13px;color: #626262;">حساب کاربری</span>
|
||||
<span style="font-size: 13px;color: #626262;">@Model.Username</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="form-group text-start my-2">
|
||||
<label for="signupInputPassword">گذرواژه</label>
|
||||
<div class="position-relative">
|
||||
|
||||
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="passFunction()">
|
||||
<svg class="eyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<svg class="eyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<input name="Command.Password" type="password" autocomplete="new-password" class="form-control mb-1" id="signupInputPassword" aria-describedby="passwordHelp" placeholder="رمز جدید" style="direction: ltr;" />
|
||||
|
||||
<div class="input-icon-right peek-password-button" data-peek-password="signupInputPassword">
|
||||
<span class="peek-password-icon icon-visibility d-none"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="password-strength-group" data-strength="">
|
||||
<div id="password-strength-meter" class="password-strength-meter" style="direction: ltr;">
|
||||
<div class="meter-block"></div>
|
||||
<div class="meter-block"></div>
|
||||
<div class="meter-block"></div>
|
||||
<div class="meter-block"></div>
|
||||
</div>
|
||||
|
||||
<div class="password-strength-message">
|
||||
<div class="message-item">
|
||||
ضعیف
|
||||
</div>
|
||||
|
||||
<div class="message-item">
|
||||
متوسط
|
||||
</div>
|
||||
|
||||
<div class="message-item">
|
||||
خوب
|
||||
</div>
|
||||
|
||||
<div class="message-item">
|
||||
عالی
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group mt-3">
|
||||
<div class="position-relative">
|
||||
<input type="password" name="Command.RePassword" class="form-control" id="repeat_password" placeholder="تکرار گذرواژه" style="direction: ltr;"/>
|
||||
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="rePassFunction()">
|
||||
<svg class="reEyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<svg class="reEyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div id="passwordErrorMessage" class="text-danger" style="text-align: start; font-size: 12px; position: absolute; bottom: -20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowAccountMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 justify-content-center w-100" id="prev-step" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-primary w-100" id="sentCode" style="display: none" onclick="handleSmsReceiverClick()">دریافت کد مجدد</button>
|
||||
<button type="button" class="btn-primary w-100 disable" id="submit" style="display: none" onclick="changePasswordCameraAccount()">تایید کد</button>
|
||||
<button type="button" class="btn-primary w-100" id="btnSmsReceiver">ثبت ویرایش</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveCameraAccountPasswordChangeAjax = `@Url.Page("./Index", "ChangeCameraPassword")`;
|
||||
var sendSmsAjax = `@Url.Page("./Index", "SendSms")`;
|
||||
var checkCodeAjax = `@Url.Page("./Index", "CheckCode")`;
|
||||
var ajaxCameraValidation = `@Url.Page("./Index", "CameraValidation")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/RollCall/js/ModalCameraAccountChangePassword.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,171 @@
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model AccountManagement.Application.Contracts.CameraAccount.CreateCameraAccount
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css">
|
||||
<link href="~/assetsclient/pages/rollcall/css/modalcreateaccountsetting.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center">
|
||||
<svg width="56" height="56" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M57.5025 30.5801C57.5025 44.0276 47.74 56.6226 34.4025 60.3076C33.495 60.5551 32.505 60.5551 31.5975 60.3076C18.26 56.6226 8.4975 44.0276 8.4975 30.5801V18.5075C8.4975 16.2525 10.2025 13.695 12.32 12.8425L27.6375 6.57263C31.075 5.17013 34.9525 5.17013 38.39 6.57263L53.7075 12.8425C55.7975 13.695 57.53 16.2525 57.53 18.5075L57.5025 30.5801Z" stroke="url(#paint0_linear_320_3375)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M33 34.375C36.0376 34.375 38.5 31.9126 38.5 28.875C38.5 25.8374 36.0376 23.375 33 23.375C29.9624 23.375 27.5 25.8374 27.5 28.875C27.5 31.9126 29.9624 34.375 33 34.375Z" stroke="url(#paint1_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M33 34.375V42.625" stroke="url(#paint2_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_320_3375" x1="33.0138" y1="5.52075" x2="33.0138" y2="60.4932" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2EC0C0" />
|
||||
<stop offset="1" stop-color="#087373" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_320_3375" x1="33" y1="23.375" x2="33" y2="34.375" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#2EC0C0" />
|
||||
<stop offset="1" stop-color="#087373" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_320_3375" x1="33.5" y1="34.375" x2="33.5" y2="42.625" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#087373" />
|
||||
<stop offset="1" stop-color="#2EC0C0" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<h5 class="modal-title text-center" id="profilePasswordModalLabel">ساخت اکانت جدید</h5>
|
||||
<h6 class="modal-title text-center">@Model.WorkshopName</h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container p-0 m-0" id="step-form1">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group text-start">
|
||||
<label for="username">حساب کاربری</label>
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control" id="username" asp-for="Username" placeholder="" style="direction: ltr;" />
|
||||
|
||||
<div class="position-absolute top-0 start-0 m-1 bg-transparent">
|
||||
<div class="spinner-border spinner-border-sm m-1 d-none" id="loadingSpinner" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<svg id="successSvg" class="d-none" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="14" cy="14" r="10.5" stroke="#65A30D" stroke-width="1.5"/>
|
||||
<path d="M9.33342 14L12.8334 17.5L18.6667 10.5" stroke="#65A30D" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<svg id="errorSvg" class="d-none" width="28" height="28" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke="#ef4444" stroke-linecap="round" stroke-linejoin="round" d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group text-start my-2">
|
||||
<label for="signupInputPassword">گذرواژه</label>
|
||||
<div class="position-relative">
|
||||
<input asp-for="Password" type="password" class="form-control mb-1" id="signupInputPassword" aria-describedby="passwordHelp" placeholder="رمز جدید" style="direction: ltr;" />
|
||||
|
||||
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="passFunction()">
|
||||
<svg class="eyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<svg class="eyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="input-icon-right peek-password-button" data-peek-password="signupInputPassword">
|
||||
<span class="peek-password-icon icon-visibility d-none"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="password-strength-group" data-strength="">
|
||||
<div id="password-strength-meter" class="password-strength-meter" style="direction: ltr;">
|
||||
<div class="meter-block"></div>
|
||||
<div class="meter-block"></div>
|
||||
<div class="meter-block"></div>
|
||||
<div class="meter-block"></div>
|
||||
</div>
|
||||
|
||||
<div class="password-strength-message">
|
||||
<div class="message-item">
|
||||
ضعیف
|
||||
</div>
|
||||
|
||||
<div class="message-item">
|
||||
متوسط
|
||||
</div>
|
||||
|
||||
<div class="message-item">
|
||||
خوب
|
||||
</div>
|
||||
|
||||
<div class="message-item">
|
||||
عالی
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="form-group mt-3">
|
||||
<div class="position-relative">
|
||||
<input type="password" asp-for="RePassword" class="form-control" id="repeat_password" placeholder="تکرار گذرواژه" style="direction: ltr;" />
|
||||
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="rePassFunction()">
|
||||
<svg class="reEyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<svg class="reEyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</button>
|
||||
<div id="passwordErrorMessage" class="text-danger" style="text-align: start;font-size: 12px;position: absolute;bottom: -20px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowAccountMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-register w-100" onclick="checkAccountExist()">ثبت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var checkAccountAjax = `@Url.Page("./Index", "CheckAccount")`;
|
||||
var saveCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
|
||||
|
||||
console.log(checkAccountAjax);
|
||||
console.log(saveCreateCameraAccountUrl);
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/CameraAccounts/js/modalcameraaccount.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,321 @@
|
||||
@page
|
||||
@using _0_Framework.Domain.CustomizeCheckoutShared.Enums
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting.IndexModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = " - " + "حضور و غیاب";
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
int index = 1;
|
||||
int i = 0;
|
||||
<link href="~/assetsclient/css/card.css?ver=@clientVersion" rel="stylesheet"/>
|
||||
|
||||
var isRegularWorkshop = Model.WorkshopSettingsDetails.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? true : false;
|
||||
|
||||
<style>
|
||||
|
||||
.flex-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.flex-container::after {
|
||||
content: ""; /* Use an empty string for proper styling */
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 1px;
|
||||
background-color: #D9D9D9;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.flex-end {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.card-management {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #444444
|
||||
}
|
||||
.button-edit {
|
||||
width: 100%;
|
||||
height: 33px;
|
||||
border: 1px solid #009EE2;
|
||||
background-color: #C2F1F1;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #009EE2;
|
||||
border-radius: 5px;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.button-edit:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
|
||||
.custom-gap {
|
||||
gap: 18px;
|
||||
}
|
||||
.turn {
|
||||
text-align: center;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
color: #224B94;
|
||||
background-color: #EFF7FF;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.custom-position {
|
||||
position: absolute; /* Enable absolute positioning */
|
||||
top: -22px; /* Set custom top position */
|
||||
right: 18px; /* Set custom right position */
|
||||
|
||||
}
|
||||
@@media (min-width: 760px) {
|
||||
.flex-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 6px;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.card-management {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #444444
|
||||
}
|
||||
.button-edit {
|
||||
width: 70px;
|
||||
height: 27px;
|
||||
border: 1px solid #009EE2;
|
||||
background-color: #C2F1F1;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #009EE2;
|
||||
border-radius: 5px
|
||||
}
|
||||
.turn {
|
||||
text-align: center;
|
||||
width: 118px;
|
||||
height: 33px;
|
||||
line-height: 33px;
|
||||
color: #224B94;
|
||||
background-color: #EFF7FF;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
.custom-gap {
|
||||
gap: 50px;
|
||||
gap: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.mostamar-description {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 33px;
|
||||
line-height: 33px;
|
||||
color: #224B94;
|
||||
background-color: #EFF7FF;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
@@media (min-width: 760px) {
|
||||
.mostamar-description {
|
||||
width: 272px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
}
|
||||
|
||||
<!-- MAIN CONTENT -->
|
||||
<div class="content-container">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col d-flex align-items-center justify-content-start">
|
||||
<img src="~/AssetsClient/images/icons/face-scan.png" alt="" class="img-fluid me-2" style="width: 45px;"/>
|
||||
<div>
|
||||
<h4 class="title d-flex align-items-center">تنظیم ساعات کاری مجموعه</h4>
|
||||
<div>@Model.WorkshopFullName</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Index" class="back-btn" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="profile-header position-relative">
|
||||
<img src="~/AssetsClient/images/profile-header.png" alt="" class="img-fluid">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row px-2 py-0">
|
||||
<div class="card px-0 custom-pt pb-1 d-flex flex-column w-100">
|
||||
<div class="flex-container gap-4 mb-3 mb-md-2 ">
|
||||
|
||||
<div>
|
||||
<svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="17" cy="17" r="12.75" fill="#9CD8D8"/>
|
||||
<path d="M17.0007 7.38203C17.0007 7.23977 17.0007 7.16863 17.0462 7.12444C17.0918 7.08025 17.1614 7.08235 17.3006 7.08657C18.9374 7.13609 20.5382 7.59029 21.959 8.41061C23.4665 9.28098 24.7184 10.5328 25.5887 12.0404C26.4591 13.5479 26.9173 15.258 26.9173 16.9987C26.9173 18.7394 26.4591 20.4495 25.5887 21.957C24.7184 23.4646 23.4665 24.7164 21.959 25.5868C20.4515 26.4572 18.7414 26.9154 17.0006 26.9154C15.2599 26.9154 13.5498 26.4572 12.0423 25.5868C10.6215 24.7665 9.42776 23.6073 8.56648 22.2145C8.49321 22.0961 8.45657 22.0368 8.47207 21.9753C8.48757 21.9137 8.54917 21.8782 8.67237 21.807L16.8506 17.0853C16.9239 17.043 16.9605 17.0219 16.9806 16.9871C17.0007 16.9523 17.0007 16.91 17.0007 16.8255V7.38203Z" fill="#23A8A8"/>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
<span class="card-management">
|
||||
تنظیم ساعات کاری مجموعه
|
||||
@if (Model.WorkshopSettingsDetails.Id != 0)
|
||||
{
|
||||
<span> - @(isRegularWorkshop ? "منقطع" : "مستمر")</span>
|
||||
}
|
||||
</span>
|
||||
<button class="flex-end button-edit d-none d-md-block @(Model.WorkshopSettingsDetails.Id == 0 ? "disable" : "")" onclick="modalOpenWorkshopSetting()">ویرایش</button>
|
||||
</div>
|
||||
|
||||
|
||||
@* <input type="hidden" name="customizeWorkshopSettingsId" id="customizeWorkshopSettingsId" value="@Model.Id"/> *@
|
||||
|
||||
<div class="d-flex px-2 justify-md-content-center justify-content-sm-start align-items-center custom-gap mb-3 mb-md-2">
|
||||
|
||||
@if (Model.WorkshopSettingsDetails.Id != 0)
|
||||
{
|
||||
|
||||
@if (isRegularWorkshop)
|
||||
{
|
||||
@foreach (var item in Model.WorkshopSettingsDetails.ShiftsList.OrderBy(x => x.Placement))
|
||||
{
|
||||
<div class="d-flex flex-grow-1 flex-md-grow-0 gap-3 align-items-center ps-3">
|
||||
<span class="d-none d-md-block" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
|
||||
@if (item.Placement == ShiftPlacement.First)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (item.Placement == ShiftPlacement.Second)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
</span>
|
||||
<div class="d-flex flex-grow-1 flex-md-grow-0 turn justify-content-around position-relative">
|
||||
<span class="position-absolute custom-position d-block d-md-none" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
|
||||
@if (item.Placement == ShiftPlacement.First)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (item.Placement == ShiftPlacement.Second)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
</span>
|
||||
<span>@item.StartTime</span>
|
||||
<span>الی</span>
|
||||
<span>@item.EndTime</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mostamar-description ps-3 ">
|
||||
مجموعه بدون وقفه و بصورت مستمر فعال میباشد
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<div class="d-flex flex-grow-1 flex-md-grow-0 gap-3 align-items-center ps-3">
|
||||
<span class="d-none d-md-block" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
|
||||
نوبت اول
|
||||
</span>
|
||||
<div class="d-flex flex-grow-1 flex-md-grow-0 turn justify-content-around position-relative">
|
||||
<span class="position-absolute custom-position d-block d-md-none" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
|
||||
نوبت اول
|
||||
</span>
|
||||
<span>-</span>
|
||||
<span>الی</span>
|
||||
<span>-</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="px-2 d-flex w-full">
|
||||
<button class=" button-edit d-block d-md-none @(Model.WorkshopSettingsDetails.Id == 0 ? "disable" : "")" onclick="modalOpenWorkshopSetting()">ویرایش</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END MAIN CONTENT -->
|
||||
|
||||
<div id="MainModal" class="modal fade groupSettingModall" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered groupSettingModall-width">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var saveEditSettingWorkTimeAjax = `@Url.Page("./Index", "EditSettingWorkTime")`;
|
||||
var getGroupListAndEmployeeListAjax = `@Url.Page("./Index", "GroupListAndEmployeeList")`;
|
||||
var hasWorkshopSetting = @(Model.WorkshopSettingsDetails.Id == 0 ? "false" : "true");
|
||||
// var IsRegularWorkshop = @@(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular? "true" : "false");
|
||||
|
||||
$(document).ready(function() {
|
||||
if (!hasWorkshopSetting) {
|
||||
modalOpenWorkshopSetting();
|
||||
}
|
||||
});
|
||||
|
||||
function modalOpenWorkshopSetting() {
|
||||
window.location.href = `#showmodal=/Client/Company/RollCall/WorkshopSetting/Index?handler=WorkshopSettingModal`;
|
||||
}
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Infrastructure;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.Extensions.Configuration.UserSecrets;
|
||||
using System.Security.Claims;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using AccountManagement.Application.Contracts.CameraAccount;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using System.Transactions;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting
|
||||
{
|
||||
[Authorize]
|
||||
[NeedsPermission(SubAccountPermissionHelper.RollCallOperationsPermissionCode)]
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly long _workshopId;
|
||||
public EditCustomizeWorkshopSettings WorkshopSettingsDetails;
|
||||
public string WorkshopFullName;
|
||||
|
||||
public IndexModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IHttpContextAccessor contextAccessor, IWorkshopApplication workshopApplication)
|
||||
{
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_contextAccessor = contextAccessor;
|
||||
_workshopApplication = workshopApplication;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
WorkshopFullName = _workshopApplication.GetWorkshopInfo(_workshopId).WorkshopFullName;
|
||||
WorkshopSettingsDetails = _customizeWorkshopSettingsApplication.GetWorkshopSettingsDetails(_workshopId);
|
||||
return Page();
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetWorkshopSettingModal()
|
||||
{
|
||||
var command = _customizeWorkshopSettingsApplication.GetSimpleWorkshopSettings(_workshopId);
|
||||
|
||||
if (command.Id == 0)
|
||||
{
|
||||
var newCommand = new CreateCustomizeWorkshopSettings();
|
||||
return Partial("_Partials/ModalCreateSettingWorkshop", newCommand);
|
||||
}
|
||||
|
||||
return Partial("_Partials/ModalSettingWorkTime", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostSaveNewWorkshopSetting(CreateCustomizeWorkshopSettings command)
|
||||
{
|
||||
string finalMessage = "";
|
||||
using (var transaction = new TransactionScope())
|
||||
{
|
||||
var result = _customizeWorkshopSettingsApplication.CreateWorkshopSettings(command);
|
||||
finalMessage = result.Message;
|
||||
if (!result.IsSuccedded)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
Success = false,
|
||||
message = finalMessage,
|
||||
});
|
||||
}
|
||||
|
||||
transaction.Complete();
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
Success = true,
|
||||
message = finalMessage,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetGroupListAndEmployeeList(long customizeWorkshopSettingsId)
|
||||
{
|
||||
var resultData = _customizeWorkshopSettingsApplication.GetShiftChangesGroupAndEmployees(customizeWorkshopSettingsId);
|
||||
var success = resultData.Any();
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = success,
|
||||
data = resultData,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
if (workshopId < 1)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = false,
|
||||
message = "هیچ کارگاهی یافت نشد!",
|
||||
});
|
||||
|
||||
var result = _customizeWorkshopSettingsApplication
|
||||
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
@using _0_Framework.Domain.CustomizeCheckoutShared.Enums
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.CustomizeWorkshopSettings.CreateCustomizeWorkshopSettings
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css">
|
||||
<link href="~/assetsclient/pages/rollcall/workshopsetting/css/modalcreatesettingworkshop.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-2">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6>تنظیم ساعات کاری</h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container p-0 m-0" id="step-form2">
|
||||
|
||||
<div class="p-0 m-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100">
|
||||
<div class="d-flex align-items-center justify-content-center mb-2">
|
||||
<p class="m-0">ساعات کاری مجموعه این کارگاه را مشخص نمائید</p>
|
||||
</div>
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center w-100">
|
||||
<input type="radio" value="Regular" name="WorkshopShiftStatus" id="organized" class="radio-workTimeOption" checked="checked">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منقطع</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="WorkshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مستمر</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="step_workTimeOption" style="height: 0">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="ShiftsList[0].Placement" value="First"/>
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="ShiftsList[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="ShiftsList[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="step_workTimeOptionIrregular" style="display: none">
|
||||
<div class="show-disorganized mt-5">
|
||||
<p class="m-0">مجموعه بدون وقفه و بصورت مستمر فعال میباشد</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<div class="container my-2">
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12">
|
||||
<div class="lableCheckBreakTime text-center">وضعیت فعالیت مجموعه در روز های جمعه و تعطیلات رسمی</div>
|
||||
<div class="row extraOptionBorder">
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های تعطیلات رسمی</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays1" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.Default ? "checked" : "") value="@((int)(HolidayWork.Default))" />
|
||||
<label for="OffDays1" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays2" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.WorkInHolidays ? "checked" : "") value="@((int)(HolidayWork.WorkInHolidays))" />
|
||||
<label for="OffDays2" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-register w-100" onclick="saveNewWorkshopSetting()">ثبت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveNewWorkshopSettingUrl = `@Url.Page("./Index", "SaveNewWorkshopSetting")`;
|
||||
console.log(saveNewWorkshopSettingUrl);
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/workshopsetting/js/modalcreatesettingworkshop.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,235 @@
|
||||
|
||||
@using _0_Framework.Domain.CustomizeCheckoutShared.Enums
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.CustomizeWorkshopSettings.EditCustomizeWorkshopSettings
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
int i = 0;
|
||||
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css">
|
||||
<link href="~/assetsclient/pages/rollcall/workshopsetting/css/ModalSettingWorkTime.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-2">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6>تنظیم ساعات کاری</h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container p-0 m-0">
|
||||
|
||||
<div class="row p-0 m-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100 p-0">
|
||||
<div class="d-flex align-items-center justify-content-center mb-2">
|
||||
<p class="m-0">ساعات کاری مجموعه این کارگاه را مشخص نمائید</p>
|
||||
</div>
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center w-100">
|
||||
<input type="radio" value="Regular" name="workshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منقطع</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مستمر</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="step_workTimeOption" style="height: 0">
|
||||
|
||||
<input type="hidden" name="customizeWorkshopSettingsId" id="customizeWorkshopSettingsId" value="@Model.Id"/>
|
||||
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
@if (Model.ShiftsList.Any())
|
||||
{
|
||||
@foreach (var item in Model.ShiftsList.OrderBy(x => x.Placement))
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<input type="hidden" name="shiftViewModels[@i].Placement" value="@item.Placement"/>
|
||||
<div class="timeWorkTitle">
|
||||
@if (item.Placement == ShiftPlacement.First)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (item.Placement == ShiftPlacement.Second)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="shiftViewModels[@i].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="shiftViewModels[@i].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
@if (i == 0)
|
||||
{
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<input type="hidden" name="shiftViewModels[0].Placement" value="First" />
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="shiftViewModels[0].StartTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="shiftViewModels[0].EndTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork" style="visibility: hidden">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="step_workTimeOptionIrregular" style="display: none">
|
||||
<div class="show-disorganized mt-5">
|
||||
<p class="m-0">مجموعه بدون وقفه و بصورت مستمر فعال میباشد</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<div class="container my-2">
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12">
|
||||
<div class="lableCheckBreakTime text-center">وضعیت فعالیت مجموعه در روز های جمعه و تعطیلات رسمی</div>
|
||||
<div class="row extraOptionBorder">
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
|
||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
|
||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های تعطیلات رسمی</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays1" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.Default ? "checked" : "") value="@((int)(HolidayWork.Default))"/>
|
||||
<label for="OffDays1" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays2" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.WorkInHolidays ? "checked" : "") value="@((int)(HolidayWork.WorkInHolidays))"/>
|
||||
<label for="OffDays2" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
@* <button type="button" onclick="actionForShowModalReplaceChange()" class="btn-register w-100">ثبت</button> *@
|
||||
<button type="button" onclick="saveEditSettingWorkTime()" class="btn-register w-100">ثبت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- مودال -->
|
||||
@* <div id="ConfirmEmployeeModal" style="display: none" data-bs-backdrop="static" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered ConfirmEmployeeSection">
|
||||
<div class="" id="ModalConfirmEmployeeChange">
|
||||
<partial name="_ModalWorkTimePartials/ConfirmReplaceGroupAndEmployee" />
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
<!-- مودال -->
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveEditSettingWorkTimeAjax = `@Url.Page("./Index", "EditSettingWorkTime")`;
|
||||
var getGroupListAndEmployeeListAjax = `@Url.Page("./Index", "GroupListAndEmployeeList")`;
|
||||
|
||||
var IsRegularWorkshop = @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular? "true" : "false");
|
||||
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/WorkshopSetting/js/ModalSettingWorkTime.js?ver=@clientVersion"></script>
|
||||
@@ -128,11 +128,11 @@
|
||||
$(id).toggleClass('disable', shouldDisable);
|
||||
});
|
||||
|
||||
if (shouldDisable) {
|
||||
$('#SetWorkshopWorkingHoursPageUrl a').attr('href', linkCameraAccountAndWorkshopSettingUrl);
|
||||
} else {
|
||||
$('#SetWorkshopWorkingHoursPageUrl').removeClass('disable');
|
||||
}
|
||||
// if (shouldDisable) {
|
||||
// $('#SetWorkshopWorkingHoursPageUrl a').attr('href', linkCameraAccountAndWorkshopSettingUrl);
|
||||
// } else {
|
||||
// $('#SetWorkshopWorkingHoursPageUrl').removeClass('disable');
|
||||
// }
|
||||
} else {
|
||||
$('#RollCallSubMenu').addClass('disable');
|
||||
}
|
||||
|
||||
@@ -187,8 +187,8 @@
|
||||
<li id="ListCurrentDayRollCallsPageUrl" Permission="@SubAccountPermissionHelper.ListCurrentDayRollCallsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CurrentDay"><span>حضور و غیاب جاری</span></a></li>
|
||||
<li id="ListRollCallHistoryPageUrl" Permission="@SubAccountPermissionHelper.ListRollCallHistoryPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CaseHistory"><span>سوابق حضور و غیاب</span></a></li>
|
||||
<li id="GroupingOperationsPageUrl" Permission="@SubAccountPermissionHelper.GroupingOperationsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/Grouping"><span>گروهبندی</span></a></li>
|
||||
<li id="SetWorkshopWorkingHoursPageUrl" Permission="@SubAccountPermissionHelper.SetWorkshopWorkingHoursPermissionCode"><a class="" href="#showmodal=@Url.Page("/Company/RollCall/Index", "EditSettingWorkTime")"><span>تنظیم ساعت فعالیت مجموعه</span></a></li>
|
||||
<li id="CameraAccountSettingsPageUrl" Permission="@SubAccountPermissionHelper.CameraAccountSettingsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CameraAccounts"><span>تنظیمات حساب کاربری دوربین</span></a></li>
|
||||
<li id="SetWorkshopWorkingHoursPageUrl" Permission="@SubAccountPermissionHelper.SetWorkshopWorkingHoursPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/WorkshopSetting/Index"><span>تنظیم ساعت فعالیت مجموعه</span></a></li>
|
||||
<li id="CameraAccountSettingsPageUrl" Permission="@SubAccountPermissionHelper.CameraAccountSettingsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CameraAccounts/Index"><span>تنظیمات حساب کاربری دوربین</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -305,7 +305,6 @@
|
||||
<None Include="Areas\Client\Pages\Company\Reward\Index.cshtml" />
|
||||
<None Include="Areas\Client\Pages\Company\Reward\ModalCreateNewReward.cshtml" />
|
||||
<None Include="Areas\Client\Pages\Company\Reward\ModalEditReward.cshtml" />
|
||||
<None Include="Areas\Client\Pages\Company\RollCall\CameraAccounts.cshtml" />
|
||||
<None Include="Areas\Client\Pages\Company\RollCall\CaseHistory.cshtml" />
|
||||
<None Include="Areas\Client\Pages\Company\RollCall\CurrentDay.cshtml" />
|
||||
<None Include="Areas\Client\Pages\Company\RollCall\EmployeeUploadPicture.cshtml" />
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 460px;
|
||||
width: 510px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
color: #5C5C5C;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
margin: auto 0 auto 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.groupBox {
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #E7E7E7;
|
||||
padding: 6px;
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.btnAddTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #84CC16;
|
||||
border-radius: 5px;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.btnRemoveTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F87171;
|
||||
border-radius: 7px;
|
||||
padding: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.ShowMessage {
|
||||
position: absolute;
|
||||
background: #dfdfdf;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
.btn-workTimeOption-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.radio-workTimeOption {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #0F8080;
|
||||
background-color: #DDF4F4;
|
||||
text-align: center;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
margin: auto 6px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #1c7474;
|
||||
border-color: #23A8A8;
|
||||
}
|
||||
|
||||
.radio-workTimeOption:checked + .radio-label-workTimeOption {
|
||||
color: #FFFFFF;
|
||||
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
|
||||
}
|
||||
|
||||
.show-disorganized {
|
||||
height: 81px;
|
||||
background: #F2FEFF;
|
||||
border: 1px solid #B0EBF0;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.show-disorganized p {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #1B929C;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #0F8080;
|
||||
background-color: #DDF4F4;
|
||||
text-align: center;
|
||||
padding: 8px 16px;
|
||||
border-radius: 9px;
|
||||
margin: auto 5px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #1c7474;
|
||||
border-color: #23A8A8;
|
||||
}
|
||||
|
||||
.radio-workTimeOption:checked + .radio-label-workTimeOption {
|
||||
color: #FFFFFF;
|
||||
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
|
||||
}
|
||||
|
||||
.show-disorganized {
|
||||
height: 81px;
|
||||
background: #F2FEFF;
|
||||
border: 1px solid #B0EBF0;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.show-disorganized p {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #1B929C;
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
margin: 0 10px;
|
||||
color: #101010;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.breack-time {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.extraOptionBorder {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/************************ Radio Button Input () ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
border: 1px solid #CFD3D4;
|
||||
background-color: white;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
margin-right: 8px;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked,
|
||||
.form-check-input[type="checkbox"]:checked {
|
||||
background-color: #148989;
|
||||
border: 1px solid #ffffff !important;
|
||||
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
|
||||
background-size: 75%;
|
||||
}
|
||||
|
||||
.form-check-input[type=checkbox]:indeterminate {
|
||||
background-color: #148989;
|
||||
border-color: #ffffff;
|
||||
--bs-form-check-bg-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e);
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:focus,
|
||||
.form-check-input[type="checkbox"]:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"] + label,
|
||||
.form-check-input[type="checkbox"] + label {
|
||||
color: #83898C;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked + label,
|
||||
.form-check-input[type="checkbox"]:checked + label {
|
||||
color: #2B2F32;
|
||||
}
|
||||
/************************ Radio Button Input (Like Checkbox appearance) ************************/
|
||||
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.modal-dialog, .modal-content {
|
||||
/*height: 622px;*/
|
||||
height: 600px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 10px;
|
||||
padding: 8px 8px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container, .container-sm {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 460px;
|
||||
width: 510px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
color: #5C5C5C;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
margin: auto 0 auto 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.groupBox {
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #E7E7E7;
|
||||
padding: 6px;
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.btnAddTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #84CC16;
|
||||
border-radius: 5px;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.btnRemoveTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F87171;
|
||||
border-radius: 7px;
|
||||
padding: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.ShowMessage {
|
||||
position: absolute;
|
||||
background: #dfdfdf;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
.btn-workTimeOption-container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.radio-workTimeOption {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #0F8080;
|
||||
background-color: #DDF4F4;
|
||||
text-align: center;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
margin: auto 6px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #1c7474;
|
||||
border-color: #23A8A8;
|
||||
}
|
||||
|
||||
.radio-workTimeOption:checked + .radio-label-workTimeOption {
|
||||
color: #FFFFFF;
|
||||
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
|
||||
}
|
||||
|
||||
.show-disorganized {
|
||||
height: 81px;
|
||||
background: #F2FEFF;
|
||||
border: 1px solid #B0EBF0;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.show-disorganized p {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #1B929C;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #0F8080;
|
||||
background-color: #DDF4F4;
|
||||
text-align: center;
|
||||
padding: 8px 16px;
|
||||
border-radius: 9px;
|
||||
margin: auto 5px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #1c7474;
|
||||
border-color: #23A8A8;
|
||||
}
|
||||
|
||||
.radio-workTimeOption:checked + .radio-label-workTimeOption {
|
||||
color: #FFFFFF;
|
||||
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
|
||||
}
|
||||
|
||||
.show-disorganized {
|
||||
height: 81px;
|
||||
background: #F2FEFF;
|
||||
border: 1px solid #B0EBF0;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.show-disorganized p {
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #1B929C;
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
margin: 0 10px;
|
||||
color: #101010;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.breack-time {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.extraOptionBorder {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/************************ Radio Button Input () ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
border: 1px solid #CFD3D4;
|
||||
background-color: white;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
margin-right: 8px;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked,
|
||||
.form-check-input[type="checkbox"]:checked {
|
||||
background-color: #148989;
|
||||
border: 1px solid #ffffff !important;
|
||||
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
|
||||
background-size: 75%;
|
||||
}
|
||||
|
||||
.form-check-input[type=checkbox]:indeterminate {
|
||||
background-color: #148989;
|
||||
border-color: #ffffff;
|
||||
--bs-form-check-bg-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e);
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:focus,
|
||||
.form-check-input[type="checkbox"]:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"] + label,
|
||||
.form-check-input[type="checkbox"] + label {
|
||||
color: #83898C;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked + label,
|
||||
.form-check-input[type="checkbox"]:checked + label {
|
||||
color: #2B2F32;
|
||||
}
|
||||
/************************ Radio Button Input (Like Checkbox appearance) ************************/
|
||||
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.modal-dialog, .modal-content {
|
||||
/*height: 622px;*/
|
||||
height: 600px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 10px;
|
||||
padding: 8px 8px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container, .container-sm {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
$(document).ready(function () {
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
});
|
||||
|
||||
$("#organized").on("click", function () {
|
||||
$('#step_workTimeOption').show();
|
||||
$('#step_workTimeOptionIrregular').hide();
|
||||
|
||||
if ($('#step-form2').is(':visible')) {
|
||||
$('.dateTime').each(function () {
|
||||
if ($(this).val() === '') {
|
||||
$('.btn-register').addClass('disable');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#disorganized").on("click", function () {
|
||||
$('#step_workTimeOption').hide();
|
||||
$('#step_workTimeOptionIrregular').show();
|
||||
$('.btn-register').removeClass('disable');
|
||||
});
|
||||
|
||||
|
||||
$(".btnAddTimeWork").on("click", function () {
|
||||
var currentCount = $('.groupBox').length;
|
||||
var $inputs = $('.dateTime');
|
||||
var allFilled = true;
|
||||
|
||||
$inputs.each(function () {
|
||||
if ($(this).val() === '') {
|
||||
allFilled = false;
|
||||
showAlert('ابتدا ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
}
|
||||
});
|
||||
|
||||
//validateAllTimes();
|
||||
|
||||
if (!allFilled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (currentCount < 3) {
|
||||
var namePlacement = "";
|
||||
var namePlacementPersian = "";
|
||||
|
||||
switch (currentCount + 1) {
|
||||
case 2:
|
||||
namePlacement = "Second";
|
||||
namePlacementPersian = "دوم";
|
||||
break;
|
||||
case 3:
|
||||
namePlacement = "Third";
|
||||
namePlacementPersian = "سوم";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
var timeWorkHtml = `
|
||||
<div class="groupBox timeWork">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="ShiftsList[${currentCount}].Placement" value="${namePlacement}" />
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="ShiftsList[${currentCount}].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="ShiftsList[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
const newStartTimeInput = $(`input[name="ShiftsList[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="ShiftsList[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="CreateWorkshopSettings.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="CreateWorkshopSettings.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 3) {
|
||||
$(".btnAddTimeWork").hide();
|
||||
}
|
||||
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtons();
|
||||
}
|
||||
});
|
||||
$(document).on("click", ".btnRemoveTimeWork", function () {
|
||||
$(this).closest(".groupBox").remove();
|
||||
var currentCount = $('.groupBox').length;
|
||||
|
||||
updateAddButtonText(currentCount);
|
||||
updateRemoveButtons();
|
||||
|
||||
if (currentCount < 3) {
|
||||
$(".btnAddTimeWork").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function updateRemoveButtons() {
|
||||
$(".btnRemoveTimeWork").addClass("disable");
|
||||
$(".btnRemoveTimeWork").last().removeClass("disable");
|
||||
}
|
||||
|
||||
updateAddButtonText(1);
|
||||
function updateAddButtonText(currentCount) {
|
||||
if (currentCount === 1) {
|
||||
$('.btnAppendChildTimeWork').text('افزودن نوبت دوم');
|
||||
} else if (currentCount === 2) {
|
||||
$('.btnAppendChildTimeWork').text('افزودن نوبت سوم');
|
||||
}
|
||||
|
||||
let allFilled = true;
|
||||
$('.dateTime').each(function () {
|
||||
const value = $(this).val().trim();
|
||||
if (value === "" || !timeValidCheck(value)) {
|
||||
allFilled = false;
|
||||
return false; // Break the loop
|
||||
}
|
||||
});
|
||||
|
||||
if (allFilled) {
|
||||
$('.btn-register').removeClass('disable');
|
||||
} else {
|
||||
$('.btn-register').addClass('disable');
|
||||
}
|
||||
}
|
||||
|
||||
//******************** برای نوشتن تاریخ ********************
|
||||
|
||||
//$(document).on('input', ".dateTime", function () {
|
||||
// var value = $(this).val();
|
||||
// $(this).val(convertPersianNumbersToEnglish(value)).mask("00:00");
|
||||
//});
|
||||
|
||||
$(document).on('keyup', ".dateTime", function () {
|
||||
let $input = $(this);
|
||||
let value = $input.val();
|
||||
let lengthValue = value.length;
|
||||
let currentCount = $('.groupBox').length;
|
||||
|
||||
if (lengthValue >= 5) {
|
||||
if (!timeValidCheck(value)) {
|
||||
showAlert('ساعت را به درستی وارد نمائید', $input);
|
||||
updateAddButtonText(currentCount);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
//validateAllTimes();
|
||||
updateAddButtonText(currentCount);
|
||||
|
||||
}
|
||||
} else {
|
||||
updateAddButtonText(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
function showAlert(message, inputElement) {
|
||||
inputElement.addClass("errored");
|
||||
$('.alert-msg').show().find('p').text(message);
|
||||
setTimeout(function () {
|
||||
clearAlert(inputElement);
|
||||
}, 3500);
|
||||
}
|
||||
|
||||
function clearAlert(inputElement) {
|
||||
inputElement.removeClass("errored");
|
||||
$('.alert-msg').hide().find('p').text('');
|
||||
}
|
||||
|
||||
function timeValidCheck(value) {
|
||||
const timePattern = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
||||
return timePattern.test(value);
|
||||
}
|
||||
|
||||
//******************** برای نوشتن تاریخ ********************
|
||||
|
||||
function saveNewWorkshopSetting() {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: saveNewWorkshopSettingUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: $('#create-form').serialize(),
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 3500);
|
||||
window.location.reload();
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
var isTabPressed = false;
|
||||
$(document).ready(function () {
|
||||
updateRemoveButtons();
|
||||
|
||||
$('.loading').hide();
|
||||
|
||||
$(".dateTime").on("blur", function () {
|
||||
var valueCheck = $(this).val().trim();
|
||||
if (valueCheck === "" || !timeValidCheck(valueCheck)) {
|
||||
$(this).addClass("errored");
|
||||
}
|
||||
});
|
||||
|
||||
//$(".dateTime").on("keydown", function (e) {
|
||||
// if (e.key === "Tab" && !e.shiftKey) {
|
||||
// e.preventDefault();
|
||||
// isTabPressed = true;
|
||||
|
||||
// if (e.shiftKey) {
|
||||
// focusPreviousTimeInput(this);
|
||||
// } else {
|
||||
// focusNextTimeInput(this);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
if (IsRegularWorkshop) {
|
||||
|
||||
$("#organized").prop('checked', true);
|
||||
$("#disorganized").prop('checked', false);
|
||||
$('#step_workTimeOption').show();
|
||||
$('#step_workTimeOptionIrregular').hide();
|
||||
|
||||
// این مرحله هنگام چک کردن تعداد نوبت هستش
|
||||
var currentCount = $('.groupBox').length;
|
||||
updateAddButtonText(currentCount);
|
||||
} else {
|
||||
$("#organized").prop('checked', false);
|
||||
$("#disorganized").prop('checked', true);
|
||||
$('#step_workTimeOption').hide();
|
||||
$('#step_workTimeOptionIrregular').show();
|
||||
}
|
||||
|
||||
$("#organized").on("click", function () {
|
||||
$('#step_workTimeOption').show();
|
||||
$('#step_workTimeOptionIrregular').hide();
|
||||
|
||||
if ($('#step_workTimeOption').is(':visible')) {
|
||||
$('.dateTime').each(function () {
|
||||
if ($(this).val() === '') {
|
||||
var currentCount = $('.groupBox').length;
|
||||
updateAddButtonText(currentCount);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#disorganized").on("click", function () {
|
||||
$('#step_workTimeOption').hide();
|
||||
$('#step_workTimeOptionIrregular').show();
|
||||
$('.btn-register').removeClass('disable');
|
||||
});
|
||||
|
||||
// ----------------------------------------
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
});
|
||||
$(".btnAddTimeWork").on("click", function () {
|
||||
var currentCount = $('.groupBox').length;
|
||||
var $inputs = $('.dateTime');
|
||||
var allFilled = true;
|
||||
|
||||
$inputs.each(function () {
|
||||
if ($(this).val() === '') {
|
||||
allFilled = false;
|
||||
showAlert('ابتدا ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
}
|
||||
});
|
||||
|
||||
//validateAllTimes();
|
||||
|
||||
if (!allFilled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (currentCount < 3) {
|
||||
var namePlacement = "";
|
||||
var namePlacementPersian = "";
|
||||
|
||||
switch (currentCount + 1) {
|
||||
case 2:
|
||||
namePlacement = "Second";
|
||||
namePlacementPersian = "دوم";
|
||||
break;
|
||||
case 3:
|
||||
namePlacement = "Third";
|
||||
namePlacementPersian = "سوم";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
var timeWorkHtml = `
|
||||
<div class="groupBox timeWork">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<input type="hidden" name="shiftViewModels[${currentCount}].Placement" value="${namePlacement}" />
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="shiftViewModels[${currentCount}].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="shiftViewModels[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
const newStartTimeInput = $(`input[name="shiftViewModels[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="shiftViewModels[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="shiftViewModels[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="shiftViewModels[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 3) {
|
||||
$(".btnAddTimeWork").hide();
|
||||
}
|
||||
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtons();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".btnRemoveTimeWork", function () {
|
||||
$(this).closest(".groupBox").remove();
|
||||
var currentCount = $('.groupBox').length;
|
||||
|
||||
updateAddButtonText(currentCount);
|
||||
|
||||
if (currentCount < 3) {
|
||||
$(".btnAddTimeWork").show();
|
||||
}
|
||||
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtons();
|
||||
});
|
||||
});
|
||||
|
||||
function updateRemoveButtons() {
|
||||
$(".btnRemoveTimeWork").addClass("disable");
|
||||
$(".btnRemoveTimeWork").last().removeClass("disable");
|
||||
}
|
||||
|
||||
//updateAddButtonText(1);
|
||||
function updateAddButtonText(currentCount) {
|
||||
if (currentCount === 1) {
|
||||
$('.btnAppendChildTimeWork').text('افزودن نوبت دوم');
|
||||
$('.btnAddTimeWork').css('visibility', 'visible');
|
||||
} else if (currentCount === 2) {
|
||||
$('.btnAppendChildTimeWork').text('افزودن نوبت سوم');
|
||||
$('.btnAddTimeWork').css('visibility', 'visible');
|
||||
} else {
|
||||
$('.btnAddTimeWork').css('visibility', 'hidden');
|
||||
}
|
||||
|
||||
let allFilled = true;
|
||||
$('.dateTime').each(function () {
|
||||
const value = $(this).val().trim();
|
||||
if (value === "" || !timeValidCheck(value)) {
|
||||
allFilled = false;
|
||||
return false; // Break the loop
|
||||
}
|
||||
});
|
||||
|
||||
if (allFilled) {
|
||||
$('.btn-register').removeClass('disable');
|
||||
} else {
|
||||
$('.btn-register').addClass('disable');
|
||||
}
|
||||
}
|
||||
|
||||
//******************** برای نوشتن تاریخ ********************
|
||||
|
||||
$(document).on('keyup', ".dateTime", function () {
|
||||
let $input = $(this);
|
||||
let value = $input.val();
|
||||
let lengthValue = value.length;
|
||||
let currentCount = $('.groupBox').length;
|
||||
|
||||
if (isTabPressed) {
|
||||
isTabPressed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (lengthValue >= 5) {
|
||||
if (!timeValidCheck(value)) {
|
||||
showAlert('ساعت را به درستی وارد نمائید', $input);
|
||||
updateAddButtonText(currentCount);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
updateAddButtonText(currentCount);
|
||||
}
|
||||
} else {
|
||||
updateAddButtonText(currentCount);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function showAlert(message, inputElement) {
|
||||
inputElement.addClass("errored");
|
||||
$('.alert-msg').show().find('p').text(message);
|
||||
setTimeout(function () {
|
||||
clearAlert(inputElement);
|
||||
}, 3500);
|
||||
}
|
||||
|
||||
function clearAlert(inputElement) {
|
||||
inputElement.removeClass("errored");
|
||||
$('.alert-msg').hide().find('p').text('');
|
||||
}
|
||||
|
||||
function timeValidCheck(value) {
|
||||
const timePattern = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
||||
return timePattern.test(value);
|
||||
}
|
||||
|
||||
function actionForShowModalReplaceChange() {
|
||||
var htmlEmployeeItem = '';
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: getGroupListAndEmployeeListAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { 'customizeWorkshopSettingsId': $('#customizeWorkshopSettingsId').val() },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('#ConfirmEmployeeModal').show();
|
||||
|
||||
response.data.forEach(function (itemEmployee) {
|
||||
htmlEmployeeItem += `<li>${itemEmployee.groupName}</li>`;
|
||||
if (itemEmployee.employeeName.length > 0) {
|
||||
htmlEmployeeItem += `<ul>`;
|
||||
itemEmployee.employeeName.forEach(function (itemEmployeeName) {
|
||||
htmlEmployeeItem += `<li>${itemEmployeeName}</li>`;
|
||||
});
|
||||
htmlEmployeeItem += `</ul>`;
|
||||
}
|
||||
});
|
||||
|
||||
$('#loadEmployeeItem').html(htmlEmployeeItem);
|
||||
} else {
|
||||
saveEditSettingWorkTime();
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveEditSettingWorkTime() {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: saveEditSettingWorkTimeAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: $('#create-form').serialize(),
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -121,4 +121,15 @@
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #1B929C;
|
||||
}
|
||||
}
|
||||
|
||||
.profilePasswordModal .modal-header h5 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 16px;
|
||||
color: #1F2937;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ $(document).ready(function () {
|
||||
if (response.hasRollCallService) {
|
||||
if (!response.hasCameraAccount || !response.hasRollCallWorkshopSetting) {
|
||||
//window.location.href = saveCameraAccountUrl;
|
||||
AjaxUrlContentModal(saveCameraAccountUrl);
|
||||
//AjaxUrlContentModal(saveCameraAccountUrl);
|
||||
AjaxUrlContentModal(modalCreateCameraAccountUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user