bottom1.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div id="pbottom1">
  3. <div class="bg-color-black1">
  4. <div class="up">
  5. <div class ="left">
  6. <div class="vertical-text">
  7. <span>当日</span>
  8. <span>产线</span>
  9. <span>计划</span>
  10. <span>未完</span>
  11. <span>成订</span>
  12. <span>单明</span>
  13. <span>细</span>
  14. </div>
  15. </div>
  16. <div class="body-box">
  17. <dv-scroll-board :config="config" ref="scroll-board" :key="componentKey" />
  18. </div>
  19. </div>
  20. <div class="down1">
  21. <div>{{shop}}</div>
  22. <div>今日计划数 <span class="spec">{{finishrate2}}</span> </div>
  23. <div>急单数 <span class="spec">{{finishrate}} </span> </div>
  24. <div>今日完成数 <span class="spec">{{finishrate3}} </span> </div>
  25. <div>今日完成率 <span class="spec">{{finishrate4}}% </span> </div>
  26. <div>今日订单数 <span class="spec">{{finishrate3}} </span> </div>
  27. <div>昨日达成率 <span class="spec">{{finishrate5}}% </span> </div>
  28. </div>
  29. <div class="ticker-wrapper">
  30. <div class="ticker-mask ticker-mask-left"></div>
  31. <div class="ticker-mask ticker-mask-right"></div>
  32. <div class="down2" v-html="msg">
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. config: {
  43. header: ['销售工单','业务员', '产品名称', '订单数', '计划数','完成数', '提醒事项','异常事项'],
  44. data: [],
  45. rowNum: 9,
  46. headerHeight: 45,
  47. headerBGC: '#FFFFFF',
  48. oddRowBGC: '#FFFFFF',
  49. evenRowBGC: '#FFFFFF',
  50. columnWidth: [220,120,350,140,140,140,420],
  51. align: ['center','center','center','center','center','center','center','center'],
  52. index: false,
  53. carousel: 'page',
  54. hoverPause: true,
  55. // 添加等待时间确保高度计算正确
  56. waitTime: 10000
  57. },
  58. timing: null,
  59. componentKey: 0,
  60. finishrate:0,
  61. finishrate2:0,
  62. finishrate3:0,
  63. finishrate4:0,
  64. finishrate5:0,
  65. shop: sessionStorage.getItem('li_code'),
  66. msg: '',
  67. }
  68. },
  69. mounted() {
  70. this.refreshdata();
  71. },
  72. activated() {
  73. this.componentKey += 1;
  74. this.refreshdata();
  75. },
  76. beforeDestroy() {
  77. clearInterval(this.timing);
  78. if (this.$refs['scroll-board'] && this.$refs['scroll-board'].destroy) {
  79. this.$refs['scroll-board'].destroy();
  80. }
  81. },
  82. methods: {
  83. refreshdata() {
  84. this.getdata();
  85. this.timing = setInterval(() => {
  86. this.getdata();
  87. }, 10000);
  88. },
  89. async getdata() {
  90. var caller = 'KB!LongLineDayPlan';
  91. var licode= sessionStorage.getItem('li_code');
  92. await this.$http.get("kanban/datalist.action?caller=" + caller + "&_noc=1&page=1&pageSize=100", {
  93. params: {
  94. condition: "V_OUTLINE='"+licode+"'",
  95. }
  96. }).then((result) => {
  97. let dataList = JSON.parse(result.data.data);
  98. let resultList = [];
  99. for (let index = 0; index < dataList.length; index++) {
  100. const element = dataList[index];
  101. let item = [];
  102. const cellClass = element.v_remark1 && element.v_remark1 !== "" ? 'colorRed' :
  103. element.v_blstatus == '加工中' ? 'colorRemind' : element.v_blstatus == '已完成'?'colorGrass':'colorY';
  104. //item.push(`<span class="cell-text ${cellClass}">${element.v_licode}</span>`);
  105. item.push(`<span class="cell-text ${cellClass}">${element.v_sacode}</span>`);
  106. item.push(`<span class="cell-text ${cellClass}">${element.v_seller}</span>`);
  107. item.push(`<span class="cell-text ${cellClass}">${element.v_jitype}</span>`);
  108. item.push(`<span class="cell-text ${cellClass}">${element.v_qty}</span>`);
  109. // item.push(`<span class="cell-text ${cellClass}">${element.v_blstatus}</span>`);
  110. item.push(`<span class="cell-text ${cellClass}">${element.v_planoutqty}</span>`);
  111. item.push(`<span class="cell-text ${cellClass}">${element.v_madeqty}</span>`);
  112. // item.push(`<span class="cell-text ${cellClass}">${element.v_madejd}</span>`);
  113. //item.push(`<span class="cell-text ${element.v_remark ? 'colorRemind' : cellClass}">${element.v_remark}</span>`);
  114. item.push(`<span class="cell-text ${cellClass}">${element.v_remark1}</span>`);
  115. item.push(`<span class="cell-text ${element.v_yc ? 'colorRemind' : cellClass}">${element.v_yc}</span>`);
  116. resultList.push(item);
  117. }
  118. this.$nextTick(() => {
  119. const scrollBoard = this.$refs['scroll-board'];
  120. if (scrollBoard) {
  121. scrollBoard.updateRows(resultList);
  122. if (scrollBoard.resize) {
  123. scrollBoard.resize();
  124. }
  125. }
  126. });
  127. }).catch((error) => {
  128. console.error(error);
  129. });
  130. //设备提醒信息
  131. caller = 'KB!LINEDEVICEREMIND';
  132. await this.$http.get("kanban/datalist.action?caller=" + caller + "&_noc=1&page=1&pageSize=100", {
  133. params: {
  134. condition: "de_workshop='"+licode+"'"
  135. }
  136. }).then((result) => {
  137. let dataList = JSON.parse(result.data.data);
  138. let msg = "";
  139. if (dataList.length > 0) {
  140. for (let index = 0; index < dataList.length; index++) {
  141. const element = dataList[index];
  142. msg += "<div>"+element.de_code + "&nbsp" + element.v_remind + "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp </div>";
  143. }
  144. this.msg = msg;
  145. }
  146. }, (result) => {
  147. console.error(result)
  148. }
  149. );
  150. //比例,用的是总看板的达成比例caller,如果不一样,自行修改caller
  151. caller = 'KB!TOTALDayMakeRate';
  152. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  153. params: {
  154. condition: "V_OUTLINE='"+licode+"'" ,
  155. }
  156. }).then((result) => {
  157. let dataList = JSON.parse(result.data.data);
  158. if(dataList.length>0){
  159. this.finishrate = dataList[0].finishrate;
  160. this.finishrate2 = dataList[0].finishrate2;
  161. this.finishrate3 = dataList[0].finishrate3;
  162. this.finishrate4 = dataList[0].finishrate4;
  163. this.finishrate5 = dataList[0].finishrate5;
  164. }
  165. }, (result) => {
  166. console.error(result)
  167. }
  168. );
  169. }
  170. }
  171. };
  172. </script>
  173. <style lang="scss">
  174. $box-height: 630px;
  175. $box-width: 100%;
  176. #pbottom1 {
  177. padding: 13px;
  178. height: $box-height;
  179. width: $box-width;
  180. border-radius: 5px;
  181. .bg-color-black1 {
  182. border-radius: 10px;
  183. height: 605px;
  184. padding: 5px;
  185. }
  186. .up {
  187. display: grid;
  188. grid-template-columns: 0.1fr 2fr ;
  189. .left {
  190. display: flex;
  191. align-items: center; /* 垂直居中 */
  192. .vertical-text {
  193. height: 420px;
  194. background: linear-gradient(160deg, #0066cc, #0044aa);
  195. color: white;
  196. padding: 15px 5px;
  197. border-radius: 15px;
  198. display: inline-flex;
  199. flex-direction: column;
  200. justify-content: center;
  201. align-items: center;
  202. font-size: 22px;
  203. font-weight: bold;
  204. text-align: center;
  205. line-height: 2.2;
  206. letter-spacing: 5px;
  207. transform: rotateX(10deg);
  208. transition: all 0.4s ease;
  209. }
  210. }
  211. .text {
  212. color: #c3cbde;
  213. font-size: 25px;
  214. }
  215. .body-box {
  216. width: $box-width;
  217. height: 495px;
  218. overflow: hidden;
  219. // border: 1px solid #000000;
  220. .dv-scroll-board {
  221. width: 100% !important;
  222. height: 495px;
  223. .header {
  224. font-size: 25px;
  225. color: #000000 !important;
  226. font-weight: bold;
  227. .header-item {
  228. line-height: 45px !important;
  229. // border-right: 1px solid #000000 !important;
  230. // border-bottom: 1px solid #000000 !important; // 加粗表头下边框
  231. // 表头单元格伪元素解决边框重叠
  232. &:after {
  233. content: "";
  234. position: absolute;
  235. top: -1px;
  236. left: -1px;
  237. right: -1px;
  238. height: 1px;
  239. background: #000000;
  240. }
  241. }
  242. }
  243. .rows {
  244. .row-item {
  245. line-height: 40px !important;
  246. margin: 0 !important;
  247. padding: 0 !important;
  248. color: #000000 !important;
  249. span.cell-text {
  250. display: inline-block;
  251. vertical-align: middle;
  252. font-size: 24px;
  253. line-height: 1.5;
  254. padding: 4px 0;
  255. }
  256. }
  257. /* .ceil {
  258. border-right: 1px solid #000000 !important;
  259. border-bottom: 1px solid #000000 !important;
  260. }*/
  261. // 行底边框
  262. &:after {
  263. content: "";
  264. position: absolute;
  265. bottom: -1px;
  266. left: 0;
  267. right: 0;
  268. height: 1px;
  269. background: #000000;
  270. z-index: 1;
  271. }
  272. }
  273. }
  274. }
  275. }
  276. .down1{
  277. width:100%;
  278. height: 50px;
  279. border-radius: 15px;
  280. color: white; /* 文字颜色 */
  281. padding: 1px 35px; /* 内边距 */
  282. background: linear-gradient(160deg, #0ad386, #00aa55);
  283. display: flex;
  284. justify-content: space-between;
  285. align-items: center;
  286. font-size: 23px;
  287. font-weight: bold;
  288. .spec{
  289. width:80px;
  290. padding: 4px 0px ;
  291. background: linear-gradient(160deg, #f3fcf8, #effdf6);
  292. color: #0ad386;
  293. display: inline-block;
  294. transition: all 0.3s ease;
  295. text-align: center;
  296. border-radius: 8px;
  297. }
  298. }
  299. .ticker-wrapper {
  300. display: flex;
  301. position: relative;
  302. height: 50px;
  303. align-items: center;
  304. overflow: hidden;
  305. color: #f32121;
  306. padding: 5px 25px 0px 25px;
  307. background: linear-gradient(160deg, #0066cc, #0044aa);
  308. font-size: 23px;
  309. font-weight: bold;
  310. margin-top: 10px;
  311. margin-left: -15px;
  312. margin-right: -15px;
  313. }
  314. .ticker-mask {
  315. position: absolute;
  316. top: 0;
  317. bottom: 0;
  318. width: 80px;
  319. z-index: 2;
  320. }
  321. .ticker-mask-left {
  322. left: 0;
  323. background: linear-gradient(to right, rgba(0, 68, 170, 1), rgba(0, 68, 170, 0));
  324. }
  325. .ticker-mask-right {
  326. right: 0;
  327. background: linear-gradient(to left, rgba(0, 68, 170, 1), rgba(0, 68, 170, 0));
  328. }
  329. .down2 {
  330. display: flex;
  331. position: absolute;
  332. white-space: nowrap;
  333. /* 修改动画名称和时间 */
  334. animation: scrollRight 30s linear infinite;
  335. padding: 10px 0;
  336. /* 确保从左侧开始 */
  337. left: 100%;
  338. }
  339. .down2:hover {
  340. animation-play-state: paused;
  341. }
  342. .down2 > div {
  343. display: inline-flex;
  344. align-items: center;
  345. font-weight: 500;
  346. position: relative;
  347. border-radius: 8px;
  348. margin: 0 10px;
  349. transition: all 0.3s ease;
  350. }
  351. .down2 > div:hover {
  352. transform: translateY(-3px);
  353. }
  354. .down2 > div::after {
  355. content: '';
  356. position: absolute;
  357. right: 0;
  358. top: 50%;
  359. transform: translateY(-50%);
  360. height: 35px;
  361. width: 2px;
  362. background: rgba(255, 255, 255, 0.2);
  363. }
  364. .down2 > div:last-child::after {
  365. display: none;
  366. }
  367. /* 新增关键帧动画 */
  368. @keyframes scrollRight {
  369. 0% {
  370. transform: translateX(0);
  371. }
  372. 100% {
  373. transform: translateX(-100%);
  374. }
  375. }
  376. }
  377. </style>