productionDailyDashboard.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  1. <template>
  2. <vue-fullscreen
  3. class="box-container"
  4. v-cloak
  5. v-model="isFullscreen"
  6. fullscreenClass="box-container"
  7. :exit-on-click-wrapper="false"
  8. >
  9. <div class="box-container" v-cloak>
  10. <div class="box-header">
  11. <div class="logo">
  12. <el-select
  13. style="width: 100%"
  14. v-model="teamId"
  15. placeholder="请选择"
  16. @change="changeTeam"
  17. >
  18. <el-option
  19. v-for="item in teamList"
  20. :key="item.id"
  21. :label="item.name"
  22. :value="item.value"
  23. >
  24. </el-option>
  25. </el-select>
  26. </div>
  27. <div class="title">班组生产日综合看板</div>
  28. <div class="time">
  29. <div class="time-display">
  30. <span class="date-text">{{ date }}</span>
  31. <span class="time-text">{{ time }}</span>
  32. <span class="week-text">{{ week }}</span>
  33. </div>
  34. <span class="fullscreen-toggle" @click.passive="onFullscreen">
  35. <i
  36. v-if="isFullscreen"
  37. title="取消全屏"
  38. class="el-icon-_screen-restore"
  39. ></i>
  40. <i v-else title="全屏" class="el-icon-_screen-full"></i>
  41. </span>
  42. </div>
  43. </div>
  44. <div class="box-middle">
  45. <div class="box-middle-sidebar left-sidebar">
  46. <!-- 当日生产数量卡片 -->
  47. <div class="card-container">
  48. <chart-card
  49. title="当日生产数量"
  50. size="small"
  51. >
  52. <div class="number-display-container">
  53. <div class="number-display">
  54. <!-- 十万位 -->
  55. <div class="unit-box">
  56. <span class="unit">十万</span>
  57. <div class="digit-box">
  58. <span class="digit">{{ productionData.transformQuantity[0] }}</span>
  59. </div>
  60. </div>
  61. <!-- 万位 -->
  62. <div class="unit-box">
  63. <span class="unit">万</span>
  64. <div class="digit-box">
  65. <span class="digit">{{ productionData.transformQuantity[1] }}</span>
  66. </div>
  67. </div>
  68. <!-- 千位 -->
  69. <div class="unit-box">
  70. <span class="unit">千</span>
  71. <div class="digit-box">
  72. <span class="digit">{{ productionData.transformQuantity[2] }}</span>
  73. </div>
  74. </div>
  75. <!-- 千位分隔符 -->
  76. <div class="separator">,</div>
  77. <!-- 百位 -->
  78. <div class="unit-box">
  79. <span class="unit"></span>
  80. <div class="digit-box">
  81. <span class="digit">{{ productionData.transformQuantity[3] }}</span>
  82. </div>
  83. </div>
  84. <!-- 十位 -->
  85. <div class="unit-box">
  86. <span class="unit"></span>
  87. <div class="digit-box">
  88. <span class="digit">{{ productionData.transformQuantity[4] }}</span>
  89. </div>
  90. </div>
  91. <!-- 个位 -->
  92. <div class="unit-box">
  93. <span class="unit"></span>
  94. <div class="digit-box">
  95. <span class="digit">{{ productionData.transformQuantity[5] }}</span>
  96. </div>
  97. </div>
  98. </div>
  99. <!-- 生产统计项 -->
  100. <div class="card-stats">
  101. <div class="stat-item-container">
  102. <div class="stat-icon">
  103. <img src="@/assets/png/Group.png" alt="要求生产" />
  104. </div>
  105. <div class="stat-info">
  106. <div class="stat-label">要求生产总数量:</div>
  107. <div
  108. ><span class="stat-value">{{ productionData.totalQuantity }}</span
  109. >
  110. </div
  111. >
  112. </div>
  113. </div>
  114. <div class="stat-item-container">
  115. <div class="stat-icon">
  116. <img src="@/assets/png/Group.png" alt="达成率" />
  117. </div>
  118. <div class="stat-info">
  119. <div class="stat-label">生产达成率:</div>
  120. <div><span class="stat-value">{{ productionData.quantityAchievementRate || 0 }}</span></div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </chart-card>
  126. </div>
  127. <div class="card-container">
  128. <!-- 各工序生产数量卡片 -->
  129. <!-- <chart-card
  130. title="各工序生产数量"
  131. size="small"
  132. >
  133. <bar-chart
  134. :data="eachProcessOnDutyNum"
  135. class="process-chart-container"
  136. ></bar-chart>
  137. </chart-card> -->
  138. <div class="content-top-container" style="height: 100%;">
  139. <chart-card
  140. title="生产工单进度"
  141. size="small"
  142. >
  143. <div class="content-table" v-if="isFlag">
  144. <table class="main-table">
  145. <colgroup>
  146. <col style="width: 12%"></col>
  147. <col style="width: 15%"></col>
  148. <col style="width: 13%"></col>
  149. <col style="width: 13%"></col>
  150. <col style="width: 12%"></col>
  151. <col style="width: 15%"></col>
  152. <col style="width: 15%"></col>
  153. <col style="width: 15%"></col>
  154. </colgroup>
  155. <thead>
  156. <tr>
  157. <th style="width: 12%">生产工单号</th>
  158. <th style="width: 15%">产品名称</th>
  159. <th style="width: 13%">要求完成数量</th>
  160. <th style="width: 13%">已完成数量</th>
  161. <th style="width: 12%">生产达成率</th>
  162. <th style="width: 15%">计划开始时间</th>
  163. <th style="width: 15%">计划结束时间</th>
  164. <th style="width: 15%">当前工序</th>
  165. </tr>
  166. </thead>
  167. </table>
  168. <div class="scroll-container">
  169. <vue-seamless-scroll :data="tableData" :class-option="classOption">
  170. <table class="main-table">
  171. <colgroup>
  172. <col style="width: 12%"></col>
  173. <col style="width: 15%"></col>
  174. <col style="width: 13%"></col>
  175. <col style="width: 13%"></col>
  176. <col style="width: 12%"></col>
  177. <col style="width: 15%"></col>
  178. <col style="width: 15%"></col>
  179. <col style="width: 15%"></col>
  180. </colgroup>
  181. <tbody>
  182. <!-- 非红色行(State=N) -->
  183. <tr
  184. v-for="item in tableData"
  185. :key="`scroll-${item.productionOrderNumber}`"
  186. class="table-row"
  187. :style="{ backgroundColor: item.isDelayed === 1 ? '#ff4d4f' : '#031d42' }"
  188. >
  189. <td class="table-cell">{{ item.productionOrderNumber }}</td>
  190. <td class="table-cell">{{ item.productName }}</td>
  191. <td class="table-cell">{{ item.requestProductionQuantity }}</td>
  192. <td class="table-cell">{{ item.completedQuantity }}</td>
  193. <td class="table-cell">{{ item.productionAchievementRate }}</td>
  194. <td class="table-cell">{{ item.plannedStartTime }}</td>
  195. <td class="table-cell">{{ item.plannedEndTime }}</td>
  196. <td class="table-cell">{{ item.currentProcess }}</td>
  197. </tr>
  198. </tbody>
  199. </table>
  200. </vue-seamless-scroll>
  201. <!-- 无数据时显示占位 -->
  202. <div v-if="fixedRows.length === 0 && scrollRows.length === 0">
  203. <div class="empty-cell"> 暂无生产工单数据 </div>
  204. </div>
  205. </div>
  206. </div>
  207. </chart-card>
  208. </div>
  209. </div>
  210. <div class="card-container">
  211. <!-- 产品生产数量TOP10 -->
  212. <chart-card
  213. title="各工序生产达成率"
  214. size="large"
  215. >
  216. <!-- <product-top10-chart
  217. :data="productionAchievementRate"
  218. class="product-top10-chart-container"
  219. ></product-top10-chart> -->
  220. <qualification-rate-chart
  221. :data="productionAchievementRate"
  222. class="process-chart-container"
  223. ></qualification-rate-chart>
  224. </chart-card>
  225. </div>
  226. </div>
  227. <div class="box-middle-content">
  228. <div class="content-card-container">
  229. <!-- 当日生产情况 -->
  230. <div class="sidebar-card">
  231. <div class="card-header">
  232. <div class="card-logo">
  233. <img src="@/assets/png/icon.png" alt="图标" />
  234. </div>
  235. <div class="card-title">当日生产情况</div>
  236. </div>
  237. <div class="content-empty">
  238. <div class="Remark"
  239. >注:工单达成率=已完成工单数量/(已延期+生产中+已完成)工单数量</div
  240. >
  241. <div class="content-box">
  242. <div class="box-item">
  243. <div class="item-img">{{ productionData.delayNumber }}</div>
  244. <div class="item-text">已延期生产单数</div>
  245. </div>
  246. <div class="box-item">
  247. <div class="item-img">{{ productionData.achievementRate || 0 }}</div>
  248. <div class="item-text">工单达成率</div>
  249. </div>
  250. <div class="box-item">
  251. <div class="item-img">{{ productionData.numberToBeProduced || 0 }}</div>
  252. <div class="item-text">待生产单数</div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. <div class="content-top-container" style="height: 56vh">
  259. <chart-card
  260. title="工位任务单"
  261. size="small"
  262. >
  263. <div class="content-table" v-if="isFlag">
  264. <table class="main-table">
  265. <colgroup>
  266. <col style="width: 10%"></col>
  267. <col style="width: 10%"></col>
  268. <col style="width: 14%"></col>
  269. <col style="width: 14%"></col>
  270. <col style="width: 15%"></col>
  271. <col style="width: 15%"></col>
  272. <col style="width: 15%"></col>
  273. <col style="width: 10%"></col>
  274. <col style="width: 10%"></col>
  275. <col style="width: 15%"></col>
  276. </colgroup>
  277. <thead>
  278. <tr>
  279. <th style="width: 10%">任务编号</th>
  280. <th style="width: 10%">计划编号</th>
  281. <th style="width: 14%">执行对象名称</th>
  282. <th style="width: 14%">产品编码</th>
  283. <th style="width: 15%">产品名称</th>
  284. <th style="width: 15%">班组名称</th>
  285. <th style="width: 15%">工序名称</th>
  286. <th style="width: 10%">任务数量</th>
  287. <th style="width: 10%">报工数量</th>
  288. <th style="width: 15%">报工时间</th>
  289. </tr>
  290. </thead>
  291. </table>
  292. <div class="scroll-container">
  293. <vue-seamless-scroll :data="tableData1" :class-option="classOption">
  294. <table class="main-table">
  295. <colgroup>
  296. <col style="width: 10%"></col>
  297. <col style="width: 10%"></col>
  298. <col style="width: 14%"></col>
  299. <col style="width: 14%"></col>
  300. <col style="width: 15%"></col>
  301. <col style="width: 15%"></col>
  302. <col style="width: 15%"></col>
  303. <col style="width: 10%"></col>
  304. <col style="width: 10%"></col>
  305. <col style="width: 15%"></col>
  306. </colgroup>
  307. <tbody>
  308. <!-- 非红色行(State=N) -->
  309. <tr
  310. v-for="item in tableData1"
  311. :key="`scroll-${item.productionPlanCode}`"
  312. class="table-row"
  313. >
  314. <td class="table-cell">{{ item.assigneeCode }}</td>
  315. <td class="table-cell">{{ item.productionPlanCode }}</td>
  316. <td class="table-cell">{{ item.assigneeName }}</td>
  317. <td class="table-cell">{{ item.productCode }}</td>
  318. <td class="table-cell">{{ item.productName }}</td>
  319. <td class="table-cell">{{ item.assignTeamName }}</td>
  320. <td class="table-cell">{{ item.taskName }}</td>
  321. <td class="table-cell">{{ item.quantity }}</td>
  322. <td class="table-cell">{{ item.reportQuantity }}</td>
  323. <td class="table-cell">{{ item.reportTime }}</td>
  324. </tr>
  325. </tbody>
  326. </table>
  327. </vue-seamless-scroll>
  328. <!-- 无数据时显示占位 -->
  329. <div v-if="tableData1.length === 0">
  330. <div class="empty-cell"> 暂无任务单数据 </div>
  331. </div>
  332. </div>
  333. </div>
  334. </chart-card>
  335. </div>
  336. </div>
  337. <div class="box-middle-sidebar right-sidebar">
  338. <div class="card-container">
  339. <chart-card
  340. title="各工序生产数量"
  341. size="small"
  342. >
  343. <bar-chart
  344. :data="eachProcessOnDutyNum"
  345. class="process-chart-container"
  346. ></bar-chart>
  347. </chart-card>
  348. <!-- 设备实时状态 -->
  349. <!-- <chart-card
  350. title="设备实时状态"
  351. size="small"
  352. >
  353. <device-status-chart
  354. :data="eachProcessEquipmentNum"
  355. class="process-chart-container"
  356. ></device-status-chart>
  357. </chart-card> -->
  358. </div>
  359. <div class="card-container">
  360. <!-- 设备实时状态 -->
  361. <chart-card
  362. title="各工序报工数"
  363. size="small"
  364. >
  365. <!-- <device-status-chart
  366. :data="productQualificationNum"
  367. class="process-chart-container"
  368. ></device-status-chart> -->
  369. <bar-chart
  370. :data="productQualificationNum"
  371. class="process-chart-container"
  372. ></bar-chart>
  373. </chart-card>
  374. </div>
  375. <div class="card-container">
  376. <!-- 各产品合格率 -->
  377. <chart-card
  378. title="各工序损耗率"
  379. size="large"
  380. >
  381. <qualification-rate-chart
  382. :data="productQualificationRate"
  383. class="qualification-rate-chart-container"
  384. ></qualification-rate-chart>
  385. </chart-card>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </vue-fullscreen>
  391. </template>
  392. <script>
  393. import { component as VueFullscreen } from 'vue-fullscreen';
  394. import { toggleFullscreen } from 'ele-admin';
  395. import { getTeamProductionDayDataOne, getTeamProductionDayDataThree, getTeamProductionDayDataTwo, queryTeamListAll ,pageByCurrentUserTeam} from '@/api/vis/productionDailyDashboard';
  396. // 导入图表组件
  397. import ChartCard from './components/ChartCard';
  398. import ProcessPersonnelChart from './components/charts/ProcessPersonnelChart';
  399. import DeviceStatusChart from './components/charts/DeviceStatusChart';
  400. import ProductTop10Chart from './components/charts/ProductTop10Chart';
  401. import QualificationRateChart from './components/charts/QualificationRateChart';
  402. import BarChart from './components/charts/BarChart';
  403. import vueSeamlessScroll from "vue-seamless-scroll";
  404. export default {
  405. name: 'DashboardFramework',
  406. components: {
  407. VueFullscreen,
  408. ChartCard,
  409. ProcessPersonnelChart,
  410. DeviceStatusChart,
  411. ProductTop10Chart,
  412. QualificationRateChart,
  413. BarChart,
  414. vueSeamlessScroll
  415. },
  416. computed: {
  417. classOption() {
  418. return {
  419. step: 0.5, // 数值越大速度滚动越快
  420. limitMoveNum: 5, // 开始无缝滚动的数据量
  421. hoverStop: true, // 是否开启鼠标悬停stop
  422. direction: 1, // 0向下 1向上 2向左 3向右
  423. openWatch: true, // 开启数据实时监控刷新dom
  424. singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动)
  425. singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动)
  426. waitTime: 5000, // 单步运动停止的时间(默认值1000ms)
  427. };
  428. },
  429. contentWidth() {
  430. return this.$store.state.theme.contentWidth || '100%';
  431. },
  432. // 固定行:红色行(State=Y)是否已延期(0:否;1:是)
  433. fixedRows() {
  434. return this.tableData.filter((item) => item.isDelayed == 1);
  435. },
  436. // 非红色行:State=N
  437. scrollRows() {
  438. return this.tableData.filter((item) => item.isDelayed == 0);
  439. },
  440. },
  441. watch: {
  442. isFullscreen: {
  443. handler() {
  444. this.isFlag = false;
  445. this.$nextTick(() => {
  446. this.isFlag = true;
  447. });
  448. },
  449. immediate: true
  450. },
  451. contentWidth: {
  452. handler() {
  453. clearTimeout(this.resizeTimer);
  454. this.isFlag = false;
  455. this.resizeTimer = setTimeout(() => {
  456. this.$nextTick(() => {
  457. this.isFlag = true;
  458. });
  459. }, 300);
  460. },
  461. immediate: true
  462. }
  463. },
  464. data() {
  465. return {
  466. isFullscreen: false,
  467. isFlag: false,
  468. resizeTimer: null,
  469. updateTimer: null,
  470. date: '',
  471. time: '',
  472. week: '',
  473. teamId: '',
  474. // 生产工单表格数据
  475. tableData: [],
  476. tableData1: [],
  477. productionData: {
  478. quantity: 0, // 当日生产数量(核心数据)
  479. weight: 0, // 当日生产重量(核心数据)
  480. transformQuantity: 0, // 转换后的生产数量
  481. transformWeight: 0, // 转换后的生产重量
  482. delayNumber: 0,
  483. noPassRate: 0,
  484. passRate: 0,
  485. quantity: 0,
  486. quantityAchievementRate: 0,
  487. totalQuantity: 0,
  488. totalWeight: 0,
  489. weight: 0,
  490. weightAchievementRate: 0
  491. },
  492. // 各工序生产数量
  493. eachProcessOnDutyNum: [],
  494. // 设备实时状态数据
  495. eachProcessEquipmentNum: [],
  496. // 产品生产数量TOP10数据
  497. productionAchievementRate: {
  498. productNames: [],
  499. rates: [] // 生产达成率(%)
  500. },
  501. // 各工序报工合格数量
  502. productQualificationNum: [],
  503. // 各产品合格率数据
  504. productQualificationRate: {
  505. productNames: [],
  506. rates: [] // 合格率(%)
  507. },
  508. teamList: [],
  509. };
  510. },
  511. created() {
  512. this.updateTime();
  513. this.updateTimer = setInterval(this.updateTime, 1000);
  514. },
  515. mounted() {
  516. this.queryTeamList();
  517. this.$nextTick(() => {
  518. this.isFlag = true;
  519. });
  520. },
  521. beforeDestroy() {
  522. clearInterval(this.updateTimer);
  523. clearTimeout(this.resizeTimer);
  524. },
  525. methods: {
  526. // 查询当前用户所属班组
  527. queryTeamList() {
  528. queryTeamListAll({
  529. pageNum: 1,
  530. pageSize: 1000
  531. }).then((res) => {
  532. console.log(res.list);
  533. // if (res) {
  534. if (!res || res.list.length == 0) {
  535. this.$message({
  536. message: '当前用户没有所属班组',
  537. type: 'warning'
  538. });
  539. return;
  540. }
  541. this.teamList = res.list.map(item => {
  542. return {
  543. name: item.name,
  544. value: item.id
  545. }
  546. });
  547. console.log('teamList~~~', this.teamList);
  548. this.teamId = this.teamList[0].value;
  549. console.log('teamId~~~', this.teamId);
  550. this.changeTeam();
  551. // this.getTeamProductionDayDataOneData();
  552. // this.getTeamProductionDayDataTwoData();
  553. // this.getTeamProductionDayDataThreeData();
  554. }).catch((error) => {
  555. console.error('获取班组列表失败:', error);
  556. });
  557. },
  558. // 选择班组
  559. changeTeam() {
  560. this.getTeamProductionDayDataOneData();
  561. this.getTeamProductionDayDataTwoData();
  562. this.getTeamProductionDayDataThreeData();
  563. this.pageByCurrentUserTeam()
  564. },
  565. // 班组生产日综合看板-当日生产情况、数量、重量
  566. getTeamProductionDayDataOneData() {
  567. getTeamProductionDayDataOne(this.teamId).then((res) => {
  568. console.log(res);
  569. res.transformQuantity = this.formatNumber(res.quantity);
  570. this.productionData = res;
  571. console.log('productionData~~~', this.productionData);
  572. }).catch((error) => {
  573. console.error('获取班组生产日综合看板-当日生产情况、数量、重量失败:', error);
  574. });
  575. },
  576. // 图表
  577. getTeamProductionDayDataTwoData() {
  578. getTeamProductionDayDataTwo(this.teamId).then((res) => {
  579. console.log(res);
  580. // 各工序生产数量
  581. this.eachProcessOnDutyNum = res.eachProcessOnDutyNum.map((item) => {
  582. return {
  583. name: item.name,
  584. value: item.value
  585. }
  586. });
  587. console.log('eachProcessOnDutyNum~~~', this.eachProcessOnDutyNum);
  588. // 各工序生产达成率
  589. const productionAchievementRate = {
  590. productNames: [],
  591. rates: []
  592. }
  593. res.productionAchievementRate.forEach((item) => {
  594. productionAchievementRate.productNames.push(item.name);
  595. productionAchievementRate.rates.push(item.value);
  596. });
  597. this.productionAchievementRate = productionAchievementRate;
  598. // 设备实时状态
  599. this.eachProcessEquipmentNum = res.eachProcessEquipmentNum.map(item => {
  600. return {
  601. name: item.name,
  602. value: item.value
  603. }
  604. });
  605. // 各工序报工合格数量
  606. this.productQualificationNum = res.productQualificationNum.map((item) => {
  607. return {
  608. name: item.name,
  609. value: item.value
  610. }
  611. });
  612. // 各工序报工合格率
  613. const productQualificationRate = {
  614. productNames: [],
  615. rates: []
  616. }
  617. res.productQualificationRate.forEach((item) => {
  618. productQualificationRate.productNames.push(item.name);
  619. productQualificationRate.rates.push(item.value);
  620. });
  621. this.productQualificationRate = productQualificationRate;
  622. }).catch((error) => {
  623. console.error('获取班组生产日综合看板-各产品前10名失败:', error);
  624. // 错误时重置数据
  625. this.eachProcessOnDutyNum = [];
  626. this.productionAchievementRate = { productNames: [], rates: [] };
  627. this.eachProcessEquipmentNum = [];
  628. this.productQualificationNum = [];
  629. this.productQualificationRate = { productNames: [], rates: [] };
  630. });
  631. },
  632. // 生产工单进度
  633. getTeamProductionDayDataThreeData() {
  634. getTeamProductionDayDataThree({teamId: this.teamId, pageNum: 1, size: 999}).then((data) => {
  635. console.log(data);
  636. this.tableData = data;
  637. }).catch((error) => {
  638. console.error('获取班组生产日综合看板-生产工单进度失败:', error);
  639. this.tableData = []; // 错误时重置表格数据
  640. });
  641. },
  642. //任务单
  643. pageByCurrentUserTeam() {
  644. pageByCurrentUserTeam({teamId: this.teamId, pageNum: 1, size: 999}).then((data) => {
  645. this.tableData1 = data.list;
  646. }).catch((error) => {
  647. this.tableData1 = []; // 错误时重置表格数据
  648. });
  649. },
  650. // 表格数据排序 - State为"Y"的置顶
  651. sortTableData() {
  652. this.tableData.sort((a, b) => {
  653. if (a.isDelayed == 1 && b.isDelayed !== 1) return -1;
  654. if (a.isDelayed !== 1 && b.isDelayed == 1) return 1;
  655. return 0;
  656. });
  657. },
  658. onFullscreen() {
  659. this.isFullscreen = !this.isFullscreen;
  660. },
  661. // 更新时间
  662. updateTime() {
  663. const now = new Date();
  664. const format = (num) => num.toString().padStart(2, '0');
  665. this.time = `${format(now.getHours())}:${format(now.getMinutes())}:${format(now.getSeconds())}`;
  666. this.date = `${now.getFullYear()}年${now.getMonth() + 1}月${now.getDate()}日`;
  667. const weekMap = { 0: '日', 1: '一', 2: '二', 3: '三', 4: '四', 5: '五', 6: '六' };
  668. this.week = `星期${weekMap[now.getDay()]}`;
  669. },
  670. // 格式化数字为6位数组(补零)
  671. formatNumber(num) {
  672. const paddedStr = num.toString().padStart(6, '0');
  673. const digits = paddedStr.split('').map(Number);
  674. return digits;
  675. }
  676. }
  677. };
  678. </script>
  679. <style lang="scss" scoped>
  680. [v-cloak] {
  681. display: none;
  682. }
  683. .card-container{
  684. height: 26vh;
  685. }
  686. .box-container {
  687. font-size: 16px;
  688. font-family: 'AlibabaPuHuiTi';
  689. background-image: url('@/assets/png/bj.png');
  690. background-repeat: no-repeat;
  691. background-size: 100% 100%;
  692. background-color: rgb(8, 29, 65);
  693. display: flex;
  694. flex-direction: column;
  695. overflow: hidden;
  696. height: 100%;
  697. .box-header {
  698. background-image: url('@/assets/border2.png');
  699. background-repeat: no-repeat;
  700. background-size: 100% 100%;
  701. display: flex;
  702. width: 100% !important;
  703. height: 10%;
  704. justify-content: space-between;
  705. align-items: center;
  706. .logo {
  707. width: 15%;
  708. height: 100%;
  709. display: flex;
  710. align-items: center;
  711. justify-content: center;
  712. padding-left: 1rem;
  713. }
  714. .title {
  715. font-family: '优设标题黑';
  716. font-size: 2.85rem;
  717. flex: 1;
  718. display: flex;
  719. justify-content: center;
  720. align-items: center;
  721. color: #fff;
  722. transform: translate(2%, -10%);
  723. letter-spacing: 0.4rem;
  724. }
  725. .time {
  726. width: 15%;
  727. height: 100%;
  728. display: flex;
  729. flex-direction: row;
  730. align-items: center;
  731. justify-content: flex-end;
  732. font-size: 0.8rem;
  733. color: #7fa7ce;
  734. }
  735. .time-display {
  736. margin: 0 15px 0 0;
  737. color: rgb(210 215 221);
  738. font-size: 0.8rem;
  739. font-weight: 600;
  740. }
  741. .time-text {
  742. padding: 0 5px;
  743. }
  744. .fullscreen-toggle {
  745. margin: 0 15px 0 0;
  746. cursor: pointer;
  747. }
  748. }
  749. .box-middle {
  750. width: 100% !important;
  751. flex: 1;
  752. display: flex;
  753. gap: 0.5rem;
  754. padding: 0.5rem 1rem;
  755. box-sizing: border-box;
  756. .box-middle-sidebar {
  757. flex-basis: 28%;
  758. max-width: 600px;
  759. min-width: 280px;
  760. flex-shrink: 1;
  761. flex-grow: 0;
  762. display: flex;
  763. flex-direction: column;
  764. gap: 1rem;
  765. // .sidebar-card {
  766. // background-color: rgba(8, 29, 65, 0.8);
  767. // background-size: 100% 100%;
  768. // background-repeat: no-repeat;
  769. // flex: 1;
  770. // display: flex;
  771. // flex-direction: column;
  772. // color: #fff;
  773. // font-size: 1rem;
  774. // border: 1px solid #124c77;
  775. // overflow: hidden;
  776. // &.chart-card-small {
  777. // flex: 0.8 !important;
  778. // }
  779. // &.chart-card-large {
  780. // flex: 1.2 !important;
  781. // }
  782. // .card-header {
  783. // display: flex;
  784. // align-items: center;
  785. // padding: 0.2rem 0.5rem;
  786. // gap: 0.3rem;
  787. // background-color: rgb(0, 64, 133);
  788. // border-bottom: 1px solid #124c77;
  789. // font-family: '优设标题黑';
  790. // font-size: 1.2rem;
  791. // color: #fff;
  792. // .card-logo {
  793. // width: 1.3rem;
  794. // height: 1.3rem;
  795. // display: flex;
  796. // align-items: center;
  797. // justify-content: center;
  798. // img {
  799. // width: 100%;
  800. // height: 100%;
  801. // object-fit: contain;
  802. // }
  803. // }
  804. // .card-title {
  805. // font-size: clamp(1rem, 1.8vw,1.4rem);
  806. // letter-spacing: 0.05rem;
  807. // }
  808. // }
  809. .number-display-container {
  810. display: flex;
  811. flex-direction: column;
  812. height: 100%;
  813. padding: 0 1rem 0.5rem 1rem;
  814. }
  815. .number-display {
  816. flex: 3;
  817. display: flex;
  818. align-items: center;
  819. justify-content: center;
  820. gap: 0.5rem;
  821. box-sizing: border-box;
  822. overflow: hidden;
  823. // 关键新增:增加顶部外边距,与顶部拉开距离
  824. // margin-top: 0.8rem;
  825. }
  826. .card-stats {
  827. display: flex;
  828. justify-content: center;
  829. gap: 0.8rem;
  830. padding: 0.3rem 0;
  831. flex-wrap: wrap;
  832. flex-shrink: 0;
  833. width: 100%;
  834. box-sizing: border-box;
  835. .stat-item-container {
  836. background-color: rgba(0, 123, 255, 0.1);
  837. border: 1px solid rgba(88, 137, 196);
  838. border-radius: 4px;
  839. display: flex;
  840. align-items: flex-start;
  841. gap: 0.4rem;
  842. flex: 1 0 calc(50% - 1rem);
  843. max-width: calc(50% - 1rem);
  844. box-sizing: border-box;
  845. padding: 0.3rem;
  846. .stat-icon {
  847. width: 1.6rem;
  848. height: 1.6rem;
  849. padding: 0.4rem;
  850. background-color: rgba(0, 64, 133, 0.3);
  851. display: flex;
  852. align-items: center;
  853. justify-content: center;
  854. flex-shrink: 0;
  855. img {
  856. width: 100%;
  857. height: 100%;
  858. object-fit: contain;
  859. }
  860. }
  861. .stat-info {
  862. display: flex;
  863. flex-direction: column;
  864. justify-content: center;
  865. align-items: center;
  866. height: 100%;
  867. .stat-label {
  868. color: #fff;
  869. font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  870. white-space: nowrap;
  871. line-height: 1.1;
  872. letter-spacing: 1px;
  873. }
  874. .stat-value {
  875. font-weight: bold;
  876. white-space: nowrap;
  877. color: #3bfff2;
  878. font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  879. line-height: 1.1;
  880. }
  881. .stat-dw {
  882. font-weight: bold;
  883. white-space: nowrap;
  884. color: #fff;
  885. font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  886. line-height: 1.1;
  887. }
  888. }
  889. }
  890. }
  891. // }
  892. }
  893. .box-middle-content {
  894. flex: 1;
  895. padding: 0 0.5rem;
  896. display: flex;
  897. flex-direction: column;
  898. gap: 1rem;
  899. .content-card-container {
  900. // flex: 1;
  901. display: flex;
  902. flex-direction: column;
  903. // height: 28%;
  904. .sidebar-card {
  905. flex: 1;
  906. background-size: 100% 100%;
  907. background-repeat: no-repeat;
  908. display: flex;
  909. flex-direction: column;
  910. color: #fff;
  911. font-size: 1rem;
  912. overflow: hidden;
  913. .card-header {
  914. display: flex;
  915. align-items: center;
  916. padding: 0.2rem 0.5rem;
  917. gap: 0.3rem;
  918. font-family: '优设标题黑';
  919. font-size: 1.2rem;
  920. color: #fff;
  921. .card-logo {
  922. width: 1.3rem;
  923. height: 1.3rem;
  924. display: flex;
  925. align-items: center;
  926. justify-content: center;
  927. img {
  928. width: 100%;
  929. height: 100%;
  930. object-fit: contain;
  931. }
  932. }
  933. .card-title {
  934. font-size: clamp(1rem, 1.8vw, 1.4rem);
  935. letter-spacing: 0.05rem;
  936. }
  937. }
  938. .content-empty {
  939. flex: 1;
  940. color: #7fa7ce;
  941. display: flex;
  942. flex-direction: column;
  943. .Remark {
  944. font-size: 0.7rem;
  945. letter-spacing: 0.1rem;
  946. color: #fff;
  947. text-align: right;
  948. }
  949. .content-box {
  950. display: flex;
  951. flex: 1;
  952. gap: 2vw;
  953. padding: 0.5rem;
  954. height: 100%;
  955. .box-item {
  956. // flex: 1;
  957. display: flex;
  958. align-items: center;
  959. justify-content: center;
  960. flex-direction: column;
  961. gap: 0.5vw;
  962. width: 33.3%;
  963. .item-img {
  964. font-family: 'LCD2B';
  965. aspect-ratio: 100 / 64;
  966. width: 80%;
  967. background-image: url('@/assets/png/item_img.png');
  968. background-repeat: no-repeat;
  969. background-size: 100% 100%;
  970. color: #fff;
  971. font-size: clamp(1.5rem, 4vw, 3rem);
  972. font-weight: 600;
  973. display: flex;
  974. align-items: center;
  975. justify-content: center;
  976. }
  977. .item-text {
  978. font-size: clamp(0.8rem, 1.5vw, 1rem);
  979. font-weight: 600;
  980. color: #fff;
  981. text-align: center;
  982. padding: 0 0.2rem;
  983. }
  984. }
  985. }
  986. }
  987. }
  988. }
  989. }
  990. .content-top-container {
  991. // flex: 2;
  992. // display: flex;
  993. // flex-direction: column;
  994. // height: 78%;
  995. /* 表格容器:移除滚动相关样式 */
  996. .content-table {
  997. // flex: 1;
  998. padding: 8px;
  999. box-sizing: border-box;
  1000. height: 90%;
  1001. /* 主表格样式 */
  1002. .main-table {
  1003. width: 100%;
  1004. border-collapse: collapse;
  1005. table-layout: fixed;
  1006. overflow: hidden;
  1007. }
  1008. /* 表头样式(保留固定定位但移除滚动关联) */
  1009. .main-table thead th {
  1010. background-color: rgba(3, 29, 66, 0.95);
  1011. padding: 0.5rem 0.2rem;
  1012. text-align: center;
  1013. font-weight: bold;
  1014. color: #0b6fd5;
  1015. border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  1016. font-size: 0.8rem;
  1017. white-space: nowrap;
  1018. overflow: hidden;
  1019. text-overflow: ellipsis;
  1020. }
  1021. /* 表格行样式 */
  1022. .table-row {
  1023. width: 100%;
  1024. }
  1025. /* 表格单元格样式 */
  1026. .table-cell {
  1027. padding: 0.2rem;
  1028. text-align: center;
  1029. color: #e9ecef;
  1030. font-size: 0.8rem;
  1031. border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  1032. white-space: nowrap;
  1033. overflow: hidden;
  1034. text-overflow: ellipsis;
  1035. }
  1036. /* 红色行样式(State=Y) */
  1037. .state-red {
  1038. .table-cell {
  1039. background-color: #ff1514 !important;
  1040. color: #fff !important;
  1041. }
  1042. }
  1043. /* 行hover效果 */
  1044. .table-row:hover .table-cell {
  1045. background-color: rgba(3, 29, 66, 0.8) !important;
  1046. }
  1047. /* 无数据占位样式 */
  1048. .empty-cell {
  1049. text-align: center;
  1050. padding: 1rem;
  1051. color: #7fa7ce;
  1052. border: none !important;
  1053. height: 100%;
  1054. display: flex;
  1055. align-items: center;
  1056. justify-content: center;
  1057. }
  1058. }
  1059. }
  1060. }
  1061. }
  1062. .scroll-container {
  1063. overflow: hidden;
  1064. height: 90%;
  1065. }
  1066. /* 数字显示样式 */
  1067. .unit-box {
  1068. display: flex;
  1069. flex-direction: column;
  1070. align-items: center;
  1071. width: 3rem;
  1072. height: 5rem;
  1073. position: relative;
  1074. }
  1075. .unit {
  1076. font-size: 14px;
  1077. color: #a4b9d7;
  1078. text-align: center;
  1079. position: absolute;
  1080. top: -22px;
  1081. left: 50%;
  1082. transform: translateX(-50%);
  1083. margin-bottom: 0;
  1084. width: 35px;
  1085. white-space: nowrap;
  1086. }
  1087. .digit-box {
  1088. background-image: url('@/assets/png/num_bj.png');
  1089. background-repeat: no-repeat;
  1090. background-size: 100% 100%;
  1091. color: #fff;
  1092. padding: 0 15px;
  1093. height: 5rem;
  1094. font-size: clamp(1.5rem, 4vw, 2.2rem);
  1095. display: flex;
  1096. align-items: center;
  1097. justify-content: center;
  1098. font-weight: bold;
  1099. border-radius: 2px;
  1100. }
  1101. .separator {
  1102. color: #fff;
  1103. font-size: 2.5rem;
  1104. font-weight: 700;
  1105. margin: 0 5px;
  1106. display: flex;
  1107. align-items: center;
  1108. justify-content: center;
  1109. line-height: 1;
  1110. }
  1111. /* 图表容器样式 */
  1112. .process-chart-container {
  1113. width: 100%;
  1114. height: 100%;
  1115. min-height: 160px;
  1116. }
  1117. .product-top10-chart-container {
  1118. width: 100%;
  1119. height: 100%;
  1120. min-height: 160px;
  1121. }
  1122. .qualification-rate-chart-container {
  1123. width: 100%;
  1124. height: 100%;
  1125. min-height: 160px;
  1126. }
  1127. /* 响应式适配 */
  1128. @media (max-width: 1200px) {
  1129. .box-container {
  1130. .box-header {
  1131. .time {
  1132. width: 40%;
  1133. font-size: 0.75rem;
  1134. }
  1135. }
  1136. }
  1137. }
  1138. @media (max-width: 768px) {
  1139. .box-container {
  1140. .box-header {
  1141. .title {
  1142. font-size: 2rem;
  1143. }
  1144. .time {
  1145. width: 45%;
  1146. font-size: 0.7rem;
  1147. }
  1148. }
  1149. .box-middle .box-middle-sidebar {
  1150. flex-basis: 25%;
  1151. min-width: 220px;
  1152. .sidebar-card .card-header .card-title {
  1153. font-size: 0.85rem;
  1154. }
  1155. }
  1156. .box-middle .box-middle-content .content-top-container .sidebar-card {
  1157. .card-header .card-title {
  1158. font-size: 0.85rem;
  1159. }
  1160. .content-table .main-table thead th {
  1161. font-size: 0.7rem;
  1162. padding: 0.3rem 0.1rem;
  1163. }
  1164. .content-table .table-cell {
  1165. font-size: 0.7rem;
  1166. padding: 0.3rem 0.1rem;
  1167. }
  1168. }
  1169. }
  1170. }
  1171. </style>
  1172. <style>
  1173. /* 全屏图标样式 */
  1174. .el-icon-_screen-full,
  1175. .el-icon-_screen-restore {
  1176. font-size: 1.2rem;
  1177. cursor: pointer;
  1178. transition: all 0.3s;
  1179. color: #7fa7ce;
  1180. }
  1181. .el-icon-_screen-full:hover,
  1182. .el-icon-_screen-restore:hover {
  1183. color: #fff;
  1184. transform: scale(1.1);
  1185. }
  1186. .head-table,
  1187. .body-table {
  1188. width: 100%;
  1189. table-layout: fixed;
  1190. }
  1191. </style>