designOrderQuestions.zml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. ${zhiqim_manager_breadcrumb("考试题库")}
  2. ${Styles.htmlOverflowHidden()}
  3. ${Scripts.src(zhiqim_uploadlarge.js)}
  4. <script>
  5. var upload;
  6. Z.onload(function()
  7. {
  8. upload = new Z.UploadLarge();
  9. initUploader("MaterialFile", '${customPath}', "uploadingFileList", upload);
  10. });
  11. //初始化文件上传组件
  12. function initUploader(fileType, path, dropWrap, upload)
  13. {
  14. upload.elem = "upload_" + fileType;
  15. upload.contextPath = "${context.getContextPath()}";
  16. upload.showResult = false;
  17. upload.fileCopy = true;
  18. upload.multiSelect = true;
  19. upload.dropWrap = dropWrap;
  20. upload.multiDisplayType = 0;
  21. upload.setFileDir(path);
  22. upload.onSelected = function(fileName, fileLength)
  23. {
  24. var questionsId = Z("#questionsId:checked").val();
  25. if (Z("#questionsId:checked").length <= 0)
  26. {
  27. Z.alert("请选择订单");
  28. return false;
  29. }
  30. this.setFileName(questionsId + "-" + fileName);
  31. };
  32. upload.onCompleted = function(fileList, uploadedList)
  33. {
  34. var questionsId = Z("#questionsId:checked").val();
  35. for(var i = 0; i < uploadedList.length; i++)
  36. {//保存附件信息
  37. var fileModle = uploadedList[i]
  38. var ajax = new Z.Ajax();
  39. ajax.setSync();
  40. ajax.setClassName("QuestionsFilePresenter");
  41. ajax.setMethodName("uploadQuestionsFile");
  42. ajax.addParam(questionsId);
  43. ajax.addParam(fileModle.fileId);
  44. ajax.addParam(fileType);
  45. ajax.setFailureAlert();
  46. ajax.setSuccess(function(responseText)
  47. {
  48. var obj = Z.J.toObject(this.responseText);
  49. var items = obj.attaList;
  50. Z("#CustomFileList").html("");//清除历史数据
  51. var html = "";
  52. for (var i=0;i<items.length;i++)
  53. {
  54. var obj = items[i];
  55. html += "<div id='ck_"+obj.attaId+"' onclick='Z(this).find(\"zcover>i.z-checkbox\").click()' class='z-pointer z-pd-b4 z-text-ellipsis' style='width:370px' title='" + obj.fileName +"'>";
  56. html += "<input name='" + fileType +"_str' class='z-checkbox' data-role='z-checkbox' data-class='z-blue' type='checkbox' value ='" + obj.attaId +"'/>"+obj.fileName;
  57. html += "</div>";
  58. }
  59. Z("#CustomFileList").htmlc(html);
  60. });
  61. ajax.execute();
  62. }
  63. Z("#"+upload.dropWrap).html("");//清空上传列表信息
  64. };
  65. upload.execute();
  66. }
  67. //添加订单
  68. function designOrderQuestionsAdd()
  69. {
  70. var designRequirements = Z("#designRequirements").val();
  71. var dialog = new Z.Dialog();
  72. dialog.title = "添加考试订单";
  73. dialog.url = "configQuestionsAdd.htm";
  74. dialog.width = 640;
  75. dialog.height = 300;
  76. dialog.execute();
  77. }
  78. //修改订单
  79. function designOrderQuestionsModify(){
  80. var questionsId = Z.FM.getChecked("questionsId");
  81. if(Z.V.isEmpty(questionsId)){
  82. Z.alert("请选择一个订单");
  83. return;
  84. }
  85. var dialog = new Z.Dialog();
  86. dialog.title = "订单["+questionsId+"]编辑";
  87. dialog.url = "/configQuestionsModify.htm?questionsId="+questionsId;
  88. dialog.width = 640;
  89. dialog.height = 200;
  90. dialog.execute();
  91. }
  92. //删除订单
  93. function doDesignOrderQuestionsDelete(){
  94. var questionsId = Z.FM.getChecked("questionsId");
  95. if(Z.V.isEmpty(questionsId)){
  96. Z.alert("请选择一个订单");
  97. return;
  98. }
  99. var ajax = new Z.Ajax();
  100. ajax.setClassName("ConfigQuestionsAction");
  101. ajax.setMethodName("designOrderQuestionsDelete");
  102. ajax.addParam("questionsId", questionsId);
  103. ajax.setFailureAlert();
  104. ajax.setSuccess(function() {
  105. Z.success("删除成功", function(){
  106. parent.location.reload();
  107. parent.Z.Dialog.close();
  108. });
  109. });
  110. ajax.execute();
  111. }
  112. //显示客户文件列表
  113. function showOrderCustomFileList(questionsId)
  114. {
  115. var ajax = new Z.Ajax();
  116. ajax.setClassName("QuestionsFilePresenter");
  117. ajax.setMethodName("showMaterialFileList");
  118. ajax.addParam("questionsId", questionsId);
  119. ajax.setFailureAlert();
  120. ajax.setSuccess(function(responseText)
  121. {
  122. var obj = Z.J.toObject(responseText);
  123. var attaList = obj.attaList;
  124. var html = "";
  125. for (var i=0;i<attaList.length;i++)
  126. {
  127. var obj = attaList[i];
  128. html += "<div id='ck_"+obj.attaId+"' class='z-pointer z-pd-b4 z-text-ellipsis' onclick='Z(this).find(\"zcover>i.z-checkbox\").click()' style='width:370px' title='" + obj.fileName +"'>";
  129. html += "<input name='MaterialFile_str' class='z-checkbox' data-role='z-checkbox' data-class='z-blue' type='checkbox' value ='" + obj.attaId +"'/>"+obj.fileName;
  130. html += "</div>";
  131. }
  132. Z("#CustomFileList").htmlc(html);
  133. });
  134. ajax.execute();
  135. }
  136. function doDownFile(){
  137. var attaIds = Z.FM.getCheckBoxValue("MaterialFile_str", "");
  138. if (Z.V.isEmpty(attaIds))
  139. {
  140. Z.alert("请选择需要下载的素材");
  141. return ;
  142. }
  143. var mainFrame = parent.parent.document.getElementById("mainFrame");
  144. var mainSrc = mainFrame.src;
  145. var prefix = Z.l.protocol + "//" + Z.l.host ;
  146. var element1 = document.createElement("a");
  147. element1.href = prefix+"/downQuestionsFile.htm?attaId=" + attaIds;
  148. Z.L.href(prefix+"/downQuestionsFile.htm?attaId=" + attaIds, zCallFrame);
  149. }
  150. //删除文件
  151. function doDeleteFile(fileType)
  152. {
  153. var attaIds = Z.FM.getCheckBoxValue("MaterialFile_str", "");
  154. if (Z.V.isEmpty(attaIds))
  155. {
  156. Z.alert("请选择需要删除的素材");
  157. return ;
  158. }
  159. var ajax = new Z.Ajax();
  160. ajax.setClassName("QuestionsFilePresenter");
  161. ajax.setMethodName("deleteMaterialFile");
  162. ajax.addParam(attaIds);
  163. ajax.setFailure(function(s){Z.alert(s);});
  164. ajax.setSuccess(function(){
  165. var ids = attaIds.split(",");
  166. for (var i=0; i<ids.length; i++)
  167. {
  168. var el = Z("#ck_"+ids[i]);
  169. el.remove();
  170. }
  171. });
  172. ajax.execute();
  173. }
  174. </script>
  175. ${zhiqim_manager_breadcrumb("订单列表")}
  176. ${zhiqim_manager_content()}
  177. <#-- 导航 -->
  178. <div data-role="z-tabnav" class="z-tabnav-main z-mg-b20 ${zmr_color_class}">
  179. <nav>
  180. <ul>
  181. <li class="z-active">考核订单列表</li>
  182. </ul>
  183. </nav>
  184. </div>
  185. <#-- 左侧功能 -->
  186. <div id="left" class="z-overflow-y-auto z-overflow-x-hidden z-relative-left">
  187. <#-- 查询条件 -->
  188. ${zhiqim_manager_title("查询条件")}
  189. <form name="theForm" action="designOrderQuestions.htm" method="post">
  190. <table class="z-table z-bordered z-pd6 z-bg-white">
  191. <tr>
  192. <td>&nbsp;设计要求:<input name="designRequirements" type="text" class="${zmr_color_class} z-input z-w160" value="${designRequirements}" placeholder="输入关键字"></td>
  193. <td width="800px">
  194. <button class="z-blue z-button" ><i class="z-font z-query"></i>查询</button>
  195. <button type="button" class="z-button" onclick="Z.Forms.clearForm(this.form);">清空</button>
  196. </td>
  197. </tr>
  198. </table>
  199. </form>
  200. <#-- 操作功能 -->
  201. <div class="z-w100p z-mg-t10 z-mg-b3">
  202. <button type="button" class="z-button z-blue" onclick="designOrderQuestionsAdd();"><i class="z-font z-add"></i>添加订单</button>
  203. <button type="button" class="z-button z-blue" onclick="designOrderQuestionsModify();"><i class="z-font z-modify"></i>修改订单</button>
  204. <button type="button" class="z-button z-red" onclick="doDesignOrderQuestionsDelete();"><i class="z-font z-delete"></i>删除订单</button>
  205. </div>
  206. <#-- 列表 -->
  207. <div class="z-overflow-auto z-bd-r">
  208. <table class="z-table z-bordered z-h40-tr z-pd5 zi-bd-r-none z-bg-white z-text-center" style="width:1220px">
  209. <tr bgcolor="${zmr_thead_bgcolor}">
  210. <td width="5">选择</td>
  211. <td width="120">设计要求</td>
  212. <td width="40">操作员</td>
  213. <td width="20">最后修改时间</td>
  214. </tr>
  215. <#if pageResult.total() == 0>
  216. <tr valign="middle" class="z-text-center z-bg-white z-h40">
  217. ${zhiqim_manager_no_record(9 "暂时没有数据")}
  218. </tr>
  219. </#if>
  220. <#for item : pageResult.list()>
  221. <tr class="z-pointer bgcolor="${zhiqim_manager_tr_bg(item_index)}" ${zhiqim_manager_tr_click_radio()}>
  222. <td><input id="questionsId" name="questionsId" class="z-radio" data-role="z-radio" data-class=" ${zmr_color_class}" value="${item.getQuestionsId()}" type="radio" onclick="Z.E.stop();showOrderCustomFileList('${item.getQuestionsId()}')"></td>
  223. <td>${item.getDesignRequirements()}</td>
  224. <td>${item.getUpdateOperator()}</td>
  225. <td>${Sqls.toDateTimeString(item.getModificationTime())}</td>
  226. </tr>
  227. </#for>
  228. </table>
  229. </div>
  230. ${zhiqim_manager_paging(pageResult, "designOrderQuestions.htm")}
  231. </div>
  232. ${zhiqim_manager_content_end()}
  233. <#-- 右侧信息&客户素材-->
  234. <div class="z-fixed z-pd10 z-bd z-bg-white z-h100p z-overflow-y-auto z-overflow-x-hidden" style="top:0;right:0;width:450px;z-index:50">
  235. <table class="z-table z-pd10 z-bordered z-w100p" style="margin-top:20px;">
  236. <tr class="z-h40" bgcolor="${zmr_thead_bgcolor}">
  237. <td>
  238. <input type="checkbox" class="z-checkbox" data-role="z-checkbox" data-class="${zmr_color_class}" onclick="Z.FM.doSelectCheckBox('MaterialFile_str', this.checked);" ><b class="z-pd4">订单素材</b>
  239. <button id="upload_MaterialFile" class="z-button z-mg-l20 ${zmr_color_class} z-mg-r6">添加</button>
  240. <button id="doUpload" class="z-button z-mg-l2 z-cyan z-mg-r2" onclick="upload.upload()">开始上传</button>
  241. <button class="z-button z-orange z-mg-l6" onclick="doDownFile();">下载</button>
  242. <button class="z-button z-red z-mg-l6 z-mg-r6" onclick="doDeleteFile();">删除</button>
  243. </td>
  244. </tr>
  245. <tr class="z-h40" >
  246. <td class="z-pd-l10">
  247. <#--客户素材列表-->
  248. <div class="z-overflow-y-auto" style="width:400px" id="uploadingFileList"></div>
  249. <div class="z-overflow-y-auto z-h120 z-w100p" id="CustomFileList"></div>
  250. </td>
  251. </tr>
  252. </table>
  253. </div>