1427 lines
66 KiB
Plaintext
1427 lines
66 KiB
Plaintext
@page
|
||
@model ServiceHost.Areas.Admin.Pages.Company.Representative.IndexModel
|
||
|
||
@{
|
||
//string colaps = "in";
|
||
//string act = "active";
|
||
int i = 1;
|
||
}
|
||
|
||
@{
|
||
Layout = "Shared/_AdminLayout";
|
||
ViewData["title"] = "معرف";
|
||
<style>
|
||
.thh0 {
|
||
width: 8px !important;
|
||
}
|
||
|
||
.thh {
|
||
width: 40px !important;
|
||
}
|
||
|
||
.thh2 {
|
||
width: 130px !important;
|
||
}
|
||
|
||
.thhNastionalId {
|
||
width: 30px !important;
|
||
}
|
||
|
||
.inpt {
|
||
width: 100%;
|
||
border: 1px solid #c7c7c7;
|
||
}
|
||
#datatable td {
|
||
position: relative;
|
||
}
|
||
.searchpanel {
|
||
background-color: #747272;
|
||
}
|
||
select {
|
||
cursor: pointer;
|
||
}
|
||
.sizeSet {
|
||
padding: 2px !important;
|
||
text-align: center !important;
|
||
}
|
||
.rad {
|
||
border-radius: 8px !important;
|
||
padding: 10px;
|
||
padding: 2px 5px 0px 5px;
|
||
}
|
||
.faSize {
|
||
font-size: 22px !important;
|
||
}
|
||
|
||
@*select2 css start*@
|
||
::-webkit-scrollbar {
|
||
width: 8px;
|
||
}
|
||
|
||
::-webkit-scrollbar-track {
|
||
background: #dfdfdf;
|
||
border-radius: 5px;
|
||
}
|
||
|
||
::-webkit-scrollbar-thumb {
|
||
background: #b991b9;
|
||
border-radius: 5px;
|
||
}
|
||
.opt {
|
||
background-color: #fff7ff;
|
||
border-radius: 10px;
|
||
text-align: right;
|
||
padding: 2px 5px;
|
||
text-overflow: ellipsis;
|
||
overflow-x: hidden;
|
||
width: 100%;
|
||
}
|
||
.noResult{
|
||
background-color: #fff7ff;
|
||
border-radius: 10px;
|
||
text-align: right;
|
||
padding: 2px 5px;
|
||
}
|
||
.opt:hover ,.noResult:hover{
|
||
background-color: #ddcadd !important;
|
||
}
|
||
.selectDiv {
|
||
position: relative;
|
||
z-index: 2;
|
||
border-radius: 10px;
|
||
min-height: 20px;
|
||
max-height: 190px;
|
||
overflow: hidden scroll;
|
||
width: 100%;
|
||
background-color: rgb(255 255 255);
|
||
display: block;
|
||
box-shadow: 0px -1px 12px 0px rgba(0,0,0,.16), 2px 1px 10px 0 rgba(0,0,0,.12);
|
||
}
|
||
|
||
.selectedOption {
|
||
color: #343434 !important;
|
||
background-color: #fff0ff !important;
|
||
}
|
||
|
||
.keyboardSelected {
|
||
color: #343434 !important;
|
||
background-color: #ddcadd !important;
|
||
}
|
||
@*button container start*@
|
||
@@keyframes buttonsContainerIn {
|
||
0% {
|
||
transform: translateX(-150px);
|
||
}
|
||
|
||
100% {
|
||
transform: translateX(0);
|
||
}
|
||
}
|
||
@@keyframes buttonsContainerOut {
|
||
0% {
|
||
transform: translateX(0);
|
||
}
|
||
|
||
100% {
|
||
transform: translateX(-150px);
|
||
}
|
||
}
|
||
.tooltipfullBtns {
|
||
opacity: 0;
|
||
z-index: 1;
|
||
color: #ffffff;
|
||
display: block;
|
||
font-size: 12px;
|
||
padding: 5px 10px;
|
||
border-radius: 15px;
|
||
text-align: center;
|
||
background: #fbb306;
|
||
border: 1px solid #fbb306;
|
||
box-shadow: 0 0 11px rgb(139 139 139 / 79%);
|
||
-webkit-transition: all .2s ease-in-out;
|
||
-moz-transition: all .2s ease-in-out;
|
||
-o-transition: all .2s ease-in-out;
|
||
transition: all .2s ease-in-out;
|
||
-webkit-transform: scale(0);
|
||
-moz-transform: scale(0);
|
||
-o-transform: scale(0);
|
||
-ms-transform: scale(0);
|
||
transform: scale(0);
|
||
position: absolute;
|
||
right: -35px;
|
||
bottom: 40px;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.tooltipfullBtns:before, .tooltipfullBtns:after {
|
||
content: '';
|
||
border-left: 7px solid transparent;
|
||
border-right: 7px solid transparent;
|
||
border-top: 10px solid #fbb306;
|
||
position: absolute;
|
||
bottom: -10px;
|
||
left: 40%;
|
||
}
|
||
table.dataTable thead .sorting:after,
|
||
table.dataTable thead .sorting_desc:after ,
|
||
table.dataTable thead .sorting_asc:after {
|
||
opacity: 0;
|
||
display: none;
|
||
}
|
||
.ellipsed{
|
||
display: block;
|
||
width: 100%;
|
||
text-overflow: ellipsis;
|
||
overflow-x: clip;
|
||
white-space: nowrap;
|
||
}
|
||
.tooltipfull-container {
|
||
cursor: pointer;
|
||
position: absolute;
|
||
display: inline-block;
|
||
right: 9px;
|
||
top: 13px;
|
||
}
|
||
.tooltipfull {
|
||
opacity: 0;
|
||
z-index: 99;
|
||
color: #fff;
|
||
width: fit-content;
|
||
white-space: nowrap;
|
||
display: block;
|
||
font-size: 12px;
|
||
font-family: 'IranSans';
|
||
padding: 5px 10px;
|
||
border-radius: 15px;
|
||
text-align: center;
|
||
/* text-shadow: 1px 1px 2px #111; */
|
||
background: #524651;
|
||
border: 1px solid #524651;
|
||
box-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||
-webkit-transition: all .2s ease-in-out;
|
||
-moz-transition: all .2s ease-in-out;
|
||
-o-transition: all .2s ease-in-out;
|
||
/* -ms-transition: all .2s ease-in-out; */
|
||
transition: all .2s ease-in-out;
|
||
-webkit-transform: scale(0);
|
||
-moz-transform: scale(0);
|
||
-o-transform: scale(0);
|
||
-ms-transform: scale(0);
|
||
transform: scale(0);
|
||
position: absolute;
|
||
right: -2px;
|
||
bottom: 30px;
|
||
}
|
||
|
||
.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull {
|
||
opacity: 1;
|
||
-webkit-transform: scale(1);
|
||
-moz-transform: scale(1);
|
||
-o-transform: scale(1);
|
||
-ms-transform: scale(1);
|
||
transform: scale(1);
|
||
}
|
||
|
||
.tooltipfull:before, .tooltipfull:after {
|
||
content: '';
|
||
border-left: 10px solid transparent;
|
||
border-right: 10px solid transparent;
|
||
border-top: 10px solid #524651;
|
||
position: absolute;
|
||
bottom: -10px;
|
||
right: 20px;
|
||
}
|
||
.fulltext {
|
||
opacity: 0;
|
||
white-space: nowrap;
|
||
}
|
||
.buttons-container.active {
|
||
opacity: 1;
|
||
animation: roadRunnerIn 0.3s cubic-bezier(0.165, 0.840, 0.440, 1.000) forwards;
|
||
}
|
||
|
||
.buttons-container.reverse {
|
||
/*transform: translateX(-150px);*/
|
||
transition: opacity 0.3s ease-out;
|
||
animation: roadRunnerOut 0.2s cubic-bezier(0.165, 0.840, 0.440, 1.000) forwards;
|
||
}
|
||
@@keyframes roadRunnerIn {
|
||
0% {
|
||
transform: translateX(-150px) skewX(30deg) scaleX(1.3);
|
||
}
|
||
|
||
70% {
|
||
transform: translateX(30px) skewX(0deg) scaleX(.9);
|
||
}
|
||
|
||
100% {
|
||
transform: translateX(0px) skewX(0deg) scaleX(1);
|
||
}
|
||
}
|
||
|
||
@@keyframes roadRunnerOut {
|
||
0% {
|
||
transform: translateX(0px) skewX(0deg) scaleX(1);
|
||
}
|
||
|
||
30% {
|
||
transform: translateX(-50px) skewX(0deg) scaleX(.9);
|
||
}
|
||
|
||
100% {
|
||
transform: translateX(-150px) skewX(30deg) scaleX(1.3);
|
||
}
|
||
}
|
||
.addActualEmployer {
|
||
background-color: #f5f5f5;
|
||
border-color: #0f9500;
|
||
font-family: 'Web_Yekan' !important;
|
||
color: #0f9500 !important;
|
||
border-radius: 2em;
|
||
border-top-left-radius: 0px;
|
||
border-bottom-left-radius: 0px;
|
||
}
|
||
|
||
.addLegalEmployer {
|
||
background-color: #f5f5f5;
|
||
border-color: #1d92e5;
|
||
font-family: 'Web_Yekan' !important;
|
||
color: #1d92e5 !important;
|
||
border-radius: 2em;
|
||
border-top-right-radius: 0px;
|
||
border-bottom-right-radius: 0px;
|
||
}
|
||
.addActualEmployer:hover, .addActualEmployer:focus {
|
||
background-color: #f5f5f5;
|
||
border-color: #0f9500;
|
||
color: #0f9500 !important;
|
||
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
|
||
}
|
||
.addLegalEmployer:hover, .addLegalEmployer:focus {
|
||
background-color: #f5f5f5;
|
||
border-color: #1d92e5;
|
||
color: #1d92e5 !important;
|
||
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
|
||
}
|
||
.flexible-div {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: left;
|
||
}
|
||
.operationBtns {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-evenly;
|
||
}
|
||
.buttons-container {
|
||
opacity: 0;
|
||
display: none;
|
||
position: absolute;
|
||
background: #ffffffe0;
|
||
box-shadow: 0 0 6px 0px #939393;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
padding: 10px 0px;
|
||
width: 6rem;
|
||
/*right: -10rem;*/
|
||
height: auto;
|
||
border-radius: 10px;
|
||
justify-content: center;
|
||
transform: translateX(-150px);
|
||
z-index: 99;
|
||
/*animation: roadRunnerIn .3s cubic-bezier(0.165, 0.840, 0.440, 1.000) forwards;*/
|
||
}
|
||
.op-td {
|
||
max-width: 300px;
|
||
position: relative;
|
||
}
|
||
.employee-operations {
|
||
background: #1e88b3;
|
||
color: #ffffff;
|
||
width: 7rem;
|
||
padding: 7px 8px;
|
||
font-size: 12px;
|
||
position: relative;
|
||
border-radius: 8px !important;
|
||
animation: blink 1s infinite;
|
||
}
|
||
@@keyframes blink{
|
||
0% {
|
||
background: #1886b3;
|
||
}
|
||
50% {
|
||
background: #2594c1;
|
||
}
|
||
100% {
|
||
background: #1886b3;
|
||
}
|
||
}
|
||
.employee-operations:hover,
|
||
.employee-operations:focus,
|
||
.employee-operations:active {
|
||
background: #1482af;
|
||
color: white;
|
||
}
|
||
|
||
.employee-operations:before {
|
||
content: '';
|
||
border-top: 6px solid transparent;
|
||
border-bottom: 6px solid transparent;
|
||
position: absolute;
|
||
left: 69px;
|
||
top: 8px;
|
||
border-left: 13px solid #1e88b3;
|
||
}
|
||
|
||
.more-buttons.active .employee-operations:before {
|
||
opacity: 1;
|
||
}
|
||
|
||
.more-buttons .employee-operations:before {
|
||
opacity: 0;
|
||
}
|
||
.operationBtns a i.fa-trash {
|
||
transform: translate(-1px, -1px);
|
||
}
|
||
.operationBtns a i.fa-info-circle {
|
||
color: #26731c;
|
||
transform: translate(-1px, 0px);
|
||
}
|
||
.btn-table-block, .btn-table-details{
|
||
color: #ffffff;
|
||
width: 15rem;
|
||
height: 4.2rem;
|
||
box-shadow: 0 0 3px 0 black;
|
||
margin: 4px 0;
|
||
font-size: 11px;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.btn-table-block i, .btn-table-details i{
|
||
font-size: 22px;
|
||
margin: 0 0px 0 7px;
|
||
}
|
||
.mobile-view{
|
||
display:none;
|
||
}
|
||
.screen-view {
|
||
display: flex;
|
||
}
|
||
table.dataTable thead > tr > th {
|
||
padding: 8px;
|
||
}
|
||
.searchOne, .searchOne:hover, .searchOne:focus{
|
||
border-bottom-left-radius: 0px;
|
||
border-top-left-radius: 0px;
|
||
background-color: #1b9998;
|
||
border-color: #1b9998;
|
||
font-family: 'Web_Yekan' !important;
|
||
margin-left: -3px;
|
||
}
|
||
.searchAll, .searchAll:hover , .searchAll:focus , .searchAll:active{
|
||
border-bottom-right-radius: 0px;
|
||
border-top-right-radius: 0px;
|
||
background-color: #545353;
|
||
border-color: #545353;
|
||
font-family: 'Web_Yekan' !important;
|
||
}
|
||
.searchOne i{
|
||
padding-left: 3px;
|
||
font-size: 14px;
|
||
}
|
||
.name-td {
|
||
font-family: 'Web_Yekan' !important;
|
||
font-size: 14px !important;
|
||
max-width: 100px;
|
||
position: relative;
|
||
}
|
||
.code-td{
|
||
font-size: 14px !important;
|
||
}
|
||
#activing , .employerType{
|
||
height: 33px;
|
||
}
|
||
.mobile-view .buttons-container i ,.mobile-view .buttons-container i.fa-trash{
|
||
transform: translate(4px, -2px);
|
||
}
|
||
.btn-table {
|
||
border-radius: 8px !important;
|
||
padding: 2px 5px 0px 5px;
|
||
border-radius: 8px;
|
||
padding: 4px 8px;
|
||
font-size: 20px;
|
||
}
|
||
.details , .details:hover , .details:focus{
|
||
background: #176a0c;
|
||
color: white;
|
||
border: 1px solid #176a0c;
|
||
}
|
||
@@media(max-width: 768px){
|
||
.top-btns {
|
||
display: flex;
|
||
justify-content: space-around;
|
||
}
|
||
.name-td ,.code-td{
|
||
font-size: 12px !important;
|
||
}
|
||
table.dataTable thead > tr > th {
|
||
padding-left: 0px;
|
||
padding-right: 0px;
|
||
text-align: center;
|
||
font-size: 12px;
|
||
}
|
||
.employee-operations {
|
||
background: #2fb2ed;
|
||
width: 3rem;
|
||
font-size: 12px;
|
||
}
|
||
.xs-middle {
|
||
margin: auto;
|
||
float: none;
|
||
display: flex;
|
||
justify-content: center;
|
||
column-gap: 4px;
|
||
}
|
||
.xs-middle .btn-rounded {
|
||
padding: 6px 5px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.employee-operations:before {
|
||
left: 28px;
|
||
}
|
||
div.dataTables_length, div.dataTables_filter{
|
||
display: none;
|
||
}
|
||
.pagination>li>a{
|
||
padding: 6px 10px;
|
||
}
|
||
div.dataTables_paginate ul.pagination {
|
||
font-size: 10px;
|
||
padding: 0;
|
||
}
|
||
.searchButtons{
|
||
flex-wrap: wrap;
|
||
}
|
||
.addLegalEmployer, .addActualEmployer{
|
||
border-top-right-radius: 2em;
|
||
border-bottom-right-radius: 2em;
|
||
border-top-left-radius: 2em;
|
||
border-bottom-left-radius: 2em;
|
||
padding: 5px 3px;
|
||
font-size: 12px;
|
||
}
|
||
.addActualEmployer{
|
||
margin-left: 5px;
|
||
}
|
||
.mobile-view {
|
||
display: flex;
|
||
}
|
||
.screen-view {
|
||
display: none;
|
||
}
|
||
.fa-minus-circle {
|
||
font-size: 15px;
|
||
transform: translate(2px, -1px);
|
||
}
|
||
.btn-table {
|
||
margin: 3px 5px;
|
||
border-radius: 8px;
|
||
padding: 5px;
|
||
box-shadow: 0 0 6px 0px #838383;
|
||
font-size: 18px;
|
||
width: 4rem;
|
||
}
|
||
.buttons-container {
|
||
padding: 2px 0px;
|
||
}
|
||
.partyType{
|
||
margin-right: 0;
|
||
margin-left: 0px;
|
||
padding: 0;
|
||
}
|
||
.form-control{
|
||
font-size: 11px;
|
||
}
|
||
.right-one {
|
||
padding-left: 0;
|
||
}
|
||
.left-one {
|
||
padding-right: 0;
|
||
}
|
||
#activing{
|
||
padding: 0;
|
||
}
|
||
.searchOne{
|
||
margin-left: -4px;
|
||
}
|
||
.searchOne, .searchAll {
|
||
padding: 6px 9px;
|
||
font-size: 10px;
|
||
}
|
||
.searchOne i, #activing, .employerType {
|
||
font-size: 10px;
|
||
}
|
||
}
|
||
</style>
|
||
|
||
}
|
||
|
||
@section Styles
|
||
{
|
||
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet" />
|
||
}
|
||
|
||
|
||
@{
|
||
|
||
var selctedOption = "selectedOption";
|
||
}
|
||
|
||
|
||
<div class="row">
|
||
|
||
|
||
<div class="row">
|
||
<div class="col-md-12 m-r-10">
|
||
<div class="col-md-12 m-r-10 top-btns">
|
||
<p class="pull-right">
|
||
<a permission="10110" href="#showmodal=@Url.Page("./Index", "CreateReal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 addActualEmployer"> <i class="fa fa-user-plus"></i> ایجاد معرف حقیقی </a>
|
||
|
||
</p>
|
||
<p class="pull-right">
|
||
<a permission="10111" href="#showmodal=@Url.Page("./Index", "CreateLegal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 addLegalEmployer"> <i class="fa fa-group"></i> ایجاد معرف حقوقی </a>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-12">
|
||
<div permission="10112" class="panel-group panel-group-joined" id="accordion-test">
|
||
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #d5e5e5">
|
||
<div class="panel-heading" style="background-color: #1b9998 !important;">
|
||
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
|
||
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
|
||
جستجوی معرف
|
||
</a>
|
||
</h4>
|
||
</div>
|
||
<div id="collapseOne" class="panel-collapse collapse in ">
|
||
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
|
||
@*===================================================================================================================*@
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<form class="form-inline" role="form" method="get" autocomplete="off">
|
||
<div class="form-group col-lg-12">
|
||
<div class="row">
|
||
<div class="col-md-3 col-sm-6 col-xs-6 pull-right right-one" style="height: 40px">
|
||
<label class="sr-only" asp-for="SearchModel.FName"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.FullName" placeholder="نام و نام خانوادگی / نام شرکت " style="width: 100%">
|
||
</div>
|
||
@* <div class="col-lg-3 pull-right">
|
||
<label class="sr-only" asp-for="SearchModel.LName"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.LName" placeholder="نام خانوادگی " style="width: 100%">
|
||
</div> *@
|
||
<div class="col-md-3 col-sm-6 col-xs-6 pull-right left-one" style="height: 40px">
|
||
<label class="sr-only" asp-for="SearchModel.Nationalcode"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.Nationalcode" placeholder=" شناسه ملی / شماره ملی " style="width: 100%">
|
||
</div>
|
||
<div class="col-md-3 col-sm-6 col-xs-6 pull-right right-one" style="height: 40px">
|
||
|
||
<label class="sr-only" asp-for="SearchModel.IdNumber"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.IdNumber" placeholder="شماره شناسنامه " style="width: 100%">
|
||
</div>
|
||
<div class="col-md-3 col-sm-6 col-xs-6 pull-right left-one" dir="rtl" style="height:40px;">
|
||
@* <div class="form-group" style="width: 100% !important; margin: 0 auto;">
|
||
<label class="sr-only" asp-for="SearchModel.ContractingPartyID"></label>
|
||
<select class="form-control select-city" asp-for="SearchModel.ContractingPartyID" asp-items="Model.ContactingParties" style="width: 100% !important">
|
||
<option value=""> </option>
|
||
</select>
|
||
</div> *@
|
||
|
||
|
||
<label class="sr-only"></label>
|
||
<input type="hidden" class="sendContractingPartyID" asp-for="SearchModel.ContractingPartyId" />
|
||
<input type="hidden" asp-for="SearchModel.ContractingPartyName" />
|
||
<input type="search" id="empSearchContractingPartyID" value="@Model.ContractingPartyName" class="form-control @{
|
||
if(!string.IsNullOrWhiteSpace(@Model.ContractingPartyName)){
|
||
@selctedOption
|
||
}
|
||
} " autocomplete="off" placeholder=" طرف حساب " style="width: 100%;position: relative">
|
||
<div id="empContractingPartyID" class="selectDiv" style="display: none;">
|
||
<ul class="searchResultContractingPartyID m-t-10" style="list-style-type: none; padding: 5px">
|
||
</ul>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
|
||
|
||
@* <div class="col-lg-3 pull-right">
|
||
<label class="sr-only" asp-for="SearchModel.LegalName"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.LegalName" placeholder="نام شرکت حقوقی " style="width: 100%">
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
<label class="sr-only" asp-for="SearchModel.NationalId"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.NationalId" placeholder="شناسه ملی" style="width: 100%">
|
||
</div>
|
||
<div class="col-lg-3 pull-right">
|
||
<label class="sr-only" asp-for="SearchModel.RegisterId"></label>
|
||
<input class="form-control inpt" asp-for="SearchModel.RegisterId" placeholder=" شماره ثبت" style="width: 100%">
|
||
</div>*@
|
||
|
||
|
||
<div class="row" style="margin-top: 15px">
|
||
<div class="col-lg-9 col-xs-6" style="display: flex;padding-right: 0;">
|
||
<select id="activing" class="form-control" asp-for="SearchModel.IsActive" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
|
||
<option value=""> فعال </option>
|
||
<option value="false"> غیرفعال</option>
|
||
<option value="both"> هردو</option>
|
||
</select>
|
||
<label class="sr-only" asp-for="SearchModel.IsLegal"></label>
|
||
<select class="form-control employerType" asp-for="SearchModel.IsLegal" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
|
||
<option value="both"> حقیقی و حقوقی </option>
|
||
<option value="true"> حقوقی</option>
|
||
<option value="false"> حقیقی</option>
|
||
</select>
|
||
</div>
|
||
<div class="col-lg-3 col-xs-6" style="padding-left: 0;">
|
||
<a href="#" class="btn btn-searchRepresentative btn-success btn-rounded waves-effect waves-light m-b-5 search searchOne"> <i class="fa fa-search"></i> جستجو</a>
|
||
<button id="btnSearch" type="submit" style="display:none" >جستجو</button>
|
||
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5 searchAll" style="" asp-page="./Index">حذف فیلتر </a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
@*==================================================================personal=====*@
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-12">
|
||
<div permission="10113" class="panel panel-default">
|
||
<div class="panel-heading" style="background-color: #1b9998 !important;">
|
||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست معرف ها</h3>
|
||
</div>
|
||
<div class="panel-body">
|
||
<div class="row">
|
||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||
<table id="datatable" class="table table-striped table-bordered">
|
||
<thead>
|
||
<tr>
|
||
<th style="text-align: center; font-size: 12px !important;" class="sorting_asc_disabled sorting_desc_disabled">#</th>
|
||
<th style="text-align: center; font-size: 12px !important" class="sorting_asc_disabled sorting_desc_disabled">نام حقیقی / نام حقوقی</th>
|
||
<th style="text-align: center; font-size: 12px !important" class="sorting_asc_disabled sorting_desc_disabled">کد/ شناسه ملی</th>
|
||
<th style="text-align: center; font-size: 12px !important;max-width: 100px;text-align: center;" class="sorting_asc_disabled sorting_desc_disabled">عملیات</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach (var item in Model.personals)
|
||
{
|
||
<tr>
|
||
<td style="font-size: 12px !important; text-align: center;">@i </td>
|
||
<td class="name-td">
|
||
<span class="ellipsed">
|
||
@item.FullName
|
||
</span>
|
||
<div class="tooltipfull-container">
|
||
<p class="fulltext">
|
||
@item.FullName
|
||
</p>
|
||
<span class="tooltipfull">
|
||
@item.FullName
|
||
</span>
|
||
</div>
|
||
</td>
|
||
<td class="code-td" style="text-align: center;">
|
||
<span class="ellipsed">
|
||
@if (item.IsLegal == "false")
|
||
{
|
||
@item.Nationalcode
|
||
}
|
||
else
|
||
{
|
||
@item.NationalId
|
||
}
|
||
</span>
|
||
<div class="tooltipfull-container">
|
||
<p class="fulltext">
|
||
@if (item.IsLegal == "false")
|
||
{
|
||
@item.Nationalcode
|
||
}
|
||
else
|
||
{
|
||
@item.NationalId
|
||
}
|
||
</p>
|
||
<span class="tooltipfull">
|
||
@if (item.IsLegal == "false")
|
||
{
|
||
@item.Nationalcode
|
||
}
|
||
else
|
||
{
|
||
@item.NationalId
|
||
}
|
||
</span>
|
||
</div>
|
||
</td>
|
||
@{
|
||
i++;
|
||
}
|
||
<td style="text-align:left;direction: ltr;">
|
||
<div class="operation-td screen-view">
|
||
@if (item.IsActive == "true")
|
||
{
|
||
<a href="#" onclick="remove(@item.Id)" class="btn btn-table btn-danger pull-left m-rl-5 rad"> <i class="fa faSize fa-trash"></i></a>
|
||
}
|
||
else
|
||
{
|
||
<a href="#" onclick="acitve(@item.Id)" class="btn btn-table btn-success pull-left m-rl-5 rad"> <i class="fa faSize fa-rotate-left"></i></a>
|
||
}
|
||
@if (item.IsLegal == "false")
|
||
{
|
||
<a class="btn btn-warning btn-table pull-left m-rl-5 rad" permission="10114"
|
||
href="#showmodal=@Url.Page("./Index", "EditReal", new { Id = item.Id })">
|
||
<i class="fa fa-edit"></i>
|
||
</a>
|
||
<a class="btn btn-info btn-table pull-left m-rl-5 rad details" permission="10115"
|
||
href="#showmodal=@Url.Page("./Index", "RealDetails", new { Id = item.Id })">
|
||
<i class="fa fa-info-circle"></i>
|
||
</a>
|
||
|
||
}
|
||
else
|
||
{
|
||
<a class="btn btn-warning btn-table pull-left m-rl-5 rad" permission="10114"
|
||
href="#showmodal=@Url.Page("./Index", "EditLegal", new { Id = item.Id })">
|
||
<i class="fa fa-edit"></i>
|
||
</a>
|
||
<a class="btn btn-info btn-table pull-left m-rl-5 rad details" permission="10115"
|
||
href="#showmodal=@Url.Page("./Index", "LegalDetails", new { Id = item.Id })">
|
||
<i class="fa fa-info-circle"></i>
|
||
</a>
|
||
|
||
}
|
||
|
||
</div>
|
||
<div class="flexible-div op-td mobile-view" style="justify-content: flex-end;">
|
||
<div class="more-buttons flexible-div">
|
||
<a class="btn pull-left employee-operations"><i class="fa fa-bars" aria-hidden="true"></i> </a>
|
||
<div class="buttons-container">
|
||
@if (item.IsLegal == "false")
|
||
{
|
||
<a class="btn btn-info pull-left m-rl-5 rad details" permission="10115"
|
||
href="#showmodal=@Url.Page("./Index", "RealDetails", new { Id = item.Id })">
|
||
<i class="fa faSize fa-info-circle"></i>
|
||
</a>
|
||
<a class="btn btn-warning pull-left m-rl-5 rad" permission="10114"
|
||
href="#showmodal=@Url.Page("./Index", "EditReal", new { Id = item.Id })">
|
||
<i class="fa faSize fa-edit"></i>
|
||
</a>
|
||
}
|
||
else
|
||
{
|
||
<a class="btn btn-info pull-left m-rl-5 rad details" permission="10115"
|
||
href="#showmodal=@Url.Page("./Index", "LegalDetails", new { Id = item.Id })">
|
||
<i class="fa faSize fa-info-circle"></i>
|
||
</a>
|
||
<a class="btn btn-warning pull-left m-rl-5 rad" permission="10114"
|
||
href="#showmodal=@Url.Page("./Index", "EditLegal", new { Id = item.Id })">
|
||
<i class="fa faSize fa-edit"></i>
|
||
</a>
|
||
}
|
||
@if (item.IsActive == "true")
|
||
{
|
||
<a href="#" onclick="remove(@item.Id)" class="btn btn-danger pull-left m-rl-5 rad"> <i class="fa faSize fa-trash"></i></a>
|
||
}
|
||
else
|
||
{
|
||
<a href="#" onclick="acitve(@item.Id)" class=" btn btn-success pull-left m-rl-5 rad"> <i class="fa faSize fa-rotate-left"></i></a>
|
||
}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@section Script {
|
||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||
<script src="~/lib/select2/js/select2.js"></script>
|
||
@* <script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script> *@
|
||
<script type="text/javascript">
|
||
$(document).ready(function () {
|
||
$('#datatable').dataTable({
|
||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||
});
|
||
});
|
||
</script>
|
||
<script>
|
||
$(window).on('resize', function () {
|
||
if ($(window).width() < 768) {
|
||
locateButtonContainerMobile();
|
||
}
|
||
//if ($(window).width() > 768) {
|
||
// locateButtonContainer();
|
||
//}
|
||
});
|
||
$(document).on("click", function (event) {
|
||
var target = $(event.target);
|
||
if (!target.closest(".buttons-container").length
|
||
&& !target.is(".employee-operations")
|
||
&& !target.is("#createLegal")
|
||
&& !target.is("#createLegal *")
|
||
&& !target.is("#LegalDetails")
|
||
&& !target.is("#LegalDetails *")
|
||
&& !target.is("#legalEdit")
|
||
&& !target.is("#legalEdit *")
|
||
&& !target.is("#createActual")
|
||
&& !target.is("#createActual *")
|
||
&& !target.is("#actualDetails")
|
||
&& !target.is("#actualDetails *")
|
||
&& !target.is("#actualEdit")
|
||
&& !target.is("#actualEdit *")
|
||
) {
|
||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||
$(".more-buttons").removeClass("active");
|
||
setTimeout(function () {
|
||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||
}, 200);
|
||
}
|
||
});
|
||
$(".employee-operations").on("click", function () {
|
||
if ($(window).width() < 768) {
|
||
locateButtonContainerMobile();
|
||
}
|
||
//if ($(window).width() > 768) {
|
||
// locateButtonContainer();
|
||
//}
|
||
var buttonsContainer = $(this).next(".buttons-container");
|
||
if (buttonsContainer.hasClass("active")) {
|
||
buttonsContainer.removeClass("active").addClass("reverse");
|
||
$(this).closest(".more-buttons").removeClass("active");
|
||
setTimeout(function () {
|
||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||
}, 200);
|
||
} else {
|
||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||
$(this).closest(".more-buttons").addClass("active");
|
||
}
|
||
|
||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||
});
|
||
//function locateButtonContainer() {
|
||
// var beforePosition = $(".screen-view .employee-operations").position();
|
||
// var containerWidth = $('.screen-view .buttons-container').outerWidth();
|
||
// var containerHeight = $('.screen-view .buttons-container').outerHeight();
|
||
// var containerLeft = beforePosition.left + $(".screen-view .employee-operations").outerWidth() + 20;
|
||
// var containerTop = beforePosition.top + ($(".screen-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||
// $('.screen-view .buttons-container').css({
|
||
// left: containerLeft,
|
||
// top: containerTop
|
||
// });
|
||
//}
|
||
function locateButtonContainerMobile() {
|
||
var beforePosition = $(".mobile-view .employee-operations").position();
|
||
var containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||
var containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||
var containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 20;
|
||
var containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||
$('.mobile-view .buttons-container').css({
|
||
left: containerLeft,
|
||
top: containerTop
|
||
});
|
||
}
|
||
</script>
|
||
<script>
|
||
//$(document).ready(function() {
|
||
// $(".select-city").select2({
|
||
// language: "fa",
|
||
// dir: "rtl"
|
||
// });
|
||
//});
|
||
$('.activer').on('change',
|
||
function(e) {
|
||
e.preventDefault();
|
||
$('.search').click();
|
||
|
||
});
|
||
</script>
|
||
|
||
|
||
|
||
<script>
|
||
function remove(id) {
|
||
$('.sweet-alert').removeClass("successSwall");
|
||
$('.sweet-alert').removeClass("errorSwall");
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("./Index", "CheckHasPersonalContracting")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function (response) {
|
||
|
||
if (response.hasPersonalContracting) {
|
||
swal({
|
||
title: "توجه داشته باشید به دلیل وجود طرف حساب حذف کامل از دیتابیس میسر نمی باشد،اما با تایید این پیام این معرف غیرفعال می گردد." ,
|
||
text: "",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: false,
|
||
closeOnCancel: true,
|
||
customClass: "questionSwall"
|
||
}, function (isConfirm) {
|
||
if (isConfirm) {
|
||
deActiveRepresentative(id);
|
||
}
|
||
});
|
||
}
|
||
else {
|
||
swal({
|
||
title: "توجه داشته باشید با تایید این پیام، اطلاعات لیست مورد نظر بطور کامل از بانک اطلاعاتی حذف خواهد شد.",
|
||
text: "",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: false,
|
||
closeOnCancel: true,
|
||
}, function (isConfirm) {
|
||
if (isConfirm) {
|
||
deletePersonalContracting(id);
|
||
}
|
||
});
|
||
}
|
||
},
|
||
failure: function (response) {
|
||
console.log(5, response)
|
||
}
|
||
});
|
||
|
||
// $('.sweet-alert').removeClass("successSwall");
|
||
// $('.sweet-alert').removeClass("errorSwall");
|
||
// swal({
|
||
// title: (hasworkshop > 0 ? "توجه داشته باشید به دلیل وجود طرف حساب حذف کامل از دیتابیس میسر نمی باشد،اما با تایید این پیام این معرف غیرفعال می گردد." : "توجه داشته باشید با تایید این پیام، اطلاعات لیست مورد نظر بطور کامل از بانک اطلاعاتی حذف خواهد شد."),
|
||
// text: "",
|
||
// type: "warning",
|
||
// showCancelButton: true,
|
||
// confirmButtonColor: "#DD6B55",
|
||
// confirmButtonText: "بله",
|
||
// cancelButtonText: "خیر",
|
||
// closeOnConfirm: false,
|
||
// closeOnCancel: true,
|
||
// customClass: (hasworkshop > 0 ? "questionSwall" : "")
|
||
// }, function (isConfirm) {
|
||
// if (isConfirm) {
|
||
|
||
// $.ajax({
|
||
// async: false,
|
||
// dataType: 'json',
|
||
// type: 'POST',
|
||
// url: '@Url.Page("./Index", "DeleteEmployer")',
|
||
// headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
// data: { "id": id },
|
||
// success: function (response) {
|
||
|
||
// if (response.isSuccedded) {
|
||
// swal({
|
||
// title: "حذف با موفقیت انجام شد.",
|
||
// text: "",
|
||
// type: "success",
|
||
// showCancelButton: true,
|
||
// confirmButtonColor: "#DD6B55",
|
||
// confirmButtonText: "بستن",
|
||
// //cancelButtonText: "خیر",
|
||
// closeOnConfirm: true,
|
||
// customClass: "successSwall"
|
||
// },
|
||
// function (isConfirm) {
|
||
// if (isConfirm) {
|
||
// //$("#btnSearch").click();
|
||
// var url = '@Url.Page("/Company/Employers/Index")';
|
||
// window.location.href = url;
|
||
// }
|
||
// });
|
||
|
||
// }
|
||
// else {
|
||
// if (response.message == "DeActive") {
|
||
// swal({
|
||
// title: "غیرفعال شدن این معرف با موفقیت انجام شد.",
|
||
// text: "به منظور حذف از دیتابیس باید کلیه عملیات مربوط به این معرف را حذف نمایید.",
|
||
// type: "warning",
|
||
// showCancelButton: true,
|
||
// confirmButtonColor: "#DD6B55",
|
||
// confirmButtonText: "بستن",
|
||
// cancelButtonText: "بستن",
|
||
// closeOnConfirm: true,
|
||
// closeOnCancel: true,
|
||
// customClass: "warningSwall2"
|
||
// },
|
||
// function (isConfirm) {
|
||
// if (isConfirm) {
|
||
// //$("#btnSearch").click();
|
||
// var url = '@Url.Page("/Company/Employers/Index")';
|
||
// window.location.href = url;
|
||
// }
|
||
// });
|
||
|
||
// }
|
||
// else {
|
||
// swal({
|
||
// title: response.message,
|
||
// type: "warning",
|
||
// showCancelButton: true,
|
||
// confirmButtonColor: "#DD6B55",
|
||
// //confirmButtonText: "بستن",
|
||
// cancelButtonText: "بستن",
|
||
// closeOnConfirm: false,
|
||
// closeOnCancel: true,
|
||
// customClass: "errorSwall"
|
||
// });
|
||
// }
|
||
|
||
|
||
// }
|
||
// },
|
||
// failure: function (response) {
|
||
// console.log(5, response)
|
||
// }
|
||
// });
|
||
// }
|
||
|
||
// });
|
||
}
|
||
|
||
|
||
function deletePersonalContracting(id) {
|
||
$('.sweet-alert').removeClass("successSwall");
|
||
$('.sweet-alert').removeClass("errorSwall");
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("./Index", "DeleteRepresentative")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function (response) {
|
||
if (response.isSuccedded) {
|
||
swal({
|
||
title: "حذف با موفقیت انجام شد.",
|
||
text: "",
|
||
type: "success",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بستن",
|
||
//cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
customClass: "successSwall"
|
||
},
|
||
function (isConfirm) {
|
||
if (isConfirm) {
|
||
var url = '@Url.Page("/Company/Representative/Index")';
|
||
window.location.href = url;
|
||
}
|
||
});
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
function deActiveRepresentative(id)
|
||
{
|
||
$('.sweet-alert').removeClass("successSwall");
|
||
$('.sweet-alert').removeClass("errorSwall");
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("./Index", "DeActiveRepresentative")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function (response) {
|
||
// console.log(response);
|
||
if (response.isSuccedded) {
|
||
swal({
|
||
title: response.message,
|
||
text: "",
|
||
type: "success",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بستن",
|
||
//cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
customClass: "successSwall"
|
||
},
|
||
function (isConfirm) {
|
||
if (isConfirm) {
|
||
var url = '@Url.Page("/Company/Representative/Index")';
|
||
window.location.href = url;
|
||
// $("#btnSearch").click();
|
||
}
|
||
});
|
||
|
||
}
|
||
else {
|
||
swal({
|
||
title: response.message,
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
//confirmButtonText: "بستن",
|
||
cancelButtonText: "بستن",
|
||
closeOnConfirm: false,
|
||
closeOnCancel: true,
|
||
customClass: "errorSwall"
|
||
});
|
||
}
|
||
},
|
||
failure: function (response) {
|
||
console.log(5, response)
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
|
||
function acitve(id) {
|
||
$('.sweet-alert').removeClass("successSwall");
|
||
$('.sweet-alert').removeClass("errorSwall");
|
||
swal({
|
||
title: "آیا از فعال کردن این معرف مطمئن هستید؟",
|
||
text: "",
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بله",
|
||
cancelButtonText: "خیر",
|
||
closeOnConfirm: false,
|
||
closeOnCancel: true
|
||
}, function (isConfirm) {
|
||
if (isConfirm) {
|
||
|
||
$.ajax({
|
||
async: false,
|
||
dataType: 'json',
|
||
type: 'POST',
|
||
url: '@Url.Page("./Index", "ActiveRepresentative")',
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
data: { "id": id },
|
||
success: function (response) {
|
||
// console.log(response);
|
||
if (response.isSuccedded) {
|
||
swal({
|
||
title: response.message,
|
||
text: "",
|
||
type: "success",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
confirmButtonText: "بستن",
|
||
//cancelButtonText: "خیر",
|
||
closeOnConfirm: true,
|
||
customClass: "successSwall"
|
||
},
|
||
function (isConfirm) {
|
||
if (isConfirm) {
|
||
var url = '@Url.Page("/Company/Representative/Index")';
|
||
window.location.href = url;
|
||
// $("#btnSearch").click();
|
||
}
|
||
});
|
||
|
||
}
|
||
else {
|
||
swal({
|
||
title: response.message,
|
||
type: "warning",
|
||
showCancelButton: true,
|
||
confirmButtonColor: "#DD6B55",
|
||
//confirmButtonText: "بستن",
|
||
cancelButtonText: "بستن",
|
||
closeOnConfirm: false,
|
||
closeOnCancel: true,
|
||
customClass: "errorSwall"
|
||
});
|
||
}
|
||
},
|
||
failure: function (response) {
|
||
console.log(5, response)
|
||
}
|
||
});
|
||
}
|
||
|
||
});
|
||
}
|
||
</script>
|
||
|
||
|
||
<script>
|
||
var containerContracting = $('#empContractingPartyID');
|
||
var searchBoxContracting = $('#empSearchContractingPartyID');
|
||
var hiddenInputValContracting = $('.sendContractingPartyID');
|
||
var searchResulContracting = $('.searchResultContractingPartyID');
|
||
var mixContainerAndSerchResultContracting = $('#empContractingPartyID , .searchResultContractingPartyID');
|
||
|
||
containerContracting.hide();
|
||
var liListContracting;
|
||
var liPointerContracting;
|
||
let countContracting = 0;
|
||
|
||
//close searchBoxContracting Employee when click on body
|
||
$(document).on('click', function (event) {
|
||
if (!$(event.target).closest(containerContracting).length) {
|
||
containerContracting.hide();
|
||
}
|
||
});
|
||
//select option by mouse
|
||
function selectItemContracting(id, employeeFullName) {
|
||
searchBoxContracting.val(employeeFullName);
|
||
hiddenInputValContracting.val(id);
|
||
containerContracting.hide();
|
||
searchBoxContracting.addClass("selectedOption");
|
||
};
|
||
//searchBoxContracting by Ajax
|
||
searchBoxContracting.on('keyup keypress',
|
||
function (e) {
|
||
$(".form-control").removeClass("selectedOption");
|
||
|
||
|
||
if ($(this).val() == '') {
|
||
$("#SearchModel_ContractingPartyId").val("0");
|
||
$("#SearchModel_ContractingPartyName").val('');
|
||
}
|
||
|
||
//stop submit form with enter
|
||
var keyCode = e.keyCode || e.which;
|
||
if (keyCode === 13) {
|
||
e.preventDefault();
|
||
if (countContracting > 0 && countContracting <= liListContracting.length) {
|
||
liPointerContracting.click();
|
||
}
|
||
return false;
|
||
}
|
||
searchBoxContracting.removeClass("selectedOption");
|
||
|
||
let searchText = $(this).val();
|
||
hiddenInputValContracting.val(0);
|
||
if (searchText.length > 1) {
|
||
$.ajax({
|
||
async: false,
|
||
contentType: 'charset=utf-8',
|
||
dataType: 'json',
|
||
type: 'GET',
|
||
url: '@Url.Page("./Index", "ContractingPartyList")',
|
||
data: { "searchText": searchText },
|
||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||
|
||
success: function (response) {
|
||
$(".opt").remove();
|
||
if (response.mylist.length > 0) {//result Founded
|
||
|
||
$(".noResult").remove();
|
||
containerContracting.show();
|
||
$.each(response.mylist,
|
||
function (i, item) {
|
||
let li = `<li data-id="${item.id}" class="btn btn-block opt" onclick="selectItemContracting(${item.id}, '${item.lName}');" >${item.lName}</li>`;
|
||
searchResulContracting.append(li);
|
||
});
|
||
} else {//result NotFounded
|
||
|
||
$(".noResult").remove();
|
||
containerContracting.show();
|
||
let noResult = `<li class="btn btn-block noResult" style="background-color: #ffffff;border-radius: 10px;text-align: right;padding: 2px 5px">نتیجه ای یافت نشد</li>`;
|
||
searchResulContracting.append(noResult);
|
||
}
|
||
}// endOfSuccess
|
||
|
||
}); //endOfAjax
|
||
|
||
} else {
|
||
containerContracting.hide();
|
||
countContracting = 0;
|
||
}
|
||
//keyboard Arrow Key Select And Enter
|
||
liListContracting = $('#empContractingPartyID ul li');
|
||
mixContainerAndSerchResultContracting.animate({
|
||
scrollTop: $(liListContracting.eq(0)).offset().top - containerContracting.offset().top + containerContracting.scrollTop()
|
||
},
|
||
50);
|
||
if (e.which === 40) {// if ArrowUp
|
||
if (countContracting > 0 && countContracting <= liListContracting.length) {
|
||
|
||
liPointerContracting.removeClass('keyboardSelected');
|
||
console.log(countContracting + "plusOne");
|
||
liListContracting.eq(countContracting).addClass('keyboardSelected');
|
||
liPointerContracting = liListContracting.eq(countContracting);
|
||
if (countContracting > 4) {
|
||
//ScrollDown
|
||
mixContainerAndSerchResultContracting.animate({
|
||
scrollTop: $(liPointerContracting).offset().top - containerContracting.offset().top + containerContracting.scrollTop()
|
||
},
|
||
50);
|
||
}
|
||
countContracting += 1;
|
||
|
||
} else {
|
||
|
||
liListContracting.eq(0).addClass("keyboardSelected");
|
||
liPointerContracting = liListContracting.eq(0);
|
||
countContracting = 1;
|
||
}
|
||
} else if (e.which === 38) {//if ArrowDown
|
||
if (countContracting > 0 && countContracting <= liListContracting.length) {
|
||
liPointerContracting.removeClass('keyboardSelected');
|
||
countContracting -= 1;
|
||
liListContracting.eq(countContracting).addClass('keyboardSelected');
|
||
liPointerContracting = liListContracting.eq(countContracting);
|
||
//ScrollUp
|
||
mixContainerAndSerchResultContracting.animate({
|
||
scrollTop: $(liPointerContracting).offset().top - containerContracting.offset().top + containerContracting.scrollTop()
|
||
},
|
||
50);
|
||
}
|
||
}
|
||
});
|
||
|
||
|
||
|
||
$(".btn-searchRepresentative").click(function () {
|
||
|
||
|
||
if ($("#SearchModel_ContractingPartyId").val() == "0" || $("#SearchModel_ContractingPartyId").val() == "")
|
||
$("#SearchModel_ContractingPartyName").val($("#empSearchContractingPartyID").val());
|
||
|
||
$("#btnSearch").click();
|
||
});
|
||
</script>
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
|