esop.html 13 KB

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