index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <div class="index_box">
  3. <div class="content_box">
  4. <Search></Search>
  5. <ele-split-layout
  6. space="0px"
  7. width="45%"
  8. :resizable="true"
  9. :min-size="200"
  10. :max-size="-200"
  11. :left-style="{
  12. overflow: 'hidden',
  13. width: '100%'
  14. }"
  15. :right-style="{ overflow: 'hidden' }"
  16. :responsive="false"
  17. style="height: calc(100vh - 70px - 50px - 80px)"
  18. >
  19. <div class="left_main">
  20. <div class="top">
  21. <produceOrder
  22. @workSelect="workSelect"
  23. @rowClick="rowClick"
  24. ></produceOrder>
  25. </div>
  26. <!-- <div class="bottom">
  27. <productionResource :BomObj="BomObj"></productionResource>
  28. </div> -->
  29. </div>
  30. <template v-slot:content>
  31. <div class="right_main">
  32. <div v-if="operationType == 'pick'">
  33. <pickDetails ref="pickListRef" @pickAdd="pickAdd"></pickDetails>
  34. </div>
  35. <div v-if="operationType == 'feed'">
  36. <feeding :workListIds="workListIds"></feeding>
  37. </div>
  38. <div v-if="operationType == 'job'">
  39. <warehousing
  40. v-if="taskObj.id == -1"
  41. :workListIds="workListIds"
  42. ref="wareRef"
  43. ></warehousing>
  44. <jobBooking
  45. v-else
  46. :workListIds="workListIds"
  47. ref="jobRef"
  48. ></jobBooking>
  49. </div>
  50. </div>
  51. </template>
  52. </ele-split-layout>
  53. <footBtn @footBtn="footBtn"></footBtn>
  54. </div>
  55. <!--领料弹框 -->
  56. <picking
  57. v-if="pickingShow"
  58. @close="pickingClose"
  59. :workListIds="workListIds"
  60. ></picking>
  61. </div>
  62. </template>
  63. <script>
  64. import Search from './components/search.vue';
  65. import footBtn from './components/footBtn.vue';
  66. import produceOrder from './components/produceOrder.vue';
  67. import productionResource from './components/productionResource/index.vue';
  68. import picking from './components/picking/index.vue';
  69. import pickDetails from './components/picking/details.vue';
  70. import feeding from './components/feeding/index.vue';
  71. import jobBooking from './components/jobBooking/index.vue';
  72. import warehousing from './components/warehousing/index.vue';
  73. import { getByTaskId } from '@/api/produce/index';
  74. export default {
  75. components: {
  76. Search,
  77. footBtn,
  78. produceOrder,
  79. productionResource,
  80. picking,
  81. pickDetails,
  82. feeding,
  83. jobBooking,
  84. warehousing
  85. },
  86. data() {
  87. return {
  88. loading: false,
  89. operationType: null,
  90. workListIds: [],
  91. pickingShow: false,
  92. BomObj: {}
  93. };
  94. },
  95. computed: {
  96. taskObj() {
  97. return this.$store.state.user.taskObj;
  98. }
  99. },
  100. created() {
  101. this.operationType = null;
  102. this.workListIds = [];
  103. },
  104. methods: {
  105. workSelect(data) {
  106. this.workListIds = data;
  107. },
  108. footBtn(t) {
  109. this.operationType = t;
  110. if (
  111. Object.keys(this.$store.state.user.taskObj).length === 0 &&
  112. this.$store.state.user.taskObj.constructor === Object
  113. ) {
  114. this.$message.warning('请选择工序');
  115. return false;
  116. }
  117. if (['pick', 'feed', 'job'].includes(t)) {
  118. if (this.workListIds.length == 0) {
  119. this.$message.warning('请选择工单列表');
  120. return false;
  121. }
  122. }
  123. if (t == 'pick') {
  124. this.$nextTick(() => {
  125. this.$refs.pickListRef.getList(this.workListIds);
  126. });
  127. }
  128. if (t == 'feed') {
  129. }
  130. },
  131. pickAdd() {
  132. this.pickingShow = true;
  133. },
  134. pickingClose(val) {
  135. if (val) {
  136. this.$nextTick(() => {
  137. this.$refs.pickListRef.getList(this.workListIds);
  138. });
  139. }
  140. this.pickingShow = false;
  141. },
  142. rowClick(row, taskId) {
  143. if (taskId) {
  144. let params = {
  145. categoryId: row.categoryId,
  146. taskId: taskId
  147. };
  148. getByTaskId(params).then((res) => {
  149. this.BomObj = res.data;
  150. this.$forceUpdate();
  151. });
  152. }
  153. }
  154. },
  155. mounted() {
  156. this.$nextTick(() => {
  157. const targetElements =
  158. document.getElementsByClassName('ele-admin-tabs');
  159. if (targetElements.length > 0) {
  160. // 遍历所有具有 'ele-admin-tabs' 类的元素
  161. Array.from(targetElements).forEach((element) => {
  162. // 对每个元素添加 'new-ele-admin-tabs' 类
  163. element.classList.add('new-ele-admin-tabs');
  164. });
  165. }
  166. });
  167. },
  168. destroyed() {
  169. this.$nextTick(() => {
  170. const targetElements =
  171. document.getElementsByClassName('ele-admin-tabs');
  172. if (targetElements.length > 0) {
  173. Array.from(targetElements).forEach((element) => {
  174. element.classList.remove('new-ele-admin-tabs');
  175. });
  176. }
  177. });
  178. }
  179. };
  180. </script>
  181. <style>
  182. .new-ele-admin-tabs {
  183. display: none !important;
  184. }
  185. .c_title {
  186. color: #157a2c;
  187. font-size: 16px;
  188. font-weight: bold;
  189. }
  190. .tableZ_box {
  191. border: 1px solid #e3e5e5;
  192. margin: 6px 0;
  193. &:last-child {
  194. border-bottom: none;
  195. }
  196. .row {
  197. width: 100%;
  198. display: flex;
  199. }
  200. .col {
  201. width: calc(100% / 5);
  202. display: flex;
  203. align-items: center;
  204. min-width: 200px;
  205. min-height: 32px;
  206. border-bottom: 1px solid #e3e5e5;
  207. border-right: 1px solid #e3e5e5;
  208. &:last-child {
  209. border-right: none;
  210. }
  211. .name {
  212. display: flex;
  213. align-items: center;
  214. padding: 4px;
  215. width: 80px;
  216. height: 100%;
  217. background-color: #d0e4d5;
  218. color: #000;
  219. }
  220. .content {
  221. padding: 4px 6px;
  222. color: #000;
  223. }
  224. }
  225. .pd6 {
  226. padding: 0 6px;
  227. }
  228. }
  229. </style>
  230. <style lang="scss" scoped>
  231. .index_box {
  232. padding: 8px;
  233. padding-bottom: 0px;
  234. width: 100%;
  235. min-width: 1280px !important;
  236. height: calc(100vh - 60px);
  237. overflow-x: auto;
  238. /* 当内容超出宽度时,允许水平滚动 */
  239. white-space: nowrap;
  240. /* 防止内部文本换行,确保所有内容都在一行显示 */
  241. scrollbar-width: thin;
  242. /* 设置滚动条宽度(浏览器兼容性可能有所不同) */
  243. scrollbar-color: #40a9ff transparent;
  244. /* 设置滚动条颜色和轨道颜色(同样,浏览器兼容性) */
  245. }
  246. .main {
  247. width: 100%;
  248. min-width: 1280px;
  249. height: calc(100vh - 70px - 50px - 80px);
  250. display: flex;
  251. justify-content: space-between;
  252. }
  253. .left_main {
  254. width: 100%;
  255. height: 100%;
  256. display: flex;
  257. flex-direction: column;
  258. justify-content: space-around;
  259. min-width: 640px;
  260. .top {
  261. width: 100%;
  262. height: 100%;
  263. overflow: hidden;
  264. }
  265. // .bottom {
  266. // width: 100%;
  267. // min-height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
  268. // overflow: hidden;
  269. // }
  270. }
  271. .right_main {
  272. min-width: 640px;
  273. height: calc((100vh - 70px - 50px - 80px - 12px));
  274. margin-top: 6px;
  275. background: #f0f3f3;
  276. }
  277. </style>