index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <div class="box-card">
  3. <el-card>
  4. <el-form :model="timeList" :inline="true" @submit.native.prevent>
  5. <el-form-item label="日期:">
  6. <el-date-picker
  7. v-model="timeList"
  8. type="daterange"
  9. range-separator="To"
  10. start-placeholder="Start date"
  11. end-placeholder="End date"
  12. value-format="YYYY-MM-DD"
  13. @change="changeTime" />
  14. </el-form-item>
  15. </el-form>
  16. </el-card>
  17. <el-row :gutter="10" style="padding-top: 10px">
  18. <el-col :span="6">
  19. <el-card v-loading="topLeft">
  20. <div class="cardTitle">MES今日生产出库数据</div>
  21. <div class="firstRowBoard">
  22. <span style="font-size: 16px !important">BOM出库总数(个)</span>
  23. <span style="font-weight: 700; font-size: 20px !important">{{ TLData.count || 0 }}</span>
  24. </div>
  25. <el-table
  26. :data="TLData.list"
  27. :cell-style="{ padding: '0' }"
  28. :row-style="{ height: '50px' }"
  29. header-row-class-name="tableHeader"
  30. height="30vh"
  31. style="margin-top: 20px">
  32. <el-table-column label="序号" align="center" type="index" width="60" />
  33. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  34. <el-table-column label="数量" align="center" width="80">
  35. <template #default="{ row }">
  36. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  37. <span v-else>0</span>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </el-card>
  42. </el-col>
  43. <el-col :span="9">
  44. <el-card v-loading="topCenter">
  45. <div class="cardTitle">MES&万里牛今日订单和BOM差异(不含自建订单)</div>
  46. <div class="firstRowBoard">
  47. <span style="font-size: 16px !important">差异订单总数(单)</span>
  48. <span style="font-weight: 700; font-size: 20px !important">{{ TCData.count || 0 }}</span>
  49. </div>
  50. <el-table
  51. :data="TCData.list"
  52. :cell-style="{ padding: '0' }"
  53. :row-style="{ height: '50px' }"
  54. header-row-class-name="tableHeader"
  55. height="30vh"
  56. style="margin-top: 20px">
  57. <el-table-column label="BOM编号" prop="bomSpecCode" width="120" />
  58. <el-table-column label="MES" align="center" width="80">
  59. <template #default="{ row }">
  60. <span v-if="row.mesQuantity">{{ Number(row.mesQuantity) }}</span>
  61. <span v-else>0</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="万里牛" align="center" width="80">
  65. <template #default="{ row }">
  66. <span v-if="row.wlnQuantity">{{ Number(row.wlnQuantity) }}</span>
  67. <span v-else>0</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="差异订单号" prop="orderWlnCodes" min-width="140" />
  71. </el-table>
  72. </el-card>
  73. </el-col>
  74. <el-col :span="9">
  75. <el-card v-loading="topRight" style="height: 100%">
  76. <div class="cardTitle">MES今日自建订单数据</div>
  77. <div class="firstRowBoard">
  78. <div style="width: 50%; padding: 0 8px; display: flex">
  79. <span style="font-size: 16px !important">自建订单总数(单)</span>
  80. <span style="font-weight: 700; font-size: 20px !important; padding-left: 16px">{{ TRData.sumOrderCount || 0 }}</span>
  81. </div>
  82. <div style="width: 50%; padding: 0 8px">
  83. <span style="font-size: 16px !important">自建订单BOM总数(个)</span>
  84. <span style="font-weight: 700; font-size: 20px !important; padding-left: 16px">{{ TRData.sumBomCount || 0 }}</span>
  85. </div>
  86. </div>
  87. <el-table
  88. :data="TRData.outStorageBomList"
  89. :cell-style="{ padding: '0' }"
  90. :row-style="{ height: '50px' }"
  91. header-row-class-name="tableHeader"
  92. height="30vh"
  93. style="margin-top: 20px">
  94. <el-table-column label="序号" align="center" type="index" width="60" />
  95. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  96. <el-table-column label="数量" align="center" width="80">
  97. <template #default="{ row }">
  98. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  99. <span v-else>0</span>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </el-card>
  104. </el-col>
  105. </el-row>
  106. <el-row :gutter="10" style="padding-top: 10px">
  107. <el-col :span="12">
  108. <el-card v-loading="centerLeft">
  109. <div class="cardTitle">万里牛今日销售出库数据</div>
  110. <el-row :gutter="20">
  111. <el-col :span="8">
  112. <div class="secondRowBoardTop">
  113. <div>销售出库订单总数(单)</div>
  114. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  115. {{ CLData.sumOrderCount || 0 }}
  116. </div>
  117. </div>
  118. <div class="secondRowBoardBottom">
  119. <div>BOM销售出库总数(个)</div>
  120. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  121. {{ CLData.sumBomCount || 0 }}
  122. </div>
  123. </div>
  124. <el-table
  125. :data="CLData.outStorageBomList"
  126. :cell-style="{ padding: '0' }"
  127. :row-style="{ height: '50px' }"
  128. header-row-class-name="tableHeader"
  129. height="30vh"
  130. style="margin-top: 20px">
  131. <el-table-column label="序号" align="center" type="index" width="60" />
  132. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  133. <el-table-column label="数量" align="center" width="80">
  134. <template #default="{ row }">
  135. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  136. <span v-else>0</span>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. </el-col>
  141. <el-col :span="8">
  142. <div class="secondRowBoardTop">
  143. <div>佰卓销售出库订单总数(单)</div>
  144. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  145. {{ CLData.bzSumOrderCount || 0 }}
  146. </div>
  147. </div>
  148. <div class="secondRowBoardBottom">
  149. <div>佰卓出库BOM总数(个)</div>
  150. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  151. {{ CLData.bzSumBomCount || 0 }}
  152. </div>
  153. </div>
  154. <el-table
  155. :data="CLData.bzOutStorageBomList"
  156. :cell-style="{ padding: '0' }"
  157. :row-style="{ height: '50px' }"
  158. header-row-class-name="tableHeader"
  159. height="30vh"
  160. style="margin-top: 20px">
  161. <el-table-column label="序号" align="center" type="index" width="60" />
  162. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  163. <el-table-column label="数量" align="center" width="80">
  164. <template #default="{ row }">
  165. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  166. <span v-else>0</span>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </el-col>
  171. <el-col :span="8">
  172. <div class="secondRowBoardTop">
  173. <div>宝恒盛销售出库订单总数(单)</div>
  174. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  175. {{ CLData.sySumOrderCount || 0 }}
  176. </div>
  177. </div>
  178. <div class="secondRowBoardBottom">
  179. <div>宝恒盛出库BOM总数(个)</div>
  180. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  181. {{ CLData.sySumBomCount || 0 }}
  182. </div>
  183. </div>
  184. <el-table
  185. :data="CLData.syOutStorageBomList"
  186. :cell-style="{ padding: '0' }"
  187. :row-style="{ height: '50px' }"
  188. header-row-class-name="tableHeader"
  189. height="30vh"
  190. style="margin-top: 20px">
  191. <el-table-column label="序号" align="center" type="index" width="60" />
  192. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  193. <el-table-column label="数量" align="center" width="80">
  194. <template #default="{ row }">
  195. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  196. <span v-else>0</span>
  197. </template>
  198. </el-table-column>
  199. </el-table>
  200. </el-col>
  201. </el-row>
  202. </el-card>
  203. </el-col>
  204. <el-col :span="12">
  205. <el-card v-loading="centerRight">
  206. <div class="cardTitle">MES今日生产订单数据(不含自建订单)</div>
  207. <el-row :gutter="20">
  208. <el-col :span="8">
  209. <div class="secondRowBoardTop">
  210. <div>生产订单总数(单)</div>
  211. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  212. {{ CRData.sumOrderCount || 0 }}
  213. </div>
  214. </div>
  215. <div class="secondRowBoardBottom">
  216. <div>BOM生产总数(个)</div>
  217. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  218. {{ CRData.sumBomCount || 0 }}
  219. </div>
  220. </div>
  221. <el-table
  222. :data="CRData.outStorageBomList"
  223. :cell-style="{ padding: '0' }"
  224. :row-style="{ height: '50px' }"
  225. header-row-class-name="tableHeader"
  226. height="30vh"
  227. style="margin-top: 20px">
  228. <el-table-column label="序号" align="center" type="index" width="60" />
  229. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  230. <el-table-column label="数量" align="center" width="80">
  231. <template #default="{ row }">
  232. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  233. <span v-else>0</span>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </el-col>
  238. <el-col :span="8">
  239. <div class="secondRowBoardTop">
  240. <div>佰卓生产订单总数(单)</div>
  241. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  242. {{ CRData.bzSumOrderCount || 0 }}
  243. </div>
  244. </div>
  245. <div class="secondRowBoardBottom">
  246. <div>佰卓生产BOM总数(个)</div>
  247. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  248. {{ CRData.bzSumBomCount || 0 }}
  249. </div>
  250. </div>
  251. <el-table
  252. :data="CRData.bzOutStorageBomList"
  253. :cell-style="{ padding: '0' }"
  254. :row-style="{ height: '50px' }"
  255. header-row-class-name="tableHeader"
  256. height="30vh"
  257. style="margin-top: 20px">
  258. <el-table-column label="序号" align="center" type="index" width="60" />
  259. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  260. <el-table-column label="数量" align="center" width="80">
  261. <template #default="{ row }">
  262. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  263. <span v-else>0</span>
  264. </template>
  265. </el-table-column>
  266. </el-table>
  267. </el-col>
  268. <el-col :span="8">
  269. <div class="secondRowBoardTop">
  270. <div>宝恒盛生产订单总数(单)</div>
  271. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  272. {{ CRData.sySumOrderCount || 0 }}
  273. </div>
  274. </div>
  275. <div class="secondRowBoardBottom">
  276. <div>宝恒盛生产BOM总数(个)</div>
  277. <div style="font-weight: 700; margin-top: 10px; font-size: 20px !important">
  278. {{ CRData.sySumBomCount || 0 }}
  279. </div>
  280. </div>
  281. <el-table
  282. :data="CRData.syOutStorageBomList"
  283. :cell-style="{ padding: '0' }"
  284. :row-style="{ height: '50px' }"
  285. header-row-class-name="tableHeader"
  286. height="30vh"
  287. style="margin-top: 20px">
  288. <el-table-column label="序号" align="center" type="index" width="60" />
  289. <el-table-column label="BOM编号" prop="bomSpecCode" min-width="140" />
  290. <el-table-column label="数量" align="center" width="80">
  291. <template #default="{ row }">
  292. <span v-if="row.quantity">{{ Number(row.quantity) }}</span>
  293. <span v-else>0</span>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. </el-col>
  298. </el-row>
  299. </el-card>
  300. </el-col>
  301. </el-row>
  302. <!-- <div style="padding-top: 10px">
  303. <el-card v-loading="bottomCenter">
  304. <div class="cardTitle">MES今日自建订单数据</div>
  305. <el-row :gutter="20">
  306. <el-col :span="8">
  307. <div class="firstRowBoard">
  308. <span style="font-size: 16px !important">自建订单总数(单)</span>
  309. <span style="font-weight: 700; font-size: 20px !important">{{ BCData.sumOrderCount }}</span>
  310. </div>
  311. </el-col>
  312. <el-col :span="8">
  313. <div class="firstRowBoard">
  314. <span style="font-size: 16px !important">自建订单BOM总数(个)</span>
  315. <span style="font-weight: 700; font-size: 20px !important">{{ BCData.sumBomCount }}</span>
  316. </div>
  317. </el-col>
  318. </el-row>
  319. <el-row :gutter="20" v-if="BCData.outStorageBomList && BCData.outStorageBomList.length > 0">
  320. <el-col :span="8" style="margin-top: 20px" v-for="(item, index) in BCData.outStorageBomList" :key="index">
  321. <el-row :gutter="2">
  322. <el-col :span="8">
  323. <div style="background-color: #eeeeee; padding: 20px">BOM编号</div>
  324. </el-col>
  325. <el-col :span="16">
  326. <div style="background-color: #eeeeee; padding: 20px">{{ item.bomSpecCode }}</div>
  327. </el-col>
  328. </el-row>
  329. <el-row :gutter="2" style="margin-top: 2px">
  330. <el-col :span="8">
  331. <div style="background-color: #eeeeee; padding: 20px">数量</div>
  332. </el-col>
  333. <el-col :span="16">
  334. <div style="background-color: #eeeeee; padding: 20px">{{ item.quantity }}</div>
  335. </el-col>
  336. </el-row>
  337. </el-col>
  338. </el-row>
  339. </el-card>
  340. </div> -->
  341. </div>
  342. </template>
  343. <script setup>
  344. import moment from "moment";
  345. import { ElMessage } from "element-plus";
  346. const { proxy } = getCurrentInstance();
  347. const timeList = ref([moment().format("yyyy-MM-DD"), moment().format("yyyy-MM-DD")]);
  348. const topLeft = ref(false);
  349. const topCenter = ref(false);
  350. const topRight = ref(false);
  351. const centerLeft = ref(false);
  352. const centerRight = ref(false);
  353. const TLData = ref({
  354. count: 0,
  355. list: [],
  356. });
  357. const TCData = ref({
  358. count: 0,
  359. list: [],
  360. });
  361. const TRData = ref({
  362. sumOrderCount: 0,
  363. sumBomCount: 0,
  364. outStorageBomList: [],
  365. });
  366. const CLData = ref({
  367. sumOrderCount: 0,
  368. sumBomCount: 0,
  369. outStorageBomList: [],
  370. bzSumOrderCount: 0,
  371. bzSumBomCount: 0,
  372. bzOutStorageBomList: [],
  373. sySumOrderCount: 0,
  374. sySumBomCount: 0,
  375. syOutStorageBomList: [],
  376. });
  377. const CRData = ref({
  378. sumOrderCount: 0,
  379. sumBomCount: 0,
  380. outStorageBomList: [],
  381. bzSumOrderCount: 0,
  382. bzSumBomCount: 0,
  383. bzOutStorageBomList: [],
  384. sySumOrderCount: 0,
  385. sySumBomCount: 0,
  386. syOutStorageBomList: [],
  387. });
  388. const changeTime = () => {
  389. if (timeList.value && timeList.value.length == 2) {
  390. getList();
  391. } else {
  392. ElMessage("请选择日期");
  393. }
  394. };
  395. const getList = () => {
  396. TLData.value = {
  397. count: 0,
  398. };
  399. topLeft.value = true;
  400. proxy.post("/dailyBoard/getProductionOutStorageList", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
  401. (res) => {
  402. if (res && res.length > 0) {
  403. res.map(function (item) {
  404. TLData.value.count += item.quantity || 0;
  405. });
  406. TLData.value.list = res;
  407. } else {
  408. TLData.value = {
  409. count: 0,
  410. list: [],
  411. };
  412. }
  413. topLeft.value = false;
  414. },
  415. (err) => {
  416. console.log(err);
  417. topLeft.value = false;
  418. }
  419. );
  420. TCData.value = {
  421. count: 0,
  422. };
  423. topCenter.value = true;
  424. proxy.post("/dailyBoard/getOrderBomDifferenceList", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
  425. (res) => {
  426. if (res && res.length > 0) {
  427. res.map(function (item) {
  428. TCData.value.count += item.orderWlnCodes.length || 0;
  429. });
  430. TCData.value.list = res;
  431. } else {
  432. TCData.value = {
  433. count: 0,
  434. list: [],
  435. };
  436. }
  437. topCenter.value = false;
  438. },
  439. (err) => {
  440. console.log(err);
  441. topCenter.value = false;
  442. }
  443. );
  444. CLData.value = {};
  445. centerLeft.value = true;
  446. proxy.post("/dailyBoard/getWlnSalesOutStorageInfo", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
  447. (res) => {
  448. CLData.value = res;
  449. centerLeft.value = false;
  450. },
  451. (err) => {
  452. console.log(err);
  453. centerLeft.value = false;
  454. }
  455. );
  456. CRData.value = {};
  457. centerRight.value = true;
  458. proxy.post("/dailyBoard/getMesProductionOutStorageInfo", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
  459. (res) => {
  460. CRData.value = res;
  461. centerRight.value = false;
  462. },
  463. (err) => {
  464. console.log(err);
  465. centerRight.value = false;
  466. }
  467. );
  468. TRData.value = {};
  469. topRight.value = true;
  470. proxy.post("/dailyBoard/getSelfOrderOutStorageInfo", { beginDate: timeList.value[0] + " 00:00:00", endDate: timeList.value[1] + " 23:59:59" }).then(
  471. (res) => {
  472. TRData.value = res;
  473. topRight.value = false;
  474. },
  475. (err) => {
  476. console.log(err);
  477. topRight.value = false;
  478. }
  479. );
  480. };
  481. getList();
  482. </script>
  483. <style lang="scss" scoped>
  484. .box-card {
  485. height: calc(100vh - 120px);
  486. overflow-y: auto;
  487. }
  488. ::v-deep(.tableHeader th) {
  489. background-color: #eeeeee;
  490. height: 56px;
  491. padding: 0;
  492. }
  493. ::v-deep(.el-card__body) {
  494. padding: 20px !important;
  495. }
  496. .cardTitle {
  497. border-left: 2px solid #487cff;
  498. padding-left: 10px;
  499. font-size: 16px !important;
  500. }
  501. .firstRowBoard {
  502. padding: 20px;
  503. margin-top: 20px;
  504. background-color: #eff6ff;
  505. display: flex;
  506. justify-content: space-between;
  507. border-radius: 10px;
  508. }
  509. .secondRowBoardTop {
  510. padding: 20px;
  511. margin-top: 20px;
  512. background-color: #eff6ff;
  513. border-radius: 10px;
  514. div {
  515. font-size: 16px !important;
  516. }
  517. }
  518. .secondRowBoardBottom {
  519. padding: 20px;
  520. margin-top: 20px;
  521. background-color: #fff8ef;
  522. border-radius: 10px;
  523. div {
  524. font-size: 16px !important;
  525. }
  526. }
  527. </style>