Detail.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. @{
  2. ViewBag.Title = "Detail";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using MES.Production.Service;
  6. @using Central.Control.Domain;
  7. @using Ant.Service.Common;
  8. @using Ant.Service.Common.Enums;
  9. @using MES.Production.Entity;
  10. @using CommonToolHelper;
  11. @model Ent_YW_Bicycle
  12. <style>
  13. body {
  14. background-color: white;
  15. }
  16. .changeicon {
  17. float: right;
  18. margin-right: -15px;
  19. position: absolute;
  20. right: -7px;
  21. top: 0px;
  22. border: none;
  23. background-color: #18a689;
  24. color: #FFFFFF;
  25. line-height: 33px;
  26. height: 33px;
  27. }
  28. </style>
  29. @using (Ajax.BeginForm("Save", null, new AjaxOptions()
  30. {
  31. HttpMethod = "Post",
  32. OnBegin = "SubAjax.Loading",
  33. OnComplete = "SubAjax.Complate",
  34. OnFailure = "SubAjax.Failure",
  35. OnSuccess = "SubAjax.Success"
  36. }, new { @class = "form-horizontal dig-from", @role = "form" }))
  37. {
  38. <div class="wrapper-content">
  39. <div class="panel-body" style="padding-top:0px;">
  40. <div class="tab-content">
  41. <div id="tab-1" class="tab-pane active">
  42. @Html.Hidden("distributorsid", ViewData["distributorsid"])
  43. @Html.Hidden("distributorName", ViewData["distributorName"])
  44. @*<div class="form-group">
  45. <label class="col-lg-3 control-label">所属经销商:</label>
  46. <div class="col-lg-8">
  47. <select id="SiteID" name="SiteID" class="form-control select2" datatype="*" nullmsg="请选择所属经销商">
  48. <option value="" @(string.IsNullOrEmpty(Model.DistributorsID) ? "selected" : "")>--请选择--</option>
  49. @{
  50. foreach (var item in ViewBag.dpt)
  51. {
  52. <option value="@item.ID" @(Model.DistributorsID == @item.ID ? "selected" : "")>@CommonHtmlHelper.RtfTextToHtml(item.NAME)</option>
  53. }
  54. }
  55. </select>
  56. </div>
  57. </div>*@
  58. <div class="form-group">
  59. <label class="col-lg-3 control-label">农机状态:</label>
  60. <div class="col-lg-8">
  61. <select name="CarSate" id="CarSate" class="form-control" datatype="*" nullmsg="请选择车状态">
  62. <option value="">请选择</option>
  63. @{
  64. var level = ViewData["levels"] as List<SYS_CODE>;
  65. if (level != null && level.Count > 0)
  66. {
  67. foreach (var item in level)
  68. {
  69. string carstate = Model.CarSate.ToString();
  70. <option value="@item.CODEVALUE" @(carstate == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
  71. }
  72. }
  73. }
  74. </select>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <label class="col-lg-3 control-label">农机名称:</label>
  79. <div class="col-lg-8">
  80. @Html.TextBoxFor(p => p.CarName, new { @class = "form-control", @placeholder = "请输入农机名称", @datatype = "*1-30", @nullmsg = "请输入农机名称" })
  81. </div>
  82. </div>
  83. <div class="form-group">
  84. <label class="col-lg-3 control-label">农机条码:</label>
  85. <div class="col-lg-8">
  86. @Html.TextBoxFor(p => p.carBar, new { @class = "form-control", @placeholder = "请输入农机条码", @datatype = "n15-20", @nullmsg = "请输入农机条码", @errormsg = "农机条码必须是15-20位的数字!" })
  87. </div>
  88. </div>
  89. <div class="clearfix f-hafl">
  90. <div class="col-hafl">
  91. <div class="form-group">
  92. <label class="col-lg-3 control-label">IMEI号:</label>
  93. <div class="col-lg-8">
  94. @Html.HiddenFor(p => p.ID)
  95. @Html.TextBoxFor(p => p.CarID, new { @class = "form-control", @id = "CarID", @placeholder = "车ID(IMEI)", @datatype = "n15-15", @nullmsg = "IMEI号不能为空!", @errormsg = "IMEI号必须是15位数字!" })
  96. </div>
  97. </div>
  98. <div class="form-group">
  99. <label class="col-lg-3 control-label">车型号:</label>
  100. <div class="col-lg-8">
  101. @Html.TextBoxFor(p => p.CarModel, new
  102. {
  103. @class = "form-control",
  104. @datatype = "*",
  105. @nullmsg = "请输入车型号",
  106. @placeholder = "请输入车型号",
  107. @errormsg = "排序值只能输入数字,数字越小排序越靠前"
  108. })
  109. </div>
  110. </div>
  111. </div>
  112. <div class="col-hafl">
  113. <div class="form-group">
  114. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">农机类型:</label>
  115. <div class="col-lg-8">
  116. <select name="carType" id="carType" class="form-control" datatype="*" nullmsg="请选择农机类型">
  117. <option value="">请选择</option>
  118. @{
  119. var cartype = ViewData["cartype"] as List<SYS_CODE>;
  120. if (cartype != null && cartype.Count > 0)
  121. {
  122. foreach (var item in cartype)
  123. {
  124. <option value="@item.CODEVALUE" @(!string.IsNullOrEmpty(Model.carType.ToString()) && Model.carType.ToString() == item.CODEVALUE ? "selected" : "")>@item.NAMETEXT</option>
  125. }
  126. }
  127. }
  128. </select>
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="col-lg-3 control-label" style="width:29% !important; padding-left:5px; padding-right:5px;">出厂编号:</label>
  133. <div class="col-lg-8">
  134. @Html.TextBoxFor(p => p.FactoryNumber, new { @class = "form-control", @id = "FactoryNumber", @placeholder = "出厂编号", @nullmsg = "出厂编号不能为空!" })
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="hr-line-dashed" style="margin:0;">
  140. <div class="form-group m20">
  141. <div class="col-sm-2 col-sm-offset-2">
  142. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
  143. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. }
  152. @section scripts{
  153. <script type="text/javascript">
  154. $(function () {
  155. $('.form-horizontal').initValidform();
  156. $('.select2').select2();
  157. //分配部门
  158. $('#changeDpt').click(function () {
  159. var vals = $('#hiddpt').val();
  160. top.dialog({
  161. url: '/Sys/Department/GetSelectDpt',
  162. title: '选择景点',
  163. width: 450,
  164. height: 500,
  165. data: vals, // 给 iframe 的数据
  166. onclose: function () {
  167. if (this.returnValue != 'no') {
  168. $('#hiddpt').val(this.returnValue.split('|')[0]);
  169. $('#dpt').html(this.returnValue.split('|')[1]);
  170. //清理岗位
  171. $('#hidpost').val('');
  172. $('#post').html('');
  173. }
  174. },
  175. oniframeload: function () {
  176. }
  177. }).showModal();
  178. return false;
  179. });
  180. //$("#SiteID").change(function () {
  181. // var pstate = document.getElementById("SiteID");
  182. // var state = pstate.options[pstate.selectedIndex].value;
  183. // var test = pstate.options[pstate.selectedIndex].text;
  184. // alert(test);
  185. // //state就是选中的value中的值
  186. //});
  187. //分配岗位
  188. $('#changePost').click(function () {
  189. var dptid = $('#DPTID').val() + ',' + $('#hiddpt').val();
  190. if ($('#DPTID').val() == '' && $('#hiddpt').val() == '') {
  191. dig.alertError('提示', '请选择部门后再选择岗位');
  192. return;
  193. }
  194. var vals = $('#hidpost').val();
  195. top.dialog({
  196. url: '/Sys/Post/PostUser?dptid=' + dptid,
  197. title: '分配岗位',
  198. width: 500,
  199. height: 500,
  200. data: vals, // 给 iframe 的数据
  201. onclose: function () {
  202. if (this.returnValue != 'no') {
  203. $('#hidpost').val(this.returnValue.split('|')[0]);
  204. $('#post').html(this.returnValue.split('|')[1]);
  205. }
  206. },
  207. oniframeload: function () {
  208. }
  209. }).showModal();
  210. return false;
  211. });
  212. });
  213. </script>
  214. }