centerRight1.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div id="as-centerRight1">
  3. <div class="bg-color-black">
  4. <div class="d-flex pt-2 pl-2">
  5. <span>
  6. <icon name="chart-line" class="text-icon"></icon>
  7. </span>
  8. <div class="d-flex">
  9. <span class="fs-xl text mx-2">线体当日产量统计</span>
  10. </div>
  11. </div>
  12. <div class="d-flex jc-center body-box">
  13. <dv-scroll-board class="dv-scr-board" :config="config" ref="scroll-board" />
  14. </div>
  15. <div class="photo-box">
  16. <div>
  17. <div>
  18. <img :src="imgSrc1" class="responsive-img">
  19. </div>
  20. <div>
  21. <p>拉长: {{ upitem.v_leadname }}</p>
  22. <p>产线人数: {{zzmancount}}</p>
  23. </div>
  24. </div>
  25. <div>
  26. <div>
  27. <img :src="imgSrc2" class="responsive-img">
  28. </div>
  29. <div>
  30. <p>IPQC: {{ upitem.v_quaname }}</p>
  31. <p>品检人数: {{bzmancount}}</p>
  32. </div>
  33. </div>
  34. <div>
  35. <div>
  36. <img :src="imgSrc3" class="responsive-img">
  37. </div>
  38. <div>
  39. <p>PE: {{ upitem.v_engineername }}</p>
  40. <p>管理人数: {{glmancount}}</p>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. upitem:{},
  52. imgSrc1:'',
  53. imgSrc2:'',
  54. imgSrc3:'',
  55. zzmancount:0,
  56. bzmancount:0,
  57. glmancount:0,
  58. config: {
  59. header: ['线别', '投入','产出','老化','不良','良率%','待维修','已维修'],
  60. data: [
  61. ],
  62. rowNum: 1, //表格行数
  63. headerHeight: 35,
  64. headerBGC: '#0f1325', //表头
  65. oddRowBGC: '#0f1325', //奇数行
  66. evenRowBGC: '#171c33', //偶数行
  67. columnWidth: [110,100,100,80,80,95,95,90],
  68. align: ['center','center','center','center','center','center','center','center']
  69. },
  70. timing :null
  71. }
  72. },
  73. mounted() {
  74. this.refreshdata()
  75. },
  76. beforeDestroy () {
  77. clearInterval(this.timing)
  78. },
  79. methods: {
  80. refreshdata() {
  81. this.getdata(); //获取-数据
  82. this.timing = setInterval(() => {
  83. this.getdata(); //获取--数据
  84. }, 30000);
  85. },
  86. async getdata() {
  87. var caller = 'DPLANTOUTPUT!ZZ';
  88. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  89. params: {
  90. condition: "1=1",
  91. }
  92. }).then((result)=>{
  93. let dataList = JSON.parse(result.data.data);
  94. let resultList = new Array();
  95. for (let index = 0; index < dataList.length; index++) {
  96. const element = dataList[index];
  97. let item = new Array();
  98. item.push(element.v_licode);
  99. item.push("<span class='colorGrass'>"+element.inqty+"</span>");
  100. item.push("<span class='colorGrass'>"+element.outqty+"</span>");
  101. item.push("<span class='colorGrass'>"+element.agingqty+"</span>");
  102. item.push("<span class='colorGrass'>"+element.ngqty+"</span>");
  103. item.push("<span class='colorGrass'>" + element.okrate + "</span>");
  104. item.push("<span class='colorGrass'>"+element.needrepairqty+"</span>");
  105. item.push("<span class='colorGrass'>"+element.repairqty+"</span>");
  106. resultList.push(item);
  107. }
  108. const scrollBoard = this.$refs['scroll-board'];
  109. //刷新数据
  110. scrollBoard.updateRows(resultList);
  111. },(result)=>{
  112. console.error(result)
  113. }
  114. );
  115. caller = 'KB!UpLineManInfo';
  116. await this.$http.get("kanban/datalist.action?caller=" + caller + "&_noc=1&page=1&pageSize=100", {
  117. params: {
  118. condition: "1=1",
  119. }
  120. }).then((result) => {
  121. let dataList = JSON.parse(result.data.data);
  122. if (dataList.length > 0) {
  123. this.upitem = dataList[0];
  124. if (null != this.upitem.v_leadimageurl && '' != this.upitem.v_leadimageurl) {
  125. this.fetchImage('imgSrc1', this.upitem.v_leadimageurl);
  126. }
  127. if (null != this.upitem.v_quaimageurl && '' != this.upitem.v_quaimageurl) {
  128. this.fetchImage('imgSrc2', this.upitem.v_quaimageurl);
  129. }
  130. if (null != this.upitem.v_engineerimageurl && '' != this.upitem.v_engineerimageurl) {
  131. this.fetchImage('imgSrc3', this.upitem.v_engineerimageurl);
  132. }
  133. } else {
  134. this.upitem = {},
  135. this.imgSrc1 = '';
  136. this.imgSrc2 = '';
  137. this.imgSrc3 = '';
  138. }
  139. }, (result) => {
  140. console.error(result)
  141. }
  142. );
  143. caller = 'KB!UpLineManTotalNew';
  144. await this.$http.get("kanban/datalist.action?caller=" + caller + "&_noc=1&page=1&pageSize=100", {
  145. params: {
  146. condition: "1=1",
  147. }
  148. }).then((result) => {
  149. let dataList = JSON.parse(result.data.data);
  150. if (dataList.length > 0) {
  151. this.zzmancount = dataList[0].zzmancount;
  152. this.bzmancount = dataList[0].bzmancount;
  153. this.glmancount = dataList[0].glmancount;
  154. }
  155. }, (result) => {
  156. console.error(result)
  157. }
  158. );
  159. },
  160. async fetchImage(param,url) {
  161. try {
  162. console.log(param);
  163. // 假设你已经有了token,并且知道图片的URL
  164. let response = await this.$httpImg.get("/kanban/download.action?path="+url+"&_noc=1");
  165. if (response.status === 200) {
  166. // 创建一个URL,并且使用这个URL作为img的src
  167. this[param] = URL.createObjectURL(new Blob([response.data]));
  168. }else{
  169. this[param] = '';
  170. }
  171. } catch (error) {
  172. console.error('Error fetching image:', error);
  173. }
  174. },
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. $box-height: 420px;
  180. $box-width: 640px;
  181. #as-centerRight1 {
  182. padding: 10px;
  183. height: $box-height;
  184. width: $box-width;
  185. border-radius: 5px;
  186. .bg-color-black {
  187. height: $box-height - 30px;
  188. border-radius: 10px;
  189. }
  190. .text {
  191. color: #c3cbde;
  192. // font-size: 15px;
  193. }
  194. .body-box {
  195. border-radius: 10px;
  196. overflow: hidden;
  197. .dv-scr-board {
  198. width: 600px;
  199. height: 60px;
  200. }
  201. }
  202. .photo-box{
  203. width: 100%;
  204. height: 280px;
  205. margin-top: 15px;
  206. display: flex;
  207. justify-content: space-between;
  208. >div{
  209. width: 30%;
  210. height: 100%;
  211. >div:first-child{
  212. height: calc(100% - 60px);
  213. border-radius: 5px 5px 0 0;
  214. >img{
  215. display: block;
  216. height: 100%;
  217. width: 100%;
  218. border-radius: 3px;
  219. }
  220. }
  221. >div:nth-child(2){
  222. width: 100%;
  223. height: 60px;
  224. text-align: center;
  225. >p:first-child{
  226. font-size: 22px;
  227. color: #fff;
  228. line-height: 40px;
  229. }
  230. >p{
  231. line-height: 20px;
  232. font-size: 18px;
  233. color: #33cea0;
  234. }
  235. }
  236. }
  237. }
  238. }
  239. </style>