esop.html 10 KB

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