index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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">
  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. {{ dataList.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. {{ dataList.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. {{ dataList.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="dataList.type == 1"
  39. >
  40. 自建领料
  41. </view>
  42. <view
  43. class="content rx-bc"
  44. style="color: #157a2c"
  45. v-if="dataList.type == 2"
  46. >
  47. 工单领料
  48. </view>
  49. <view
  50. class="content rx-bc"
  51. style="color: #157a2c"
  52. v-if="dataList.type == 3"
  53. >
  54. 委外领料
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <u-list
  60. @scrolltolower="scrolltolower"
  61. key="dataList"
  62. v-if="status == 1"
  63. style="padding-bottom: 300rpx"
  64. >
  65. <view v-if="dataList.type == 2">
  66. <view
  67. class="card_box cx-sc"
  68. v-for="(item, index) in dataList.orderInfoList"
  69. :key="index"
  70. >
  71. <instanceBom :item="item" :isDetails="true"></instanceBom>
  72. </view>
  73. <u-list-item
  74. v-if="dataList.orderInfoList.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="dataList.type == 1">
  81. <view
  82. class="card_box cx-sc"
  83. v-for="(item, index) in dataList.detailList"
  84. :key="index"
  85. >
  86. <instanceBomTwo :item="item" :isDetails="true"></instanceBomTwo>
  87. </view>
  88. <u-list-item
  89. v-if="dataList.detailList.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="dataList.type == 1">
  103. <view
  104. class="card_box cx-sc"
  105. v-for="(item, index) in dataList.detailList"
  106. :key="index"
  107. >
  108. <outInstanceBom :item="item" :isDetails="true"></outInstanceBom>
  109. </view>
  110. <u-list-item
  111. v-if="dataList.detailList.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="dataList.type == 2">
  118. <view
  119. class="card_box cx-sc"
  120. v-for="(item, index) in dataList.orderInfoList"
  121. :key="index"
  122. >
  123. <outInstanceBom :item="item" :isDetails="true"></outInstanceBom>
  124. </view>
  125. <u-list-item
  126. v-if="dataList.orderInfoList.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: null,
  166. title: null,
  167. status: 1,
  168. item: null,
  169. };
  170. },
  171. onLoad(option) {
  172. this.status = option.status || 1;
  173. this.title =
  174. option.status == 1 ? "领料详情" : option.status == 2 ? " 出库详情" : "";
  175. this.dataList = JSON.parse(option.item);
  176. },
  177. methods: {
  178. async getList() {
  179. let list = [];
  180. if (this.status == 1) {
  181. const res = await pickDetails(this.ids);
  182. list = res;
  183. list.forEach((m) => {
  184. if (m.orderInfoList.length > 0) {
  185. m.orderInfoList.forEach((o) => {
  186. let _arr = [];
  187. _arr = [...o.bomDetailDTOS, ...o.instanceList];
  188. _arr = _arr.sort(
  189. (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
  190. );
  191. o["arr"] = _arr;
  192. });
  193. }
  194. });
  195. this.dataList = list;
  196. } else if (this.status == 2) {
  197. console.log(this.ids.join(","));
  198. const res = await queryOutWordDetail({
  199. pickOrderId: this.ids.join(","),
  200. });
  201. console.log(res, "11111");
  202. // const res = await pickOutInOrder({
  203. // workOrderIds: this.ids,
  204. // });
  205. // this.dataList = res;
  206. }
  207. },
  208. scrolltolower() {},
  209. tableH(type) {
  210. return tableHeader(type);
  211. },
  212. save() {},
  213. },
  214. };
  215. </script>
  216. <style lang="scss" scoped>
  217. .content-box {
  218. height: 100vh;
  219. overflow: hidden;
  220. display: flex;
  221. flex-direction: column;
  222. }
  223. .list_box {
  224. flex: 1;
  225. overflow: hidden;
  226. padding: 16rpx 0;
  227. .u-list {
  228. height: 100% !important;
  229. }
  230. }
  231. .bottom-wrapper {
  232. .btn_box {
  233. width: 750rpx;
  234. height: 88rpx;
  235. line-height: 88rpx;
  236. background: $theme-color;
  237. text-align: center;
  238. font-size: 36rpx;
  239. font-style: normal;
  240. font-weight: 400;
  241. color: #fff;
  242. }
  243. }
  244. .card_box {
  245. margin-top: 10rpx;
  246. .word_order {
  247. height: 64rpx;
  248. width: 706rpx;
  249. background: $theme-color;
  250. font-size: 28rpx;
  251. color: #fff;
  252. line-height: 64rpx;
  253. padding-left: 40rpx;
  254. box-sizing: border-box;
  255. }
  256. .content_table {
  257. margin-top: 10rpx;
  258. width: 702rpx;
  259. border: 2rpx solid $border-color;
  260. .item {
  261. display: flex;
  262. border-bottom: 2rpx solid $border-color;
  263. .lable {
  264. width: 132rpx;
  265. text-align: center;
  266. background-color: #f7f9fa;
  267. font-size: 26rpx;
  268. border-right: 2rpx solid $border-color;
  269. flex-shrink: 0;
  270. }
  271. .ww80 {
  272. width: 80rpx;
  273. }
  274. .content {
  275. width: 518rpx;
  276. min-height: 64rpx;
  277. font-size: 28rpx;
  278. line-height: 28rpx;
  279. font-style: normal;
  280. font-weight: 400;
  281. padding: 18rpx 8rpx;
  282. box-sizing: border-box;
  283. word-wrap: break-word;
  284. flex-grow: 1 !important;
  285. }
  286. .content_num {
  287. display: flex;
  288. align-items: center;
  289. padding: 0 4rpx;
  290. /deep/ .uni-input-input {
  291. width: 480rpx;
  292. border: 2rpx solid #f0f8f2;
  293. background: #f0f8f2;
  294. color: $theme-color;
  295. }
  296. .unit {
  297. padding: 0 4rpx;
  298. font-size: 24rpx;
  299. color: #404446;
  300. }
  301. }
  302. .pd4 {
  303. padding: 4rpx 8rpx;
  304. }
  305. &:last-child {
  306. border-bottom: none;
  307. }
  308. }
  309. .ww55 {
  310. width: 55%;
  311. }
  312. .ww45 {
  313. width: 45%;
  314. }
  315. }
  316. }
  317. </style>