|
Мин и Мах на дату
#39481807
Ссылка:
Ссылка на сообщение:
Ссылка с названием темы:
Ссылка на профиль пользователя:
|
|
|
|
Подскажите как сделать максимальную дату 10.07.2017 и что бы выбрать было нельзя другое, в input пробовал писать, но не срабатывает.
1. 2. 3. 4. 5.
<div class="form-row form-group required">
<input id="date" class="form-control" type="text" required="" name="SaleDate" />
<label data-placeholder="Дата"></label>
<div class="help-block with-errors"></div>
</div>
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. 206. 207. 208. 209. 210. 211. 212. 213. 214. 215. 216. 217. 218. 219. 220. 221. 222. 223. 224. 225. 226. 227. 228. 229. 230. 231. 232. 233. 234. 235. 236. 237. 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251. 252. 253. 254. 255. 256. 257. 258. 259. 260. 261. 262. 263. 264. 265. 266. 267. 268. 269. 270. 271. 272. 273. 274. 275. 276. 277.
<!doctype html>
<html>
<head>
<title>Crizal — Продажи</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="~/css/css.css" rel="stylesheet">
<link rel='stylesheet prefetch' href='http://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.3/animate.min.css'>
<link href="~/css/tools.css" rel="stylesheet">
<link href="~/css/bootstrap.css" rel="stylesheet">
<script src="~/js/jquery-1.12.4.js"></script>
<script src="~/js/js.js"></script>
<script type="text/javascript" src="~/js/jquery.form.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
<script src="~/js/footable.js"></script>
<script src="~/js/main.js"></script>
<script src="~/js/My.js"></script>
<script>
jQuery(function($){
var $modal = $('#editor-modal'),
$editor = $('#editor'),
$editorTitle = $('#editor-title'),
ft = FooTable.init('#sales', {
editing: {
enabled: true,
addRow: function(){
$modal.removeData('row');
$editor[0].reset();
$editorTitle.text('Добавить продажу');
$modal.modal('show');
},
editRow: function(row){
var values = row.val();
$('#id').val(values.id);
$editor.find('#id').val(values.id);
$editor.find('#date').val(values.date);
$editor.find('#nomination').val(values.nomination);
$editor.find('#covering').val(values.covering);
$editor.find('#quantity').val(values.quantity);
if (values.transitions == '') {
$editor.find('#transitions').val('1');
$('#transitions').attr('checked', 'checked');
}
else {
$('#transitions').removeAttr('checked');
}
$editor.find('#consultant').val(values.consultant);
$modal.data('row', row);
$editorTitle.text('Продажа ' + values.nomination);
$modal.modal('show');
},
deleteRow: function(row){
if (confirm('Вы точно хотите удалить продажу?')){
row.delete();
DeleteSale(row.value.id);
}
}
}
}),
uid = 4;
$editor.on('submit', function(e){
if (this.checkValidity && !this.checkValidity()) return;
e.preventDefault();
var transitions = '';
var row = $modal.data('row');
if ($editor.find('#transitions').val() == '1')
transitions = ''
else
transitions = '';
var ball = getBall($editor.find('#nomination').val(), $editor.find('#covering').val(), $editor.find('#transitions').val(), $editor.find('#quantity').val());
values = {
id: $editor.find('#id').val(),
nomination: $editor.find('#nomination').val(),
covering: $editor.find('#covering').val(),
quantity: $editor.find('#quantity').val(),
transitions: transitions,
consultant: $editor.find('#consultant').val(),
date: $editor.find('#date').val(),
status: "На рассмотрении",
points: ball
};
if (row instanceof FooTable.Row){
row.val(values);
} else {
values.id = uid++;
ft.rows.add(values);
}
$modal.modal('hide');
});
});
</script>
</head>
<body>
@Html.Partial("_menu")
<div class="container">
@Html.Partial("_subMenu")
<script>
$('.sregistration').parent().parent('li').addClass('active');
</script>
</div>
<div class="wrapper">
<h1 class="left">Регистрация продаж</h1>
<table id="sales" class="table" data-paging="true" data-filtering="true" data-sorting="true">
<thead>
<tr>
<th data-name="Row" data-breakpoints="xs sm" data-type="number">№</th>
<th data-name="date" data-breakpoints="xs sm" data-type="date" data-format-string="Do MMMM YYYY">Дата</th>
<th data-name="nomination">Наименование</th>
<th data-name="covering">Тип Покрытия</th>
<th data-name="quantity" data-breakpoints="xs" data-type="number">Количество линз</th>
<th data-name="transitions" data-breakpoints="xs" data-type="checkbox">Transitions</th>
<th data-name="points" data-breakpoints="xs">Баллы</th>
<th data-name="status" data-breakpoints="xs">Статус</th>
<th data-name="consultant" data-breakpoints="xs sm md">Примечание Консультанта</th>
<th data-name="id" data-breakpoints="xs sm" data-type="number" data-visible="false">>№</th>
<th data-name="boss" data-breakpoints="xs sm md">Комментарий владельца</th>
</tr>
</thead>
<tbody>
@{
foreach (var s in ViewBag.Sale)
{
<tr>
<td>@s.Row</td>
<td>@s.SaleDate.ToShortDateString()</td>
<td>@s.good</td>
<td>@s.covering</td>
<td>@s.Count</td>
<td>@s.Transitions</td>
<td>@s.Ball</td>
<td>@s.status</td>
<td>@s.Description</td>
<td>@s.Sale</td>
<td>@s.BossDescr</td>
</tr>
}
}
</tbody>
</table>
</div>
@Html.Partial("_footer")
<!-- Modal -->
<!--TABLE-EDITOR-->
<div aria-labelledby="editor-title" class="modal fade" id="editor-modal" role="dialog" tabindex="-1">
<style scoped="">
.form-group.required .control-label:after {
content: "*";
color: red;
margin-left: 4px;
}
</style>
<div class="modal-dialog" role="document">
@using(Html.BeginForm("CreateSale", "Actor", FormMethod.Post, new {@class="modal-content form-horizontal", data_toggle="validator", id="editor", name="editor" }))
{
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="editor-title">Добавить продажу</h4>
</div>
<div class="modal-body">
<input class="hidden" id="id" name="id" type="number">
<div class="form-row form-group required">
<input id="date" class="form-control" type="text" required="" name="SaleDate" />
<label data-placeholder="Дата"></label>
<div class="help-block with-errors"></div>
</div>
<div class="form-row form-group required">
<select class="select" id="nomination" required="" name="Good">
<option disabled selected value="">-- Выберите изделие --</option>
@{ foreach (var g in ViewBag.Good) {
<option value="@g.Name">@g.Name</option>
}
}
</select>
<label data-placeholder="Наименование"></label>
<div class="help-block with-errors"></div>
</div>
<div class="form-row form-group required">
<select class="select" id="covering" required="" name="Covering">
<option disabled selected value="">-- Выберите тип покрытия --</option>
@{ foreach (var c in ViewBag.Covering)
{
<option value="@c.Name">@c.Name</option>
}
}
</select>
<label data-placeholder="Тип покрытия"></label>
<div class="help-block with-errors"></div>
</div>
<div class="form-row form-group required">
<div class="squared">
<input id="transitions" type="checkbox" value="0" name="transitions">
<label for="transitions"></label><span>Transitions</span>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-row form-group required">
<input class="form-control" id="quantity" min="0" name="quantity" required="" type="number">
<label data-placeholder="Количество линз"></label>
<div class="help-block with-errors"></div>
</div>
<div class="form-row form-group required">
<input class="form-control" id="consultant" name="consultant" type="text">
<label data-placeholder="Примечание консультанта"></label>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="submit">Сохранить</button>
<button class="btn btn-default" data-dismiss="modal" type="button">Отменить</button>
</div>
}
</div>
</div>
<!--FEEDBACK-EDITOR-->
@Html.Partial("_feedBack")
@Html.Partial("_popup")
</body>
</html>
|
|
|