esop.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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-4 col-md-4 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. <button type="button" class="btn btn-warning"
  33. onclick="window.location.replace('/pages/dashboard/video1.html');">云看板</button>
  34. </div>
  35. <div class="col-lg-4 col-md-4">
  36. </div>
  37. </div>
  38. <div class="my-container" id="div-main">
  39. <div class="row block-padding">
  40. <div class="col-lg-3 col-md-3">
  41. <h3>任务({{num}})
  42. <button style="background-color: #003D80;" @click="SYPage()">首页</button>
  43. <button style="background-color: #003D80;" @click="beforePage()">上页</button>
  44. <button style="background-color: #003D80;" @click="afterPage()">下页</button></h3>
  45. <div style="height: 270px;">
  46. <div class="row">
  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: 19%;">物料号</div>
  49. <div class="col-lg-2 col-md-2 center no-padding" style="width: 35%;">物料名称</div>
  50. <!-- <div class="col-lg-2 col-md-2 center no-padding" style="width: 20%;">规格</div> -->
  51. <div class="col-lg-2 col-md-2 center no-padding" style="width: 12%;">数量</div>
  52. <div class="col-lg-1 col-md-2 center no-padding" style="width: 10%;">操作</div>
  53. </div>
  54. <div class="row" v-for="task in taskList2" style="margin-bottom: 2px;">
  55. <div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">{{task.orderSheetCode}}</div>
  56. <div class="col-lg-2 col-md-2 center no-padding" style="width: 19%;">{{task.materialCode}}</div>
  57. <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>
  58. <!-- <div class="col-lg-2 col-md-2 center no-padding" style="width: 20%;">{{task.specs}}</div> -->
  59. <div class="col-lg-2 col-md-2 center no-padding" style="width: 12%;">{{task.qty}}</div>
  60. <div class="col-lg-1 col-md-2 center no-padding" style="width: 10%;">
  61. <button type="button" class="btn btn-xs btn-warning" @click="selectFile(task.materialCode)">文件</button>
  62. </div>
  63. </div>
  64. </div>
  65. <br/>
  66. <h3>文件<span id="marText"></span></h3>
  67. <div class="row">
  68. <div class="col-lg-2 col-md-2 center no-padding" style="width: 48%;">文件名</div>
  69. <div class="col-lg-2 col-md-2 center no-padding" style="width: 25%;">文件类型</div>
  70. <div class="col-lg-1 col-md-2 center no-padding" style="width: 25%;">操作</div>
  71. </div>
  72. <div class="row" v-for="task in taskList" style="margin-bottom: 2px;">
  73. <div class="col-lg-2 col-md-2 center no-padding" style="width: 48%;">{{task.fileName}}</div>
  74. <div class="col-lg-2 col-md-2 center no-padding" style="width: 25%;">{{task.fileType}}</div>
  75. <div class="col-lg-1 col-md-2 center no-padding" style="width: 25%;">
  76. <button type="button" class="btn btn-xs btn-warning" @click="showfile(task.fileName,task.fileType)">查看</button>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="col-lg-9 col-md-9" >
  81. <img id="imgInfo" src="/files/imgInfo.jpg" width="100%" height="100%"/>
  82. <iframe id="frameMain" width="100%" border="0" frameborder="0" v-bind:src="filepath" style="background-color:#ffffff"></iframe>
  83. <img id="imgType" src="" width="auto" />
  84. <video id="videoType" src="" controls width="auto" > </video>
  85. <div id="textType" width="auto" ></div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- jQuery -->
  90. <script src="/lib/jquery.min.js"></script>
  91. <script src="/lib/vue.min.js"></script>
  92. <script src="/lib/echarts/echarts.min.js"></script>
  93. <script src="/lib/echarts/theme/macarons.js"></script>
  94. <script src="/js/service/produce-task.js"></script>
  95. <script type="text/javascript">
  96. $(function () {
  97. hideAll();
  98. $("#imgInfo").show();
  99. })
  100. function hideAll(){
  101. $("#frameMain").hide();
  102. $("#imgType").hide();
  103. $("#videoType").hide();
  104. $("#imgInfo").hide();
  105. }
  106. var marCode = "";
  107. // const taskList1 = [];//ServiceProduceTask.getEsopFileList();
  108. // const taskList2 = [];//ServiceProduceTask.getEsopTaskList();
  109. $("#frameMain").height($(window).height()-110);
  110. $("#imgType").height($(window).height()-110);
  111. $("#videoType").height($(window).height()-110);
  112. const taskList2 = ServiceProduceTask.getEsopTaskList();
  113. var vm = new Vue({
  114. el: '#div-main',
  115. data: {
  116. taskList: [],
  117. taskList2: [],
  118. filepath:"",
  119. num:taskList2.length,
  120. pIndex:0,
  121. pSize:10
  122. },
  123. methods: {
  124. SYPage(){
  125. this.pIndex = 0;
  126. this.pSize = 10;
  127. this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
  128. },
  129. beforePage(){
  130. if(this.pIndex == 0){
  131. alert("已是第一页");
  132. return;
  133. }
  134. this.pIndex = this.pIndex - 10;
  135. this.pSize = this.pSize - 10;
  136. this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
  137. },
  138. afterPage(){
  139. if(this.pSize >= taskList2.length){
  140. alert("已是最后一页");
  141. return;
  142. }
  143. this.pIndex = this.pSize;
  144. this.pSize = this.pSize + 10;
  145. this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
  146. },
  147. showfile: function (name,file) {
  148. if(file=='pdf'){
  149. hideAll();
  150. $("#frameMain").show();
  151. this.filepath = "/lib/pdfjs/web/viewer.html?file=/upFiles/"+marCode+"/"+name;
  152. $("#videoType").attr('src',"");
  153. }else if(file=='jpg' || file=='jpeg' || file=='png'){
  154. hideAll();
  155. $("#imgType").show();
  156. $("#imgType").attr('src',"/upFiles/"+marCode+"/"+name);
  157. $("#videoType").attr('src',"");
  158. }else if(file=='avi' || file=='mov' || file=='rmvb' || file=='rm' || file=='flv' || file=='mp4' || file=='3gp'){
  159. hideAll();
  160. $("#videoType").show();
  161. $("#videoType").attr('src',"/upFiles/"+marCode+"/"+name);
  162. }else{
  163. alert("暂时不支持该类型文件的展示");
  164. }
  165. },
  166. selectFile: function(code){
  167. marCode = code;
  168. $("#marText").text("("+code+")");
  169. this.taskList = ServiceProduceTask.getEsopFileList(code);
  170. },
  171. loadData:function(){
  172. // this.cacheDataObject = {};
  173. // //
  174. // const taskList2 = ServiceProduceTask.getEsopTaskList();
  175. // this.num = taskList2.length;
  176. // this.cacheDataObject.taskList2 = {
  177. // data: taskList2,
  178. // pagesize: 11,
  179. // pageindex: 0
  180. // }
  181. // this.taskList2 = taskList2.slice(0, this.cacheDataObject.taskList2.pagesize);
  182. },
  183. // 从服务器加载数据并显示
  184. refreshData: function () {
  185. // 关闭定时器
  186. // clearInterval(this.timer_short);
  187. // this.loadData();
  188. // 开启定时器
  189. // this.timer_short = setInterval(this.scrollData, 30000);
  190. },
  191. // 轮播数据
  192. scrollData: function () {
  193. // for (var key in this.cacheDataObject) {
  194. // const dataList = this.cacheDataObject[key].data;
  195. // const pagesize = this.cacheDataObject[key].pagesize;
  196. // var pageindex = this.cacheDataObject[key].pageindex + 1;
  197. // if (dataList.length > pagesize) {
  198. // const pagesum = (dataList.length / pagesize).toFixed(0) * 1 + (dataList.length %
  199. // pagesize > 0 ? 1 : 0);
  200. // if (pageindex >= pagesum)
  201. // pageindex = 0;
  202. // this.cacheDataObject[key].pageindex = pageindex;
  203. // const startIndex = pageindex * pagesize;
  204. // const remainSum = dataList.length - startIndex;
  205. // const recordSum = remainSum >= pagesize ? pagesize : remainSum;
  206. // const keyPar = dataList.slice(startIndex, startIndex + pagesize);
  207. // if(keyPar.length < 1){
  208. // continue;
  209. // }
  210. // this[key] = dataList.slice(startIndex, startIndex + pagesize);
  211. // }
  212. // }
  213. }
  214. },
  215. mounted() {
  216. this.taskList2 = taskList2.slice(this.pIndex, this.pSize);
  217. // this.timer_long = setInterval(this.refreshData, 60000);
  218. // this.refreshData();
  219. },
  220. beforeDestroy() {
  221. // clearInterval(this.timer_long);
  222. // clearInterval(this.timer_short);
  223. }
  224. });
  225. </script>
  226. </body>
  227. </html>