InfoExport.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Entities;
  3. @using EMIS.Web.Controls;
  4. @{
  5. ViewBag.Title = "List";
  6. }
  7. <link href="~/Content/Bowin.Control.Core/themes/base/jquery-ui.css" rel="stylesheet"
  8. type="text/css" />
  9. <link href="~/Content/Bowin.Control.Core/themes/default/easyui.css" rel="stylesheet"
  10. type="text/css" />
  11. <link href="~/Content/Bowin.Control.Core/themes/icon.css" rel="stylesheet" type="text/css" />
  12. <script src="../../Scripts/jquery-ui.min.js" type="text/javascript"></script>
  13. <script src="~/Scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
  14. <script src="~/Scripts/Bowin.Control.Core/Plugins/EasyUI/jquery.easyui.min.js" type="text/javascript"></script>
  15. <style type="text/css">
  16. .drag{
  17. padding:4px;
  18. margin:2px;
  19. border:1px solid #ccc;
  20. background:#AACCFF;
  21. }
  22. .dp{
  23. opacity:0.5;
  24. filter:alpha(opacity=50);
  25. }
  26. .over{
  27. background:#FBEC88;
  28. }
  29. .indicator{
  30. position:absolute;
  31. font-size:9px;
  32. width:10px;
  33. height:10px;
  34. display:none;
  35. color:red;
  36. }
  37. .drag-item{
  38. padding:4px;
  39. margin:2px;
  40. border:1px solid #ccc;
  41. background:#AACCFF;
  42. }
  43. input[type=button]
  44. {
  45. background-color:#f0f0f0;
  46. }
  47. </style>
  48. @section scripts{
  49. <script type="text/javascript">
  50. var mnu = "";
  51. var windowID;
  52. $(function () {
  53. windowID = $.SystemGeneral.getUrlParam("WindowID");
  54. setleftdiv();
  55. });
  56. function setleftdiv() {
  57. $.getJSON("../../Config/StudentColumnName.json", function (result) {
  58. $.each(result.all, function (i, field) {
  59. var colList = eval(field);
  60. for (var key in colList) {
  61. var str = '<div id="' + i + '" class="drag" name="' + key + '">' + i + '(' + colList[key] + ') </div>'
  62. $('#source').append(str);
  63. }
  64. });
  65. setdraggableanddroppable();
  66. });
  67. };
  68. function removeright() {
  69. $('#target').find('div').remove();
  70. $('#source').find('div').remove();
  71. setleftdiv();
  72. }
  73. function setdraggableanddroppable() {
  74. $('.drag').draggable({
  75. proxy: 'clone',
  76. revert: true,
  77. cursor: 'auto',
  78. onStartDrag: function () {
  79. $(this).draggable('options').cursor = 'not-allowed';
  80. $(this).draggable('proxy').addClass('dp');
  81. },
  82. onStopDrag: function () {
  83. $(this).draggable('options').cursor = 'auto';
  84. }
  85. });
  86. $('#target').droppable({
  87. deltaX: 0,
  88. deltaY: 0,
  89. onDragEnter: function (e, source) {
  90. $(source).draggable('options').cursor = 'auto';
  91. $(source).draggable('proxy').css('border', '1px solid red');
  92. $(this).addClass('over');
  93. },
  94. onDragLeave: function (e, source) {
  95. $(source).draggable('options').cursor = 'not-allowed';
  96. $(source).draggable('proxy').css('border', '1px solid #ccc');
  97. $(this).removeClass('over');
  98. },
  99. onDrop: function (e, source) {
  100. source.className = "drag";
  101. var x = event.clientX;
  102. var y = event.clientY;
  103. var lis = $("#target").find("div");
  104. if (lis.length > 0) {
  105. var number = 0;
  106. $.each(lis, function (index, item) {
  107. var divtop = lis.eq(index).position().top;
  108. //var thistop = lis.eq(index).offset().top;
  109. var scrollTop = $(this).parent().scrollTop();
  110. var targettop = $(this).parent().position().top;
  111. var divheight = $(this).height();
  112. if (source.id == item.id) {
  113. return true;
  114. }
  115. if (divtop + scrollTop - targettop + divheight - (y - targettop + scrollTop) >= 0) {
  116. number = index + 1;
  117. return false;
  118. }
  119. });
  120. if (number == 0) {
  121. $(this).append(source);
  122. } else {
  123. var nametext = lis.eq(number - 1).attr("name");
  124. $("[name='" + nametext + "']").before(source);
  125. //$(lis.eq(2)).append(source);
  126. }
  127. }
  128. else {
  129. $(this).append(source);
  130. }
  131. $(this).removeClass('over');
  132. }
  133. });
  134. $('#source').droppable({
  135. //accept: '#d1,#d3',
  136. onDragEnter: function (e, source) {
  137. $(source).draggable('options').cursor = 'auto';
  138. $(source).draggable('proxy').css('border', '1px solid red');
  139. $(this).addClass('over');
  140. },
  141. onDragLeave: function (e, source) {
  142. $(source).draggable('options').cursor = 'not-allowed';
  143. $(source).draggable('proxy').css('border', '1px solid #ccc');
  144. $(this).removeClass('over');
  145. },
  146. onDrop: function (e, source) {
  147. $(this).append(source);
  148. $(this).removeClass('over');
  149. }
  150. });
  151. };
  152. function getall() {
  153. $('#target').find('div').remove();
  154. $.getJSON("../../Config/StudentColumnName.json", function (result) {
  155. $.each(result.all, function (i, field) {
  156. var colList = eval(field);
  157. for (var key in colList) {
  158. var str = '<div id="' + i + '"class="drag" name="' + key + '">' + i + '(' + colList[key] + ') </div>'
  159. $('#source #' + i).remove();
  160. $('#target').append(str);
  161. }
  162. });
  163. setdraggableanddroppable();
  164. });
  165. };
  166. function getstru_xjzc() {
  167. $('#target').find('div').remove();
  168. $('#source').find('div').remove();
  169. setleftdiv();
  170. $.getJSON("../../Config/StudentColumnName.json", function (result) {
  171. $.each(result.stru_xjzc, function (i, field) {
  172. var colList = eval(field);
  173. for (var key in colList) {
  174. var str = '<div id="' + i + '"class="drag" name="' + key + '">' + i + '(' + colList[key] + ') </div>'
  175. $('#source #' + i).remove();
  176. $('#target').append(str);
  177. }
  178. });
  179. setdraggableanddroppable();
  180. });
  181. };
  182. function getstru_sjxg() {
  183. $('#target').find('div').remove();
  184. $('#source').find('div').remove();
  185. setleftdiv();
  186. $.getJSON("../../Config/StudentColumnName.json", function (result) {
  187. $.each(result.stru_sjxg, function (i, field) {
  188. var colList = eval(field);
  189. for (var key in colList) {
  190. var str = '<div id="' + i + '"class="drag" name="' + key + '">' + i + '(' + colList[key] + ') </div>'
  191. $('#source #' + i).remove();
  192. $('#target').append(str);
  193. }
  194. });
  195. setdraggableanddroppable();
  196. });
  197. };
  198. function getstru_xnzc() {
  199. $('#target').find('div').remove();
  200. $('#source').find('div').remove();
  201. setleftdiv();
  202. $.getJSON("../../Config/StudentColumnName.json", function (result) {
  203. $.each(result.stru_xnzc, function (i, field) {
  204. var colList = eval(field);
  205. for (var key in colList) {
  206. var str = '<div id="' + i + '"class="drag" name="' + key + '">' + i + '(' + colList[key] + ') </div>'
  207. $('#source #' + i).remove();
  208. $('#target').append(str);
  209. }
  210. });
  211. setdraggableanddroppable();
  212. });
  213. };
  214. function getstru_jszc() {
  215. $('#target').find('div').remove();
  216. $('#source').find('div').remove();
  217. setleftdiv();
  218. $.getJSON("../../Config/StudentColumnName.json", function (result) {
  219. $.each(result.stru_jszc, function (i, field) {
  220. var colList = eval(field);
  221. for (var key in colList) {
  222. var str = '<div id="' + i + '"class="drag" name="' + key + '">' + i + '(' + colList[key] + ') </div>'
  223. $('#source #' + i).remove();
  224. $('#target').append(str);
  225. }
  226. });
  227. setdraggableanddroppable();
  228. });
  229. };
  230. function GetRequest() {
  231. var url = location.search; //获取url中"?"符后的字串
  232. var theRequest = new Object();
  233. if (url.indexOf("?") != -1) {
  234. var str = url.substr(1);
  235. strs = str.split("&");
  236. for (var i = 0; i < strs.length; i++) {
  237. theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  238. }
  239. }
  240. return theRequest;
  241. }
  242. function Student_Infodbf() {
  243. var Request = new Object();
  244. Request = GetRequest();
  245. var Studentselect = top.$("#" + windowID).data("inputData");
  246. $("[name='QueryParamsDatas']").val(Studentselect.QueryParamsDatas);
  247. Studentselect.selectedIDs = Request["selectedIDs"];
  248. $("[name='selectedIDs']").val(Studentselect.selectedIDs);
  249. var colnames = "";
  250. var showname = "";
  251. $('#target').children('div').each(function () {
  252. colnames = colnames + $(this).attr('id') + ",";
  253. });
  254. $('#target').children('div').each(function () {
  255. showname = showname + $(this).attr('name') + ",";
  256. });
  257. $("[name='colnames']").val(colnames);
  258. $("[name='showname']").val(showname);
  259. $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Students/DbfExport");
  260. $(document.forms[0]).submit();
  261. }
  262. function Student_InfoExcel() {
  263. var Request = new Object();
  264. Request = GetRequest();
  265. var Studentselect = top.$("#" + windowID).data("inputData");
  266. $("[name='QueryParamsDatas']").val(Studentselect.QueryParamsDatas);
  267. Studentselect.selectedIDs = Request["selectedIDs"];
  268. $("[name='selectedIDs']").val(Studentselect.selectedIDs);
  269. var colnames = "";
  270. var showname = "";
  271. $('#target').children('div').each(function () {
  272. colnames = colnames + $(this).attr('id') + ",";
  273. });
  274. $('#target').children('div').each(function () {
  275. showname = showname + $(this).attr('name') + ",";
  276. });
  277. $("[name='colnames']").val(colnames);
  278. $("[name='showname']").val(showname);
  279. $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Students/InfoExcel");
  280. $(document.forms[0]).submit();
  281. }
  282. </script>
  283. }
  284. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  285. <div class="p_title">
  286. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  287. 学生信息列表
  288. </div>
  289. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("InfoExport")</div>
  290. </div>
  291. <form id="formQuery" method="post" action="@Url.Content("~/Students/InfoExcel")">
  292. @Html.Hidden("QueryParamsDatas")
  293. @Html.Hidden("selectedIDs")
  294. @Html.Hidden("colnames")
  295. @Html.Hidden("showname")
  296. </form>
  297. <div id = "bodycss">
  298. <div style="margin:20px 0;"></div>
  299. <div id = "buttondiv" style = "margin-left:20px;">
  300. <div style = "float:left;margin:0 4px"><input type="button" onclick = "getall()" class = "all" value="全部字段" /></div>
  301. <div style = "float:left;margin:0 4px" ><input type="button" onclick = "getstru_xjzc()" class = "stru_xjzc" value="新生学籍电子注册上报" /></div>
  302. <div style = "float:left;margin:0 4px"><input type="button" onclick = "getstru_sjxg()" class = "stru_sjxg" value="在校生数据批量修改上报" /></div>
  303. <div style = "float:left;margin:0 4px"><input type="button" onclick = "getstru_xnzc()" class = "stru_xnzc" value="在校生学年电子注册上报" /></div>
  304. <div style = "float:left;margin:0 4px"><input type="button" onclick = "getstru_jszc()" class = "stru_jszc" value="毕业生学历电子注册上报" /></div>
  305. <div><input style = "margin:0 4px" type="button" onclick = "removeright()" class = "stru_jszc" value="清空" /></div>
  306. </div>
  307. <div id = "selectdiv">
  308. <div id="source" style="border:1px solid #ccc;width:300px;height:450px;float:left;margin:5px 90px;overflow:auto">
  309. 候选字段
  310. </div>
  311. <div id="target" style="border:1px solid #ccc;width:300px;height:450px;float:left;margin:5px 0px;overflow:auto">
  312. 需打印字段
  313. </div>
  314. <div style="clear:both"></div>
  315. </div>
  316. </div>
  317. </div>