index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. :title="title"
  8. background-color="#157A2C"
  9. color="#fff"
  10. @clickLeft="back"
  11. ></uni-nav-bar>
  12. <!-- <view class="nav-placeholder"></view> -->
  13. <view class="list_box" v-for="(item, idx) in dataList" :key="idx">
  14. <view class="card_box cx-sc">
  15. <view class="content_table">
  16. <view class="item">
  17. <view class="lable rx-cc" style="color: #157a2c">领料单号</view>
  18. <view class="content rx-bc" style="color: #157a2c">
  19. {{ pickOrderCodeSafe(item) }}
  20. </view>
  21. </view>
  22. <view class="item">
  23. <view class="lable rx-cc" style="color: #157a2c">领料时间</view>
  24. <view class="content rx-bc" style="color: #157a2c">
  25. {{ item.createTime }}
  26. </view>
  27. </view>
  28. <view class="item">
  29. <view class="lable rx-cc" style="color: #157a2c">领料人</view>
  30. <view class="content rx-bc" style="color: #157a2c">
  31. {{ item.executorName }}
  32. </view>
  33. </view>
  34. <view class="item">
  35. <view class="lable rx-cc" style="color: #157a2c">类型</view>
  36. <view
  37. class="content rx-bc"
  38. style="color: #157a2c"
  39. v-if="item.type == 1"
  40. >
  41. 自建领料
  42. </view>
  43. <view
  44. class="content rx-bc"
  45. style="color: #157a2c"
  46. v-if="item.type == 2"
  47. >
  48. 工单领料
  49. </view>
  50. <view
  51. class="content rx-bc"
  52. style="color: #157a2c"
  53. v-if="item.type == 3"
  54. >
  55. 委外领料
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <u-list
  61. @scrolltolower="scrolltolower"
  62. key="dataList-catch"
  63. v-if="status == 1"
  64. height="auto"
  65. style="padding-bottom: 10rpx"
  66. >
  67. <view v-if="item.type == 2">
  68. <view
  69. class="card_box cx-sc"
  70. v-for="(it, index) in orderInfoListSafe(item)"
  71. :key="index"
  72. >
  73. <instanceBom :item="it" :isDetails="true"></instanceBom>
  74. </view>
  75. <u-list-item
  76. v-if="orderInfoListSafe(item).length == 0"
  77. style="margin-top: 20vh"
  78. >
  79. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  80. </u-list-item>
  81. </view>
  82. <view v-if="item.type == 1">
  83. <view
  84. class="card_box cx-sc"
  85. v-for="(it, index) in detailListSafe(item)"
  86. :key="index"
  87. >
  88. <instanceBomTwo :item="it" :isDetails="true"></instanceBomTwo>
  89. </view>
  90. <u-list-item
  91. v-if="detailListSafe(item).length == 0"
  92. style="margin-top: 20vh"
  93. >
  94. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  95. </u-list-item>
  96. </view>
  97. </u-list>
  98. <u-list
  99. @scrolltolower="scrolltolower"
  100. key="dataList2"
  101. v-if="status == 2"
  102. height="auto"
  103. style="padding-bottom: 10rpx"
  104. >
  105. <view v-if="item.type == 1">
  106. <view
  107. class="card_box cx-sc"
  108. v-for="(it, index) in detailListSafe(item)"
  109. :key="index"
  110. >
  111. <outInstanceBom :item="it" :isDetails="true"></outInstanceBom>
  112. </view>
  113. <u-list-item
  114. v-if="detailListSafe(item).length == 0"
  115. style="margin-top: 20vh"
  116. >
  117. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  118. </u-list-item>
  119. </view>
  120. <view v-if="item.type == 2">
  121. <view
  122. class="card_box cx-sc"
  123. v-for="(it, index) in orderInfoListSafe(item)"
  124. :key="index"
  125. >
  126. <outInstanceBom :item="it" :isDetails="true"></outInstanceBom>
  127. </view>
  128. <u-list-item
  129. v-if="orderInfoListSafe(item).length == 0"
  130. style="margin-top: 20vh"
  131. >
  132. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  133. </u-list-item>
  134. </view>
  135. <!-- <view class="card_box cx-sc">
  136. <outInstanceBom :list="dataList" :isDetails="true"></outInstanceBom>
  137. </view>
  138. <u-list-item v-if="dataList.length === 0" style="margin-top: 20vh">
  139. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  140. </u-list-item> -->
  141. </u-list>
  142. </view>
  143. <view class="bottom-wrapper">
  144. <!-- <view class="btn_box" @click="save">一键报工</view> -->
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. import { tableHeader } from "../../common.js";
  150. import { workorderPage } from "@/api/pda/workOrder.js";
  151. import {
  152. pickDetails,
  153. pickOutInOrder,
  154. queryOutWordDetail,
  155. } from "@/api/pda/picking.js";
  156. import instanceBom from "./components/instanceBom.vue";
  157. import instanceBomTwo from "../../selfBuiltPickOrder/components/instanceBom.vue";
  158. import outInstanceBom from "./components/outInstanceBom.vue";
  159. export default {
  160. components: {
  161. instanceBom,
  162. instanceBomTwo,
  163. outInstanceBom,
  164. },
  165. data() {
  166. return {
  167. ids: [],
  168. dataList: [],
  169. title: "",
  170. status: 1,
  171. item: null,
  172. };
  173. },
  174. onLoad(option) {
  175. this.status = option.status || 1;
  176. console.log(option.status, "optionoptionoption");
  177. if (option.item) {
  178. this.title =
  179. option.status == 1 ? "领料详情" : option.status == 2 ? " 出库详情" : "";
  180. const parsed = JSON.parse(option.item);
  181. this.dataList = Array.isArray(parsed)
  182. ? parsed.filter(Boolean)
  183. : parsed
  184. ? [parsed]
  185. : [];
  186. } else {
  187. this.title = "领料详情";
  188. this.ids = [option.id];
  189. this.getList();
  190. }
  191. },
  192. methods: {
  193. async getList() {
  194. let list = [];
  195. if (this.status == 1) {
  196. const res = await pickDetails(this.ids);
  197. list = res;
  198. // list.forEach((m) => {
  199. // if (m.orderInfoList.length > 0) {
  200. // m.orderInfoList.forEach((o) => {
  201. // let _arr = [];
  202. // _arr = [...o.bomDetailDTOS, ...o.instanceList];
  203. // _arr = _arr.sort(
  204. // (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId,
  205. // );
  206. // o["arr"] = _arr;
  207. // });
  208. // }
  209. // });
  210. list.forEach((m) => {
  211. if (Array.isArray(m.orderInfoList) && m.orderInfoList.length > 0) {
  212. m.orderInfoList.forEach((o) => {
  213. let _arr = [];
  214. _arr = [
  215. ...(Array.isArray(o.bomDetailDTOS) ? o.bomDetailDTOS : []),
  216. ...(Array.isArray(o.instanceList) ? o.instanceList : []),
  217. ];
  218. _arr.sort(
  219. (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId,
  220. );
  221. o.arr = _arr;
  222. });
  223. }
  224. });
  225. this.dataList = list;
  226. } else if (this.status == 2) {
  227. console.log(this.ids.join(","));
  228. const res = await queryOutWordDetail({
  229. pickOrderId: this.ids.join(","),
  230. });
  231. console.log(res, "11111");
  232. // const res = await pickOutInOrder({
  233. // workOrderIds: this.ids,
  234. // });
  235. // this.dataList = res;
  236. }
  237. },
  238. orderInfoListSafe(item) {
  239. console.log(item, "itemitemitem");
  240. return Array.isArray(item?.orderInfoList) ? item.orderInfoList : [];
  241. },
  242. detailListSafe(item) {
  243. console.log(item, "itemitemitem");
  244. return Array.isArray(item?.detailList) ? item.detailList : [];
  245. },
  246. pickOrderCodeSafe(item) {
  247. return (
  248. item?.code ||
  249. item?.pickCode ||
  250. item?.pickOrderCode ||
  251. item?.orderCode ||
  252. "--"
  253. );
  254. },
  255. scrolltolower() {},
  256. tableH(type) {
  257. return tableHeader(type);
  258. },
  259. save() {},
  260. },
  261. };
  262. </script>
  263. <style lang="scss" scoped>
  264. .content-box {
  265. min-height: 100vh;
  266. display: flex;
  267. flex-direction: column;
  268. box-sizing: border-box;
  269. }
  270. .nav-placeholder {
  271. /* 给 fixed 导航栏预留高度,避免真机上首屏第一行被遮住 */
  272. height: calc(var(--status-bar-height) + 88rpx);
  273. flex-shrink: 0;
  274. }
  275. .list_box {
  276. padding: 16rpx 0 0;
  277. }
  278. .bottom-wrapper {
  279. .btn_box {
  280. width: 750rpx;
  281. height: 88rpx;
  282. line-height: 88rpx;
  283. background: $theme-color;
  284. text-align: center;
  285. font-size: 36rpx;
  286. font-style: normal;
  287. font-weight: 400;
  288. color: #fff;
  289. }
  290. }
  291. .card_box {
  292. margin-top: 10rpx;
  293. .word_order {
  294. height: 64rpx;
  295. width: 706rpx;
  296. background: $theme-color;
  297. font-size: 28rpx;
  298. color: #fff;
  299. line-height: 64rpx;
  300. padding-left: 40rpx;
  301. box-sizing: border-box;
  302. }
  303. .content_table {
  304. margin-top: 10rpx;
  305. width: 702rpx;
  306. border: 2rpx solid $border-color;
  307. .item {
  308. display: flex;
  309. border-bottom: 2rpx solid $border-color;
  310. .lable {
  311. width: 132rpx;
  312. text-align: center;
  313. background-color: #f7f9fa;
  314. font-size: 26rpx;
  315. border-right: 2rpx solid $border-color;
  316. flex-shrink: 0;
  317. }
  318. .ww80 {
  319. width: 80rpx;
  320. }
  321. .content {
  322. width: 518rpx;
  323. min-height: 64rpx;
  324. font-size: 28rpx;
  325. line-height: 28rpx;
  326. font-style: normal;
  327. font-weight: 400;
  328. padding: 18rpx 8rpx;
  329. box-sizing: border-box;
  330. word-wrap: break-word;
  331. flex-grow: 1 !important;
  332. }
  333. .content_num {
  334. display: flex;
  335. align-items: center;
  336. padding: 0 4rpx;
  337. /deep/ .uni-input-input {
  338. width: 480rpx;
  339. border: 2rpx solid #f0f8f2;
  340. background: #f0f8f2;
  341. color: $theme-color;
  342. }
  343. .unit {
  344. padding: 0 4rpx;
  345. font-size: 24rpx;
  346. color: #404446;
  347. }
  348. }
  349. .pd4 {
  350. padding: 4rpx 8rpx;
  351. }
  352. &:last-child {
  353. border-bottom: none;
  354. }
  355. }
  356. .ww55 {
  357. width: 55%;
  358. }
  359. .ww45 {
  360. width: 45%;
  361. }
  362. }
  363. }
  364. </style>