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