details.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div>
  3. <div class="feed_box">
  4. <div v-for="(item, index) in dataList" :key="index" class="card_box">
  5. <div class="rx-bc">
  6. <div class="item_box rx-bc">
  7. <div class="round">{{ index + 1 }}</div>
  8. <div class="time">投料时间:{{ item.createTime }} </div>
  9. </div>
  10. <div class="item_box rx-bc">
  11. <div class="time">工序名称: {{ item.taskName }}</div>
  12. </div>
  13. </div>
  14. <div v-for="(it, idx) in item.orderInfoList" :key="idx">
  15. <workOrderBom :item="it" :isDetails="true"></workOrderBom>
  16. <deviceBom
  17. v-if="it.equipmentList.length != 0"
  18. :list="it.equipmentList"
  19. ></deviceBom>
  20. <productsBom
  21. v-if="
  22. Object.prototype.hasOwnProperty.call(it, 'inProductList') &&
  23. it.inProductList[0]
  24. "
  25. :productsObj="it.inProductList[0]"
  26. ></productsBom>
  27. <modelBom v-if="it.modelList.length != 0" :list="it.modelList">
  28. </modelBom>
  29. <instanceBom
  30. v-if="it.instanceList.length != 0"
  31. :isDetails="true"
  32. :list="it.instanceList"
  33. :currentTaskDiagram="currentTaskDiagram"
  34. :equipmentList="it.equipmentList"
  35. ></instanceBom>
  36. <semiProductBom
  37. v-if="it.semiProductList.length != 0"
  38. :isDetails="true"
  39. :list="it.semiProductList"
  40. :currentTaskDiagram="currentTaskDiagram"
  41. :equipmentList="it.equipmentList"
  42. ></semiProductBom>
  43. <turnoverBom
  44. v-if="it.turnover.length != 0"
  45. :list="it.turnover"
  46. :isDetails="true"
  47. :wordItem="it"
  48. pattern="feed"
  49. ></turnoverBom>
  50. <packingBom
  51. v-if="it.packingList.length != 0"
  52. :list="it.packingList"
  53. ></packingBom>
  54. <palletBom
  55. v-if="
  56. Object.prototype.hasOwnProperty.call(it, 'palletList') &&
  57. it.palletList.length != 0
  58. "
  59. :palletList="it.palletList"
  60. ></palletBom>
  61. <revolvingDiskBom
  62. v-if="
  63. Object.prototype.hasOwnProperty.call(it, 'revolvingDiskList') &&
  64. it.revolvingDiskList.length != 0
  65. "
  66. :revolvingDiskList="it.revolvingDiskList"
  67. ></revolvingDiskBom>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { feedByOrderIds } from '@/api/produce/feeding';
  75. import workOrderBom from './components/workOrderBom.vue';
  76. import deviceBom from './components/deviceBom.vue';
  77. import modelBom from './components/modelBom.vue';
  78. import instanceBom from './components/instanceBom.vue';
  79. import semiProductBom from './components/semiProductBom';
  80. import packingBom from './components/packingBom.vue';
  81. import palletBom from './components/palletBom';
  82. import revolvingDiskBom from './components/revolvingDiskBom';
  83. import productsBom from './components/productsBom.vue';
  84. import turnoverBom from './components/turnoverBom.vue';
  85. export default {
  86. components: {
  87. workOrderBom,
  88. deviceBom,
  89. modelBom,
  90. instanceBom,
  91. packingBom,
  92. palletBom,
  93. revolvingDiskBom,
  94. semiProductBom,
  95. productsBom,
  96. turnoverBom
  97. },
  98. props: {
  99. routeObj: {
  100. type: Object,
  101. default() {
  102. return {};
  103. }
  104. },
  105. curTaskObj: {
  106. type: Object,
  107. default() {
  108. return () => {};
  109. }
  110. }
  111. },
  112. watch: {
  113. curTaskObj: {
  114. handler(obj) {
  115. if (obj) {
  116. this.getList(obj.taskId);
  117. }
  118. },
  119. deep: true,
  120. immediate: true
  121. }
  122. },
  123. data() {
  124. return {
  125. ids: [],
  126. taskId: null,
  127. dataList: [],
  128. currentTaskDiagram: {
  129. isFirstTask: 0
  130. },
  131. isLoad: false
  132. };
  133. },
  134. created() {
  135. // this.getList();
  136. },
  137. methods: {
  138. async getList(taskId) {
  139. let param = {
  140. ids: [this.routeObj.id],
  141. taskId: taskId
  142. };
  143. const res = await feedByOrderIds(param);
  144. console.log(res);
  145. this.dataList = JSON.parse(JSON.stringify(res));
  146. }
  147. }
  148. };
  149. </script>
  150. <style scoped lang="scss">
  151. .rx-bc {
  152. display: flex;
  153. align-items: center;
  154. justify-content: space-between;
  155. }
  156. .item_box {
  157. margin-top: 5px;
  158. margin-bottom: 6px;
  159. padding: 0 10px;
  160. .round {
  161. width: 20px;
  162. height: 20px;
  163. line-height: 20px;
  164. border-radius: 50%;
  165. background: #157a2c;
  166. color: #fff;
  167. text-align: center;
  168. font-size: 12px;
  169. }
  170. .time {
  171. color: #157a2c;
  172. font-family: PingFang HK;
  173. font-size: 14px;
  174. font-style: normal;
  175. font-weight: 500;
  176. margin-left: 8px;
  177. }
  178. }
  179. </style>