esop.html 13 KB

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