CarAllocate.cshtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. @{
  2. /**/
  3. ViewBag.Title = "农机调拨";
  4. Layout = "~/Views/Shared/_Layout.cshtml";
  5. }
  6. @using MES.Production.Service;
  7. @using Central.Control.Domain;
  8. @using Ant.Service.Common;
  9. @using Ant.Service.Common.Enums;
  10. @using MES.Production.Entity;
  11. @using CommonToolHelper;
  12. @model ResponseApplyCarInfo
  13. <style>
  14. body {
  15. background-color: white;
  16. }
  17. .changeicon {
  18. float: right;
  19. margin-right: -15px;
  20. position: absolute;
  21. right: -7px;
  22. top: 0px;
  23. border: none;
  24. background-color: #18a689;
  25. color: #FFFFFF;
  26. line-height: 33px;
  27. height: 33px;
  28. }
  29. </style>
  30. @using (Ajax.BeginForm("SaveCarAllocate", null, new AjaxOptions()
  31. {
  32. HttpMethod = "Post",
  33. OnBegin = "SubAjax.Loading",
  34. OnComplete = "SubAjax.Complate",
  35. OnFailure = "SubAjax.Failure",
  36. OnSuccess = "SubAjax.Success"
  37. }, new { @class = "form-horizontal dig-from", @role = "form" }))
  38. {
  39. @Html.Hidden("apply_id", Model.apply_id)
  40. <div class="wrapper-content">
  41. <div class="panel-body" style="padding-top:0px;">
  42. <div class="tab-content">
  43. <div id="tab-1" class="tab-pane active">
  44. <div class="clearfix f-hafl">
  45. <div class="col-hafl">
  46. @*<div class="form-group">
  47. <label class="col-lg-3 control-label">农机名称:</label>
  48. <div class="col-lg-8">
  49. @Html.HiddenFor(p => p.apply_id)
  50. <label style="margin-top:7px;">@Model.productName</label>
  51. </div>
  52. </div>*@
  53. <div class="form-group">
  54. <label class="col-lg-3 control-label">出厂编号:</label>
  55. <div class="col-lg-8">
  56. <label style="margin-top:7px;">@Model.FactoryNumber</label>
  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 style="margin-top:7px;">@Model.productBarCode</label>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="col-hafl">
  67. <div class="form-group">
  68. <label class="col-lg-3 control-label">IMEI号:</label>
  69. <div class="col-lg-8">
  70. <label style="margin-top:7px;">@Model.imei</label>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label class="col-lg-3 control-label">车型号:</label>
  75. <div class="col-lg-8">
  76. <label style="margin-top:7px;">@Model.productModel</label>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="col-hafl">
  81. <div class="form-group">
  82. <label class="col-lg-3 control-label">农机类型:</label>
  83. <div class="col-lg-8">
  84. @{
  85. switch (Model.carType)
  86. {
  87. case 1:
  88. {
  89. <label style="margin-top:7px;">拖拉机</label>
  90. }
  91. break;
  92. case 2:
  93. {
  94. <label style="margin-top:7px;">收割机</label>
  95. }
  96. break;
  97. case 3:
  98. {
  99. <label style="margin-top:7px;">插秧机</label>
  100. }
  101. break;
  102. case 4:
  103. {
  104. <label style="margin-top:7px;">烘干机</label>
  105. }
  106. break;
  107. }
  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">所属经销商:</label>
  115. <div class="col-lg-8">
  116. <label style="margin-top:7px;">@Model.orgDistributorsName</label>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="form-group">
  122. <label class="col-lg-3 control-label">申请类型:</label>
  123. <div class="col-lg-8">
  124. <select name="apply_type" id="apply_type" class="form-control" datatype="*" onchange="loadSettlementCycle()">
  125. <option value="0">请选择</option>
  126. <option value="1" )>退货</option>
  127. <option value="2" )>返厂</option>
  128. <option value="3" )>调拨</option>
  129. <option value="4" )>锁车</option>
  130. <option value="5" )>解锁</option>
  131. </select>
  132. </div>
  133. </div>
  134. <div class="form-group" id="f1">
  135. <label class="col-lg-3 control-label">调货经销商:</label>
  136. <div class="col-lg-8">
  137. <select id="distributorsId" name="distributorsId" class="form-control select2">
  138. <option value="" @(string.IsNullOrEmpty(Model.distributorsId) ? "selected" : "")>--请选择--</option>
  139. @{
  140. foreach (var item in ViewBag.dpt)
  141. {
  142. <option value="@item.ID" @(Model.distributorsId == @item.ID ? "selected" : "")>@CommonHtmlHelper.RtfTextToHtml(item.NAME)</option>
  143. }
  144. }
  145. </select>
  146. </div>
  147. </div>
  148. <div class="form-group" id="f2">
  149. <label class="col-lg-3 control-label">调拨原因:</label>
  150. <div class="col-lg-8">
  151. <select name="note" id="note" class="form-control" datatype="*">
  152. <option value="0">请选择</option>
  153. <option value="10" )>一级商到一级商(有调拨手续)</option>
  154. <option value="20" )>一级商到一级商(无调拨手续)</option>
  155. <option value="30" )>一级经销商内部调拨</option>
  156. <option value="40" )>其它</option>
  157. </select>
  158. </div>
  159. </div>
  160. <div class="form-group" id="f3">
  161. <label class="col-lg-3 control-label">
  162. 申请原因:
  163. </label>
  164. <div class="col-lg-8">
  165. @Html.TextArea("notes", "", new { @class = "form-control", @rows = "3", @cols = "20", @maxlength = "1000", @placeholder = "请输入标记原因" })
  166. </div>
  167. </div>
  168. <div class="hr-line-dashed" style="margin:0;">
  169. <div class="form-group m20">
  170. <div class="col-sm-2 col-sm-offset-2">
  171. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确定保存</span></button>
  172. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. }
  181. @section scripts{
  182. <script type="text/javascript">
  183. $(function () {
  184. $('.form-horizontal').initValidform();
  185. $('.select2').select2();
  186. //分配部门
  187. $('#changeDpt').click(function () {
  188. var vals = $('#hiddpt').val();
  189. top.dialog({
  190. url: '/Sys/Department/GetSelectDpt',
  191. title: '选择景点',
  192. width: 450,
  193. height: 500,
  194. data: vals, // 给 iframe 的数据
  195. onclose: function () {
  196. if (this.returnValue != 'no') {
  197. $('#hiddpt').val(this.returnValue.split('|')[0]);
  198. $('#dpt').html(this.returnValue.split('|')[1]);
  199. //清理岗位
  200. $('#hidpost').val('');
  201. $('#post').html('');
  202. }
  203. },
  204. oniframeload: function () {
  205. }
  206. }).showModal();
  207. return false;
  208. });
  209. //$("#SiteID").change(function () {
  210. // var pstate = document.getElementById("SiteID");
  211. // var state = pstate.options[pstate.selectedIndex].value;
  212. // var test = pstate.options[pstate.selectedIndex].text;
  213. // alert(test);
  214. // //state就是选中的value中的值
  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. $('#hidpost').val(this.returnValue.split('|')[0]);
  233. $('#post').html(this.returnValue.split('|')[1]);
  234. }
  235. },
  236. oniframeload: function () {
  237. }
  238. }).showModal();
  239. return false;
  240. });
  241. });
  242. function loadSettlementCycle() {
  243. var selectValue = $("#apply_type").val();
  244. if (selectValue == 3) {
  245. $("#f1").show();
  246. $("#f2").show();
  247. $("#f3").hide();
  248. }
  249. else {
  250. $("#f1").hide();
  251. $("#f2").hide();
  252. $("#f3").show();
  253. }
  254. }
  255. </script>
  256. }