esop.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=0.5">
  6. <!-- 一个小时刷新一下当前页 -->
  7. <meta http-equiv="refresh" content="3600">
  8. <title>E-SOP</title>
  9. <link href="/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
  10. <link href="/css/dashboard.css" rel="stylesheet" />
  11. <script type="text/javascript" src="/js/service.js"></script>
  12. <script type="text/javascript" src="/js/session.js"></script>
  13. <script type="text/javascript" src="/js/getService.js"></script>
  14. <script type="text/javascript" src="/js/service/method-get-service.js"></script>
  15. <script type="text/javascript" src="/lib/jquery-3.4.1.js"></script>
  16. <script type="text/javascript" src="/lib/jquery-3.4.1.min.js"></script>
  17. </head>
  18. <body id="container" class="container-fluid">
  19. <div class="row no-padding head-bar" style="height:81px">
  20. <div class="col-lg-1 col-md-1">
  21. </div>
  22. <div class="col-lg-4 col-md-4 page-title">
  23. E-SOP
  24. </div>
  25. <div class="col-lg-4 col-md-4 block-padding">
  26. <button type="button" class="btn btn-warning"
  27. onclick="window.location.replace('/pages/dashboard/warehouse.html');">仓库看板</button>
  28. <button type="button" class="btn btn-warning"
  29. onclick="window.location.replace('/pages/dashboard/produce.html');">制造看板</button>
  30. <button type="button" class="btn btn-warning"
  31. onclick="window.location.replace('/pages/dashboard/line.html');">产线看板</button>
  32. <button type="button" class="btn btn-warning"
  33. onclick="window.location.replace('/pages/dashboard/quality.html');">品质看板</button>
  34. <button type="button" class="btn btn-warning"
  35. onclick="window.location.replace('/pages/dashboard/video1.html');">云看板</button>
  36. </div>
  37. <div class="col-lg-4 col-md-4">
  38. </div>
  39. </div>
  40. <div class="my-container" id="div-main">
  41. <div class="row block-padding">
  42. <div class="col-lg-4 col-md-4">
  43. <h2>任务({{num}})</h2>
  44. <div style="height: 270px;">
  45. <div class="row">
  46. <div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">订单号</div>
  47. <div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">物料号</div>
  48. <div class="col-lg-2 col-md-2 center no-padding" style="width: 35%;">物料名称</div>
  49. <!-- <div class="col-lg-2 col-md-2 center no-padding" style="width: 20%;">规格</div> -->
  50. <div class="col-lg-2 col-md-2 center no-padding" style="width: 12%;">数量</div>
  51. <div class="col-lg-1 col-md-2 center no-padding" style="width: 10%;">操作</div>
  52. </div>
  53. <div class="row" v-for="task in taskList2" style="margin-bottom: 2px;">
  54. <div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">{{task.orderSheetCode}}</div>
  55. <div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">{{task.materialCode}}</div>
  56. <div style="width: 35%;overflow:hidden; word-break:break-all;white-space:nowrap" class="col-lg-2 col-md-2 left no-padding" >{{task.materialName}}</div>
  57. <!-- <div class="col-lg-2 col-md-2 center no-padding" style="width: 20%;">{{task.specs}}</div> -->
  58. <div class="col-lg-2 col-md-2 center no-padding" style="width: 12%;">{{task.qty}}</div>
  59. <div class="col-lg-1 col-md-2 center no-padding" style="width: 10%;">
  60. <button type="button" class="btn btn-xs btn-warning" @click="selectFile(task.materialCode)">文件</button>
  61. </div>
  62. </div>
  63. </div>
  64. <br/>
  65. <h2>文件<span id="marText"></span></h2>
  66. <div class="row">
  67. <div class="col-lg-2 col-md-2 center no-padding" style="width: 48%;">文件名</div>
  68. <div class="col-lg-2 col-md-2 center no-padding" style="width: 25%;">文件类型</div>
  69. <div class="col-lg-1 col-md-2 center no-padding" style="width: 25%;">操作</div>
  70. </div>
  71. <div class="row" v-for="task in taskList" style="margin-bottom: 2px;">
  72. <div class="col-lg-2 col-md-2 center no-padding" style="width: 48%;">{{task.fileName}}</div>
  73. <div class="col-lg-2 col-md-2 center no-padding" style="width: 25%;">{{task.fileType}}</div>
  74. <div class="col-lg-1 col-md-2 center no-padding" style="width: 25%;">
  75. <button type="button" class="btn btn-xs btn-warning" @click="showfile(task.fileName,task.fileType)">查看</button>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="col-lg-8 col-md-8" >
  80. <img id="imgInfo" src="/files/imgInfo.jpg" width="100%" height="100%"/>
  81. <iframe id="frameMain" width="98%" border="0" frameborder="0" v-bind:src="filepath" style="background-color:#ffffff"></iframe>
  82. <img id="imgType" src="" width="auto" />
  83. <video id="videoType" src="" controls width="auto" > </video>
  84. <div id="textType" width="auto" ></div>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- jQuery -->
  89. <script src="/lib/jquery.min.js"></script>
  90. <script src="/lib/vue.min.js"></script>
  91. <script src="/lib/echarts/echarts.min.js"></script>
  92. <script src="/lib/echarts/theme/macarons.js"></script>
  93. <script src="/js/service/produce-task.js"></script>
  94. <script type="text/javascript">
  95. $(function () {
  96. hideAll();
  97. $("#imgInfo").show();
  98. })
  99. function hideAll(){
  100. $("#frameMain").hide();
  101. $("#imgType").hide();
  102. $("#videoType").hide();
  103. $("#imgInfo").hide();
  104. }
  105. var marCode = "";
  106. // const taskList1 = [];//ServiceProduceTask.getEsopFileList();
  107. // const taskList2 = [];//ServiceProduceTask.getEsopTaskList();
  108. $("#frameMain").height($(window).height()-110);
  109. $("#imgType").height($(window).height()-110);
  110. $("#videoType").height($(window).height()-110);
  111. var vm = new Vue({
  112. el: '#div-main',
  113. data: {
  114. taskList: [],
  115. taskList2: [],
  116. filepath:"",
  117. num:0
  118. },
  119. methods: {
  120. showfile: function (name,file) {
  121. if(file=='pdf'){
  122. hideAll();
  123. $("#frameMain").show();
  124. this.filepath = "/lib/pdfjs/web/viewer.html?file=/upFiles/"+marCode+"/"+name;
  125. $("#videoType").attr('src',"");
  126. }else if(file=='jpg' || file=='jpeg' || file=='png'){
  127. hideAll();
  128. $("#imgType").show();
  129. $("#imgType").attr('src',"/upFiles/"+marCode+"/"+name);
  130. $("#videoType").attr('src',"");
  131. }else if(file=='avi' || file=='mov' || file=='rmvb' || file=='rm' || file=='flv' || file=='mp4' || file=='3gp'){
  132. hideAll();
  133. $("#videoType").show();
  134. $("#videoType").attr('src',"/upFiles/"+marCode+"/"+name);
  135. }else{
  136. alert("暂时不支持该类型文件的展示");
  137. }
  138. },
  139. selectFile: function(code){
  140. marCode = code;
  141. $("#marText").text("("+code+")");
  142. this.taskList = ServiceProduceTask.getEsopFileList(code);
  143. },
  144. loadData:function(){
  145. this.cacheDataObject = {};
  146. //
  147. const taskList2 = ServiceProduceTask.getEsopTaskList();
  148. this.num = taskList2.length;
  149. this.cacheDataObject.taskList2 = {
  150. data: taskList2,
  151. pagesize: 11,
  152. pageindex: 0
  153. }
  154. this.taskList2 = taskList2.slice(0, this.cacheDataObject.taskList2.pagesize);
  155. },
  156. // 从服务器加载数据并显示
  157. refreshData: function () {
  158. // 关闭定时器
  159. clearInterval(this.timer_short);
  160. this.loadData();
  161. // 开启定时器
  162. this.timer_short = setInterval(this.scrollData, 30000);
  163. },
  164. // 轮播数据
  165. scrollData: function () {
  166. for (var key in this.cacheDataObject) {
  167. const dataList = this.cacheDataObject[key].data;
  168. const pagesize = this.cacheDataObject[key].pagesize;
  169. var pageindex = this.cacheDataObject[key].pageindex + 1;
  170. if (dataList.length > pagesize) {
  171. const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  172. pagesize > 0 ? 1 : 0);
  173. if (pageindex >= pagesum)
  174. pageindex = 0;
  175. this.cacheDataObject[key].pageindex = pageindex;
  176. const startIndex = pageindex * pagesize;
  177. const remainSum = dataList.length - startIndex;
  178. const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  179. const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  180. if(keyPar.length < 1){
  181. continue;
  182. }
  183. this[key] = dataList.slice(startIndex, startIndex + pagesize);
  184. }
  185. }
  186. }
  187. },
  188. mounted() {
  189. this.timer_long = setInterval(this.refreshData, 60000);
  190. this.refreshData();
  191. },
  192. beforeDestroy() {
  193. clearInterval(this.timer_long);
  194. clearInterval(this.timer_short);
  195. }
  196. });
  197. </script>
  198. </body>
  199. </html>