index.vue 9.7 KB

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