markAlarmFence.cshtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. @using MES.Production.Service;
  2. @using Central.Control.Domain;
  3. @using Ant.Service.Common;
  4. @using CommonToolHelper;
  5. @{
  6. ViewBag.Title = "Detail";
  7. Layout = "~/Views/Shared/_Layout.cshtml";
  8. }
  9. <style>
  10. body {
  11. background-color: white;
  12. }
  13. .changeicon {
  14. float: right;
  15. margin-right: 22px;
  16. position: absolute;
  17. right: -7px;
  18. top: 0px;
  19. border: none;
  20. background-color: #18a689;
  21. color: #FFFFFF;
  22. line-height: 33px;
  23. height: 33px;
  24. }
  25. </style>
  26. <link href="~/Content/uploadfile/CSS/bootstrap.min.css" rel="stylesheet" />
  27. <link href="~/Content/uploadfile/CSS/font-awesome.css" rel="stylesheet" />
  28. @*<script src="~/Content/js/jquery/jquery-1.8.2.min.js"></script>*@
  29. @using (Ajax.BeginForm("SaveMarkAlarm", null, new AjaxOptions()
  30. {
  31. HttpMethod = "Post",
  32. OnBegin = "SubAjax.Loading",
  33. OnComplete = "SubAjax.Complate",
  34. OnFailure = "SubAjax.Failure",
  35. OnSuccess = "SubAjax.Success"
  36. },
  37. new { @class = "form-horizontal dig-from", @role = "form" }))
  38. {
  39. <div class="wrapper-content">
  40. <div class="panel-body">
  41. <div class="tab-content">
  42. <div id="tab-1" class="tab-pane active">
  43. @*@Html.HiddenFor(p => p.ID)*@
  44. @Html.Hidden("CarID", ViewData["CarID"])
  45. @Html.Hidden("CarBar", ViewData["CarBar"])
  46. <div class="form-group">
  47. <label class="col-lg-3 control-label">IMEI号:</label>
  48. <div class="col-lg-8">
  49. <label class="form-control" id="lbl_imei">@ViewBag.carid</label>
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-lg-3 control-label">农机名称:</label>
  54. <div class="col-lg-8">
  55. <label class="form-control">@ViewData["carname"]</label>
  56. @*@Html.TextBox("txt_carname", ViewData["carname"], new { @class = "input-sm form-control", @enabled = "false", @placeholder = "请输入农机整机条码查询" })*@
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <label class="col-lg-3 control-label">出厂编号:</label>
  61. <div class="col-lg-8">
  62. <label class="form-control">@ViewData["FactoryNumber"]</label>
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label class="col-lg-3 control-label">报警标记:</label>
  67. <div class="col-lg-8">
  68. <select name="CarSate" id="CarSate" class="form-control" datatype="*" onchange="loadSettlementCycle()">
  69. <option value="0">请选择</option>
  70. @*<option value="10">外出参展</option>*@
  71. @*<option value="20">销售未回款</option>*@
  72. @*<option value="30" selected>销售已回款</option>*@
  73. <option value="30" selected>已销售</option>
  74. @*<option value="40" )>其它</option>*@
  75. </select>
  76. </div>
  77. </div>
  78. <div class="form-group" id="l1">
  79. <label class="col-lg-3 control-label">开始时间:</label>
  80. <div class="col-lg-8">
  81. @*@Html.TextBoxFor(p => p.AddTime, new { @class = "form-control", @id = "startdate", @readonly = "readonly" })*@
  82. @Html.TextBox("startdate", ViewData["startdate"], new { @class = "form-control", @placeholder = "请输入解防开始时间", @readonly = "readonly" })
  83. @*<input id="startdate" class="input-sm form-control" runat="server" type="text" />*@
  84. </div>
  85. </div>
  86. <div class="form-group" id="l2">
  87. <label class="col-lg-3 control-label">结束时间:</label>
  88. <div class="col-lg-8">
  89. @*@Html.TextBoxFor(p => p.AddTime, new { @class = "form-control", @id = "startdate", @readonly = "readonly" })*@
  90. @Html.TextBox("enddate", ViewData["enddate"], new { @class = "form-control", @placeholder = "请输入解防结束时间", @readonly = "readonly" })
  91. @*<input id="startdate" class="input-sm form-control" runat="server" type="text" />*@
  92. </div>
  93. </div>
  94. @*<div class="form-group" id="l3">
  95. <label class="col-lg-3 control-label">预计回款时间:</label>
  96. <div class="col-lg-8">
  97. @Html.TextBox("backPayTime", ViewData["backPayTime"], new { @class = "form-control", @placeholder = "请输入预计回款时间", @readonly = "readonly" })
  98. </div>
  99. </div>
  100. <div class="form-group" id="l6">
  101. <label class="col-lg-3 control-label">购买时间:</label>
  102. <div class="col-lg-8">
  103. @Html.TextBox("buyTime", ViewData["buyTime"], new { @class = "form-control", @placeholder = "请输入购买时间", @readonly = "readonly" })
  104. </div>
  105. </div>*@
  106. <div class="form-group" id="l4">
  107. <label class="col-lg-3 control-label">购买人姓名:</label>
  108. <div class="col-lg-8">
  109. @Html.TextBox("username", "", new
  110. {
  111. @class = "form-control",
  112. @placeholder = "请输入购买人姓名"
  113. })
  114. </div>
  115. </div>
  116. <div class="form-group" id="l5">
  117. <label class="col-lg-3 control-label">购买人手机:</label>
  118. <div class="col-lg-8">
  119. @Html.TextBox("userTel", "", new { @class = "form-control", @id = "CarID", @placeholder = "购买人手机号" })
  120. </div>
  121. </div>
  122. <div class="form-group" id="l7">
  123. <label class="col-lg-3 control-label">购买人地址:</label>
  124. <div class="col-lg-8">
  125. @Html.TextBox("userAddress", "", new { @class = "form-control", @placeholder = "请输入购买人地址" })
  126. </div>
  127. </div>
  128. <div class="form-group">
  129. <label class="col-lg-3 control-label">
  130. 标记原因:
  131. </label>
  132. <div class="col-lg-8">
  133. @Html.TextArea("notes", "", new { @class = "form-control", @rows = "3", @cols = "20", @maxlength = "1000", @placeholder = "请输入标记原因" })
  134. </div>
  135. </div>
  136. <div class="hr-line-dashed">
  137. <div class="form-group m20">
  138. <div class="col-sm-2 col-sm-offset-2">
  139. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
  140. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. }
  149. @section scripts{
  150. <link href="~/Content/js/laydate/theme/default/laydate.css" rel="stylesheet" />
  151. <link href="~/Content/js/layui/css/layui.css" rel="stylesheet" />
  152. <script src="~/Content/js/layui/layui.js"></script>
  153. <script src="~/Content/js/laydate/laydate.js"></script>
  154. <script type="text/javascript">
  155. var applicationPath = "http://" + window.location.host;
  156. //alert(applicationPath);
  157. layui.use('laydate', function () {
  158. var laydate = layui.laydate;
  159. //日期时间选择器
  160. laydate.render({
  161. elem: '#startdate'
  162. , type: 'date'
  163. });
  164. //日期时间选择器
  165. laydate.render({
  166. elem: '#enddate'
  167. , type: 'date'
  168. });
  169. //日期时间选择器
  170. laydate.render({
  171. elem: '#backPayTime'
  172. , type: 'date'
  173. });
  174. //日期时间选择器
  175. laydate.render({
  176. elem: '#buyTime'
  177. , type: 'date'
  178. });
  179. });
  180. $(function () {
  181. $('.form-horizontal').initValidform();
  182. $('.select2').select2();
  183. $("#l1").hide();
  184. $("#l2").hide();
  185. $("#l3").hide();
  186. $("#l4").show();
  187. $("#l5").show();
  188. $("#l6").show();
  189. $("#l7").show();
  190. //document.getElementById("startdate").readOnly = true;
  191. $('#changesendUser').click(function () {
  192. var vals = $('#IMEI').val();
  193. // alert(vals);
  194. dig.addModel('选择设备', '/Sys/Device/SelectDevcieList?userid=' + vals, 800, 500, function () {
  195. if (this.returnValue != 'no') {
  196. var vl = "";
  197. if ($('#IMEI').val() == "") {
  198. vl = this.returnValue.split('|')[1]
  199. }
  200. else {
  201. vl = $('#IMEI').val() + "," + this.returnValue.split('|')[1]
  202. }
  203. //alert(vl);
  204. $('#IMEI').val(vl);
  205. var vals = "";
  206. if ($('#readuser').html().replace(/^\s\s*/, '').replace(/\s\s*$/, '').length == 0) {
  207. vals = this.returnValue.split('|')[1];
  208. }
  209. else {
  210. vals = $('#readuser').html().replace(/^\s\s*/, '').replace(/\s\s*$/, '') + "," + this.returnValue.split('|')[1];
  211. }
  212. $('#readuser').html(vals);
  213. }
  214. });
  215. });
  216. //分配岗位
  217. $('#changePost').click(function () {
  218. var dptid = $('#DPTID').val() + ',' + $('#hiddpt').val();
  219. if ($('#DPTID').val() == '' && $('#hiddpt').val() == '') {
  220. dig.alertError('提示', '请选择部门后再选择岗位');
  221. return;
  222. }
  223. var vals = $('#hidpost').val();
  224. top.dialog({
  225. url: '/Sys/Post/PostUser?dptid=' + dptid,
  226. title: '分配岗位',
  227. width: 500,
  228. height: 500,
  229. data: vals, // 给 iframe 的数据
  230. onclose: function () {
  231. if (this.returnValue != 'no') {
  232. var vl = this.returnValue.split('|')[0]
  233. $('#hidpost').val(vl);
  234. var vals = $('#readuser').val() + this.returnValue.split('|')[1]
  235. $('#post').html(vals);
  236. }
  237. },
  238. oniframeload: function () {
  239. }
  240. }).showModal();
  241. return false;
  242. });
  243. });
  244. function loadSettlementCycle() {
  245. var selectValue = $("#CarSate").val();
  246. if (selectValue == 10) {
  247. $("#l1").show();
  248. $("#l2").show();
  249. $("#l3").hide();
  250. $("#l4").hide();
  251. $("#l5").hide();
  252. $("#l6").hide();
  253. $("#l7").hide();
  254. }
  255. if (selectValue == 20) {
  256. $("#l1").hide();
  257. $("#l2").hide();
  258. $("#l3").show();
  259. $("#l4").show();
  260. $("#l5").show();
  261. $("#l6").show();
  262. $("#l7").show();
  263. }
  264. if (selectValue == 30) {
  265. $("#l1").hide();
  266. $("#l2").hide();
  267. $("#l3").hide();
  268. $("#l4").show();
  269. $("#l5").show();
  270. $("#l6").show();
  271. $("#l7").show();
  272. }
  273. if (selectValue == 40) {
  274. $("#l1").show();
  275. $("#l2").show();
  276. $("#l3").hide();
  277. $("#l4").hide();
  278. $("#l5").hide();
  279. $("#l6").hide();
  280. $("#l7").hide();
  281. }
  282. if (selectValue == 0) {
  283. $("#l1").show();
  284. $("#l2").show();
  285. $("#l3").hide();
  286. $("#l4").hide();
  287. $("#l5").hide();
  288. $("#l6").hide();
  289. $("#l7").hide();
  290. }
  291. }
  292. </script>
  293. }