index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. <template>
  2. <div class="app-container ">
  3. <div class="stat-warp">
  4. <div style="margin-bottom:15px">
  5. <TitleInfo :content="'工作事项'"></TitleInfo>
  6. </div>
  7. <ul>
  8. <li class="theme1" @click="toUrl(1)">
  9. <div class="num">{{ toBeProcessedData.total }}</div>
  10. <div class="label">待审批</div>
  11. <div class="icon-box">
  12. <i class="icon iconfont icon-iconm_waixht"></i>
  13. </div>
  14. </li>
  15. <li class="theme2" @click="toUrl(2)">
  16. <div class="num">{{ allData[0].total }}</div>
  17. <div class="label">待报价</div>
  18. <div class="icon-box">
  19. <svg-icon :icon-class="'baojia'" className="svg-class1" />
  20. </div>
  21. </li>
  22. <li class="theme3" @click="toUrl(3)">
  23. <div class="num">{{ allData[1].total }}</div>
  24. <div class="label">待投产</div>
  25. <div class="icon-box">
  26. <svg-icon :icon-class="'touchang'" className="svg-class" />
  27. </div>
  28. </li>
  29. <li class="theme4" @click="toUrl(4)">
  30. <div class="num">{{ allData[2].total }}</div>
  31. <div class="label">待入库</div>
  32. <div class="icon-box">
  33. <svg-icon :icon-class="'ruku'" className="svg-class1" />
  34. </div>
  35. </li>
  36. <li class="theme5" @click="toUrl(5)">
  37. <div class="num">{{ allData[3].total }}</div>
  38. <div class="label">待出库</div>
  39. <div class="icon-box">
  40. <svg-icon :icon-class="'chuku'" className="svg-class1" />
  41. </div>
  42. </li>
  43. <li class="theme6" @click="toUrl(6)" v-if="useUserStore().user.companyId =='100'">
  44. <div class="num">{{ allData[4].total }}</div>
  45. <div class="label">待认领</div>
  46. <div class="icon-box">
  47. <svg-icon :icon-class="'renling'" className="svg-class1" />
  48. </div>
  49. </li>
  50. <li class="theme6" @click="toUrl(6)" v-else>
  51. <div class="num">{{ allData[5].total }}</div>
  52. <div class="label">库存预警</div>
  53. <div class="icon-box">
  54. <svg-icon :icon-class="'kucun'" className="svg-class1" />
  55. </div>
  56. </li>
  57. </ul>
  58. <div class="table-card">
  59. <el-card style="width:32%">
  60. <TitleInfo :content="'待审批'"></TitleInfo>
  61. <el-table :data="toBeProcessedData.rows" style="width: 100%" :height="tableHeight">
  62. <el-table-column prop="title" label="流程标题" />
  63. </el-table>
  64. </el-card>
  65. <el-card style="width:32%">
  66. <TitleInfo :content="'待报价'"></TitleInfo>
  67. <el-table :data="allData[0].rows" style="width: 100%" :height="tableHeight">
  68. <el-table-column prop="code" label="报价单号" />
  69. <el-table-column prop="amount" label="报价金额" width="110" />
  70. </el-table>
  71. </el-card>
  72. <el-card style="width:32%">
  73. <TitleInfo :content="'待投产'"></TitleInfo>
  74. <el-table :data="allData[1].rows" style="width: 100%" :height="tableHeight">
  75. <el-table-column prop="code" label="订单号" />
  76. <el-table-column prop="deliveryPeriod" label="交期" width="150" />
  77. </el-table>
  78. </el-card>
  79. </div>
  80. <div class="table-card ">
  81. <el-card style="width:32%">
  82. <TitleInfo :content="'待入库'"></TitleInfo>
  83. <el-table :data="allData[2].rows" style="width: 100%" :height="tableHeight">
  84. <el-table-column prop="productName" label="产品名称" />
  85. <el-table-column prop="quantity" label="数量" width="100" />
  86. </el-table>
  87. </el-card>
  88. <el-card style="width:32%">
  89. <TitleInfo :content="'待出库'"></TitleInfo>
  90. <el-table :data="allData[3].rows" style="width: 100%" :height="tableHeight">
  91. <el-table-column prop="productName" label="产品名称" />
  92. <el-table-column prop="quantity" label="数量" width="100" />
  93. </el-table>
  94. </el-card>
  95. <el-card style="width:32%" v-if="useUserStore().user.companyId =='100'">
  96. <TitleInfo :content="'待认领'"></TitleInfo>
  97. <el-table :data="allData[4].rows" style="width: 100%" :height="tableHeight">
  98. <el-table-column prop="accountManagementName" label="账户名称" />
  99. <el-table-column prop="amount" label="到账金额" width="100" />
  100. <el-table-column prop="transactionTime" label="到账时间" width="150" />
  101. </el-table>
  102. </el-card>
  103. <el-card style="width:32%" v-else>
  104. <TitleInfo :content="'库存预警'"></TitleInfo>
  105. <el-table :data="allData[5].rows" style="width: 100%" :height="tableHeight">
  106. <el-table-column prop="productCode" label="产品编码" />
  107. <el-table-column prop="productName" label="产品名称" />
  108. <el-table-column prop="stockThreshold" label="安全库存" width="100" />
  109. </el-table>
  110. </el-card>
  111. </div>
  112. </div>
  113. <div class="table-warp">
  114. <div style="margin-bottom:15px">
  115. <TitleInfo :content="'监控告警'"></TitleInfo>
  116. </div>
  117. <el-card style="margin-bottom:20px">
  118. <TitleInfo :content="'逾期生产订单'+` (${allData[6].total})`"></TitleInfo>
  119. <el-table :data="allData[6].rows" style="width: 100%" :height="tableHeightOne">
  120. <el-table-column prop="code" label="订单号" />
  121. <el-table-column prop="deliveryPeriod" label="交期" width="150" />
  122. </el-table>
  123. </el-card>
  124. <el-card style="margin-bottom:20px">
  125. <TitleInfo :content="'报损情况(近30天)'"></TitleInfo>
  126. <div class="baosun">
  127. <div class="theme2 q" @click="toUrl(7)">
  128. <span class="label">补单</span>
  129. <span class="num">{{ reportLossesData.replenishSumQuantity }}</span>
  130. </div>
  131. <div class="theme3 q" @click="toUrl(7)">
  132. <span class="label">丢失</span>
  133. <span class="num">{{ reportLossesData.lossSumQuantity }}</span>
  134. </div>
  135. </div>
  136. </el-card>
  137. <el-card>
  138. <TitleInfo :content="'设备运行情况'"></TitleInfo>
  139. <div style="display:flex;align-items:center">
  140. <div style="width:100px;font-size:12px">
  141. 设备名称:设备1 <br><br> 当天标刻数量:10<br><br>在线工作时长(分钟):1000
  142. </div>
  143. <div style="height:190px;width:calc(100% - 100px)" ref="pie_1"></div>
  144. </div>
  145. </el-card>
  146. </div>
  147. </div>
  148. </template>
  149. <script setup name="Index">
  150. import { createApp, onMounted, ref } from "vue";
  151. import byTableDemo from "../components/byTable/demo";
  152. import html2canvas from "html2canvas";
  153. import JsPDF from "jspdf";
  154. import * as echarts from "echarts";
  155. const { proxy } = getCurrentInstance();
  156. const tableHeight = ref(0);
  157. const tableHeightOne = ref(0);
  158. const getTableHeight = () => {
  159. tableHeight.value = (window.innerHeight - 390) / 2;
  160. tableHeightOne.value = window.innerHeight - 610;
  161. };
  162. getTableHeight();
  163. window.addEventListener("resize", () => {
  164. getTableHeight();
  165. });
  166. function goTarget(url) {
  167. window.open(url, "__blank");
  168. }
  169. const toBeProcessedData = ref({
  170. total: 0,
  171. rows: [],
  172. });
  173. const allData = ref({
  174. 0: {
  175. total: 0,
  176. rows: [],
  177. },
  178. 1: { total: 0, rows: [] },
  179. 2: { total: 0, rows: [] },
  180. 3: { total: 0, rows: [] },
  181. 4: { total: 0, rows: [] },
  182. 5: { total: 0, rows: [] },
  183. 6: { total: 0, rows: [] },
  184. });
  185. const reportLossesData = ref({});
  186. const pushProcessApproval = (row) => {
  187. if (row.status != 1 && row.status != 0) {
  188. proxy.$router.push({
  189. path: "/platform_manage/process/processApproval",
  190. query: {
  191. flowKey: row.flowKey,
  192. id: row.id,
  193. processType: 20,
  194. version: row.version,
  195. businessId: row.businessId,
  196. submitType: "10",
  197. },
  198. });
  199. return;
  200. }
  201. proxy.post("flowExample/getApprovalRecord", { id: row.id }).then((res) => {
  202. if (res.recordList.length > 0) {
  203. let data = res.recordList.filter((item) => item.status === 2);
  204. let nodeType = 0;
  205. if (data && data.length > 0) {
  206. nodeType = data[0].nodeType;
  207. }
  208. proxy.$router.push({
  209. path: "/platform_manage/process/processApproval",
  210. query: {
  211. flowKey: row.flowKey,
  212. id: row.id,
  213. processType: nodeType == 1 ? 30 : 10,
  214. version: row.version,
  215. businessId: row.businessId,
  216. submitType: "10",
  217. },
  218. });
  219. }
  220. });
  221. };
  222. const pushProcessApprovalOne = (row) => {
  223. proxy.$router.push({
  224. path: "/platform_manage/process/processApproval",
  225. query: {
  226. flowKey: row.flowKey,
  227. id: row.id,
  228. processType: 20,
  229. version: row.version,
  230. businessId: row.businessId,
  231. submitType: "10",
  232. },
  233. });
  234. return;
  235. };
  236. const getData = () => {
  237. proxy
  238. .post("/flowExample/getToBeProcessedPage", {
  239. pageNum: 1,
  240. pageSize: 5,
  241. })
  242. .then((res) => {
  243. toBeProcessedData.value = res;
  244. });
  245. // 待报价
  246. proxy
  247. .post("/saleQuotation/page", {
  248. pageNum: 1,
  249. pageSize: 5,
  250. isEstimate: proxy.useUserStore().user.companyId == "100" ? "" : "1",
  251. })
  252. .then((res) => {
  253. allData.value[0] = res;
  254. });
  255. // 待投产
  256. proxy
  257. .post("/produceOrder/page", {
  258. pageNum: 1,
  259. pageSize: 5,
  260. isProduce: "0",
  261. })
  262. .then((res) => {
  263. allData.value[1] = res;
  264. });
  265. // 待入库
  266. proxy
  267. .post("/stockWaitDetails/page", {
  268. pageNum: 1,
  269. pageSize: 5,
  270. type: 1,
  271. })
  272. .then((res) => {
  273. allData.value[2] = res;
  274. });
  275. // 待出库
  276. proxy
  277. .post("/stockWaitDetails/page", {
  278. pageNum: 1,
  279. pageSize: 5,
  280. type: 2,
  281. })
  282. .then((res) => {
  283. allData.value[3] = res;
  284. });
  285. // 待认领
  286. proxy
  287. .post("/sale/accountRunningWater/page", {
  288. pageNum: 1,
  289. pageSize: 5,
  290. isClaim: "0",
  291. dataType: "1",
  292. })
  293. .then((res) => {
  294. allData.value[4] = res;
  295. });
  296. // 库存预警
  297. proxy
  298. .post("/stock/stockWarningPage", {
  299. pageNum: 1,
  300. pageSize: 5,
  301. })
  302. .then((res) => {
  303. allData.value[5] = res;
  304. });
  305. // 逾期生产订单
  306. proxy
  307. .post("/produceOrder/page", {
  308. pageNum: 1,
  309. pageSize: 10,
  310. isOverdue: "1",
  311. })
  312. .then((res) => {
  313. allData.value[6] = res;
  314. });
  315. // 报损统计
  316. proxy.post("/reportLossesDetails/lossesStatistics").then((res) => {
  317. reportLossesData.value = res;
  318. });
  319. };
  320. const toUrl = (att) => {
  321. //获取name为name的路由的基础信息
  322. // const route = proxy.$router.resolve({ name: name, params: {} });
  323. let pageObj = {
  324. 1: "Backlog",
  325. 2:
  326. proxy.useUserStore().user.companyId == "100"
  327. ? "PriceSheetEHSD"
  328. : "PriceSheetEstimate",
  329. 3: "ProductionOrder",
  330. 4: "WaitingForStorage",
  331. 5: "WaitingForDelivery",
  332. 6: "Claim",
  333. 7: "SupplementaryOrder",
  334. };
  335. proxy.$router.push({
  336. name: pageObj[att],
  337. });
  338. };
  339. getData();
  340. // ​
  341. const getOption = () => {
  342. return {
  343. title: {
  344. show: true,
  345. text: "",
  346. bottom: "0%",
  347. left: "center",
  348. textStyle: {
  349. color: "#fff",
  350. fontSize: 12,
  351. fontWeight: 400,
  352. },
  353. },
  354. tooltip: {
  355. trigger: "item",
  356. },
  357. grid: {
  358. show: false,
  359. bottom: 0,
  360. },
  361. // legend: {
  362. // top: "0%",
  363. // left: "center",
  364. // },
  365. series: [
  366. {
  367. name: "设备1",
  368. type: "pie",
  369. // center: ["50%", "50%"],
  370. radius: ["45%", "75%"],
  371. top: "0%",
  372. bottom: "0%",
  373. avoidLabelOverlap: false,
  374. label: {
  375. show: false,
  376. position: "center",
  377. },
  378. emphasis: {
  379. label: {
  380. show: true,
  381. fontSize: 14,
  382. fontWeight: "bold",
  383. color: "#fff",
  384. },
  385. },
  386. labelLine: {
  387. show: false,
  388. },
  389. data: [
  390. {
  391. value: 1000,
  392. name: "工作时长",
  393. itemStyle: {
  394. color: "#F9CB19",
  395. },
  396. },
  397. {
  398. value: 440,
  399. name: "",
  400. itemStyle: {
  401. color: "#268EFF",
  402. },
  403. },
  404. ],
  405. },
  406. ],
  407. };
  408. };
  409. const pie_1 = ref(null);
  410. let pie_1Chart = null;
  411. let option1 = {};
  412. onMounted(() => {
  413. option1 = getOption();
  414. pie_1Chart = echarts.init(pie_1.value);
  415. window.addEventListener("resize", () => {
  416. pie_1Chart.resize();
  417. });
  418. pie_1Chart.setOption(option1);
  419. pie_1Chart.resize();
  420. });
  421. </script>
  422. <style scoped lang="scss">
  423. .app-container {
  424. display: flex;
  425. width: 100vw;
  426. padding: 10px;
  427. font-size: 14px !important;
  428. // height: 100%;
  429. .announcement {
  430. padding: 0;
  431. margin: 0;
  432. li {
  433. list-style: none;
  434. border-radius: 2px;
  435. padding: 14px 20px;
  436. background: #eeeeee;
  437. margin-bottom: 10px;
  438. font-size: 14px;
  439. cursor: pointer;
  440. .time {
  441. color: #999;
  442. }
  443. .content {
  444. margin-top: 10px;
  445. color: #333;
  446. }
  447. }
  448. li:hover {
  449. background: #eff6ff;
  450. }
  451. }
  452. .table-warp {
  453. width: 400px;
  454. //页面全屏,占据剩下的位置
  455. height: calc(100vh - 120px);
  456. background: #fff;
  457. padding: 10px;
  458. // border-radius: 5px;
  459. .baosun {
  460. display: flex;
  461. justify-content: space-between;
  462. margin-top: 15px;
  463. .q {
  464. padding: 10px;
  465. min-width: 150px;
  466. display: flex;
  467. cursor: pointer;
  468. justify-content: space-between;
  469. border-radius: 10px;
  470. .num {
  471. font-size: 20px;
  472. font-weight: 700;
  473. }
  474. }
  475. .theme2 {
  476. background: linear-gradient(180deg, #eae8fb 0%, #ded9ff 100%);
  477. }
  478. //#FFF1E1 #FF9315
  479. .theme3 {
  480. background: #fff1e1;
  481. }
  482. }
  483. .card {
  484. height: calc(50% - 10px);
  485. background: #fff;
  486. float: left;
  487. border-radius: 5px;
  488. padding: 20px;
  489. overflow-y: auto;
  490. }
  491. .odd {
  492. width: calc(66.5% - 10px);
  493. }
  494. .even {
  495. margin-left: 10px;
  496. width: 33.5%;
  497. }
  498. // .card:nth-child(2n + 1) {
  499. // margin-right: 20px;
  500. // }
  501. .card:nth-child(1) {
  502. margin-bottom: 10px;
  503. }
  504. .card:nth-child(2) {
  505. margin-bottom: 10px;
  506. }
  507. }
  508. .stat-warp {
  509. width: calc(100% - 400px - 10px);
  510. height: calc(100vh - 120px);
  511. margin-right: 10px;
  512. // margin-bottom: 10px;
  513. background: #fff;
  514. padding: 10px;
  515. // padding: 20px;
  516. // overflow: hidden;
  517. // position: relative;
  518. // border-radius: 5px;
  519. .title {
  520. height: 60px;
  521. select {
  522. height: 60px;
  523. border: none;
  524. outline: none;
  525. -webkit-appearance: none;
  526. appearance: none;
  527. font-size: 14px;
  528. font-weight: bold;
  529. background: url("@/assets/images/sanjiao.png") no-repeat right center;
  530. padding-right: 20px;
  531. }
  532. div {
  533. height: 60px;
  534. font-size: 14px;
  535. font-weight: bold;
  536. line-height: 60px;
  537. }
  538. }
  539. ul {
  540. padding: 0;
  541. // overflow: hidden;
  542. margin: 0;
  543. display: flex;
  544. width: 100%;
  545. flex-wrap: nowrap;
  546. overflow: hidden;
  547. justify-content: space-between;
  548. li {
  549. flex: 1;
  550. list-style: none;
  551. min-width: 150px;
  552. box-sizing: border-box;
  553. margin-right: 20px;
  554. background: linear-gradient(360deg, #c7e3fe 0%, #dfecff 100%);
  555. // float: left;
  556. // overflow: hidden;
  557. padding: 10px;
  558. color: #333333;
  559. position: relative;
  560. border-radius: 10px;
  561. cursor: pointer;
  562. .label {
  563. font-size: 14px;
  564. margin-top: 10px;
  565. }
  566. .label::before {
  567. // width: 10px;
  568. // height: 10px;
  569. // content: '';
  570. // border-radius: 50%;
  571. // background: #0084ff;
  572. // display: inline-block;
  573. // margin-right: 10px;
  574. }
  575. .num {
  576. font-size: 24px;
  577. font-weight: bold;
  578. }
  579. .icon-box {
  580. position: absolute;
  581. height: 40px;
  582. width: 40px;
  583. right: 20px;
  584. top: 20px;
  585. background: #fff;
  586. border-radius: 10px;
  587. text-align: center;
  588. line-height: 40px;
  589. i {
  590. font-size: 20px;
  591. color: #0084ff;
  592. }
  593. }
  594. }
  595. //#F5F3FF #9E64ED
  596. .theme2 {
  597. background: linear-gradient(180deg, #eae8fb 0%, #ded9ff 100%);
  598. .label::before {
  599. background: #7566f0;
  600. }
  601. .icon-box i {
  602. color: #7566f0;
  603. }
  604. }
  605. //#FFF1E1 #FF9315
  606. .theme3 {
  607. background: #fff1e1;
  608. .label::before {
  609. background: #ff9315;
  610. }
  611. .icon-box i {
  612. color: #ff9315;
  613. }
  614. }
  615. //#E2FBE8 #39C55A
  616. .theme4 {
  617. background: #e2fbe8;
  618. .label::before {
  619. background: #39c55a;
  620. }
  621. }
  622. .theme5 {
  623. background: #ffebe9;
  624. .label::before {
  625. background: #f94539;
  626. }
  627. }
  628. .theme6 {
  629. background: #e4f9f9;
  630. .label::before {
  631. background: #53cbcb;
  632. }
  633. }
  634. .multi-data {
  635. .label::before {
  636. display: none;
  637. }
  638. .label {
  639. font-size: 14px;
  640. font-weight: bold;
  641. color: #333;
  642. margin-bottom: 8px;
  643. }
  644. .num-warp {
  645. overflow: hidden;
  646. .num-box {
  647. float: left;
  648. min-width: 80px;
  649. margin-right: 20px;
  650. .num-small {
  651. font-size: 16px;
  652. font-weight: bold;
  653. margin-bottom: 8px;
  654. }
  655. .label-small {
  656. color: #666;
  657. font-size: 14px;
  658. }
  659. }
  660. }
  661. }
  662. }
  663. }
  664. .table-card {
  665. display: flex;
  666. justify-content: space-between;
  667. margin-top: 20px;
  668. }
  669. }
  670. :deep(
  671. .el-table .el-table__header-wrapper th,
  672. .el-table .el-table__fixed-header-wrapper th
  673. ) {
  674. height: auto !important;
  675. }
  676. .svg-class {
  677. font-size: 16px;
  678. }
  679. .svg-class1 {
  680. font-size: 19px;
  681. margin-top: 10px;
  682. }
  683. :deep(.el-table .cell) {
  684. font-size: 12px !important;
  685. line-height: 24px !important;
  686. }
  687. </style>