index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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 @scrolltolower="scrolltolower" key="dataList" v-if="status == 1">
  60. <view v-if="dataList.type == 2">
  61. <view
  62. class="card_box cx-sc"
  63. v-for="(item, index) in dataList.orderInfoList"
  64. :key="index"
  65. >
  66. <instanceBom :item="item" :isDetails="true"></instanceBom>
  67. </view>
  68. <u-list-item
  69. v-if="dataList.orderInfoList.length === 0"
  70. style="margin-top: 20vh"
  71. >
  72. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  73. </u-list-item>
  74. </view>
  75. <view v-if="dataList.type == 1">
  76. <view
  77. class="card_box cx-sc"
  78. v-for="(item, index) in dataList.detailList"
  79. :key="index"
  80. >
  81. <instanceBomTwo :item="item" :isDetails="true"></instanceBomTwo>
  82. </view>
  83. <u-list-item
  84. v-if="dataList.detailList.length === 0"
  85. style="margin-top: 20vh"
  86. >
  87. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  88. </u-list-item>
  89. </view>
  90. </u-list>
  91. <u-list @scrolltolower="scrolltolower" key="dataList2" v-if="status == 2">
  92. <view
  93. class="card_box cx-sc"
  94. v-for="(item, index) in dataList.orderInfoList"
  95. :key="index"
  96. >
  97. <outInstanceBom :item="item" :isDetails="true"></outInstanceBom>
  98. </view>
  99. <u-list-item
  100. v-if="dataList.orderInfoList.length === 0"
  101. style="margin-top: 20vh"
  102. >
  103. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  104. </u-list-item>
  105. <!-- <view class="card_box cx-sc">
  106. <outInstanceBom :list="dataList" :isDetails="true"></outInstanceBom>
  107. </view>
  108. <u-list-item v-if="dataList.length === 0" style="margin-top: 20vh">
  109. <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
  110. </u-list-item> -->
  111. </u-list>
  112. </view>
  113. <view class="bottom-wrapper">
  114. <!-- <view class="btn_box" @click="save">一键报工</view> -->
  115. </view>
  116. </view>
  117. </template>
  118. <script>
  119. import { tableHeader } from "../../common.js";
  120. import { workorderPage } from "@/api/pda/workOrder.js";
  121. import {
  122. pickDetails,
  123. pickOutInOrder,
  124. queryOutWordDetail,
  125. } from "@/api/pda/picking.js";
  126. import instanceBom from "./components/instanceBom.vue";
  127. import instanceBomTwo from "../../selfBuiltPickOrder/components/instanceBom.vue";
  128. import outInstanceBom from "./components/outInstanceBom.vue";
  129. export default {
  130. components: {
  131. instanceBom,
  132. instanceBomTwo,
  133. outInstanceBom,
  134. },
  135. data() {
  136. return {
  137. ids: [],
  138. dataList: null,
  139. title: null,
  140. status: 1,
  141. item: null,
  142. };
  143. },
  144. onLoad(option) {
  145. this.status = option.status || 1;
  146. this.title =
  147. option.status == 1 ? "领料详情" : option.status == 2 ? " 出库详情" : "";
  148. this.dataList = JSON.parse(option.item);
  149. console.log(this.dataList, "领料详情数据");
  150. // this.ids = [option.id];
  151. // this.getList();
  152. },
  153. methods: {
  154. async getList() {
  155. let list = [];
  156. if (this.status == 1) {
  157. const res = await pickDetails(this.ids);
  158. list = res;
  159. list.forEach((m) => {
  160. if (m.orderInfoList.length > 0) {
  161. m.orderInfoList.forEach((o) => {
  162. let _arr = [];
  163. _arr = [...o.bomDetailDTOS, ...o.instanceList];
  164. _arr = _arr.sort(
  165. (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
  166. );
  167. o["arr"] = _arr;
  168. });
  169. }
  170. });
  171. this.dataList = list;
  172. } else if (this.status == 2) {
  173. console.log(this.ids.join(","));
  174. const res = await queryOutWordDetail({
  175. pickOrderId: this.ids.join(","),
  176. });
  177. console.log(res, "11111");
  178. // const res = await pickOutInOrder({
  179. // workOrderIds: this.ids,
  180. // });
  181. // this.dataList = res;
  182. }
  183. },
  184. scrolltolower() {},
  185. tableH(type) {
  186. return tableHeader(type);
  187. },
  188. save() {},
  189. },
  190. };
  191. </script>
  192. <style lang="scss" scoped>
  193. .content-box {
  194. height: 100vh;
  195. overflow: hidden;
  196. display: flex;
  197. flex-direction: column;
  198. }
  199. .list_box {
  200. flex: 1;
  201. overflow: hidden;
  202. padding: 16rpx 0;
  203. .u-list {
  204. height: 100% !important;
  205. }
  206. }
  207. .bottom-wrapper {
  208. .btn_box {
  209. width: 750rpx;
  210. height: 88rpx;
  211. line-height: 88rpx;
  212. background: $theme-color;
  213. text-align: center;
  214. font-size: 36rpx;
  215. font-style: normal;
  216. font-weight: 400;
  217. color: #fff;
  218. }
  219. }
  220. .card_box {
  221. margin-top: 10rpx;
  222. .word_order {
  223. height: 64rpx;
  224. width: 706rpx;
  225. background: $theme-color;
  226. font-size: 28rpx;
  227. color: #fff;
  228. line-height: 64rpx;
  229. padding-left: 40rpx;
  230. box-sizing: border-box;
  231. }
  232. .content_table {
  233. margin-top: 10rpx;
  234. width: 702rpx;
  235. border: 2rpx solid $border-color;
  236. .item {
  237. display: flex;
  238. border-bottom: 2rpx solid $border-color;
  239. .lable {
  240. width: 132rpx;
  241. text-align: center;
  242. background-color: #f7f9fa;
  243. font-size: 26rpx;
  244. border-right: 2rpx solid $border-color;
  245. flex-shrink: 0;
  246. }
  247. .ww80 {
  248. width: 80rpx;
  249. }
  250. .content {
  251. width: 518rpx;
  252. min-height: 64rpx;
  253. font-size: 28rpx;
  254. line-height: 28rpx;
  255. font-style: normal;
  256. font-weight: 400;
  257. padding: 18rpx 8rpx;
  258. box-sizing: border-box;
  259. word-wrap: break-word;
  260. flex-grow: 1 !important;
  261. }
  262. .content_num {
  263. display: flex;
  264. align-items: center;
  265. padding: 0 4rpx;
  266. /deep/ .uni-input-input {
  267. width: 480rpx;
  268. border: 2rpx solid #f0f8f2;
  269. background: #f0f8f2;
  270. color: $theme-color;
  271. }
  272. .unit {
  273. padding: 0 4rpx;
  274. font-size: 24rpx;
  275. color: #404446;
  276. }
  277. }
  278. .pd4 {
  279. padding: 4rpx 8rpx;
  280. }
  281. &:last-child {
  282. border-bottom: none;
  283. }
  284. }
  285. .ww55 {
  286. width: 55%;
  287. }
  288. .ww45 {
  289. width: 45%;
  290. }
  291. }
  292. }
  293. </style>