index.vue 6.7 KB

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