index.vue 18 KB

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