index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div>
  3. <el-drawer title="" :visible.sync="drawer" :custom-class="isFullscreen ? 'not-fullscreen' : 'is-fullscreen'"
  4. :before-close="handleClose" :with-header="false">
  5. <!-- 自定义头部 -->
  6. <div class="custom-drawer-header">
  7. <div> </div>
  8. <div class="rx-ec">
  9. <el-button icon="el-icon-full-screen" type="text" @click="handleFull">{{ isFullscreen ? '全屏' : '缩小'
  10. }}</el-button>
  11. <el-button icon="el-icon-circle-close" type="text" @click="handleClose">关闭</el-button>
  12. </div>
  13. </div>
  14. <div class="drawer_content">
  15. <!-- //详细信息 -->
  16. <!-- <Info :workOrderInfo="workOrderInfo"></Info> -->
  17. <btnlist></btnlist>
  18. <el-steps :active="activeIndex" space="20px" align-center style="margin-top: 18px">
  19. <el-step v-for="(item, index) in routeList" :key="index" :title="item.taskTypeName"
  20. @click.native="handIdx(index, item)" :description="desIndex == index ? '此处' : ''"
  21. :class="desIndex == index ? 'active' : ''"></el-step>
  22. </el-steps>
  23. <el-tabs type="border-card">
  24. <el-tab-pane label="基本信息">
  25. <basicDetails :workOrderInfo="workOrderInfo"></basicDetails>
  26. </el-tab-pane>
  27. <el-tab-pane label="生产明细">
  28. <productionDetails :workOrderInfo="workOrderInfo"></productionDetails>
  29. </el-tab-pane>
  30. <el-tab-pane label="投料详情">
  31. <feedDetails :routeObj="routeObj" :curTaskObj="curTaskObj"></feedDetails>
  32. </el-tab-pane>
  33. <el-tab-pane label="报工详情">
  34. <jobDetails :routeObj="routeObj" :curTaskObj="curTaskObj" :newId="newId"></jobDetails>
  35. </el-tab-pane>
  36. </el-tabs>
  37. </div>
  38. </el-drawer>
  39. </div>
  40. </template>
  41. <script>
  42. import Info from './info.vue';
  43. import feedDetails from '@/views/produce/components/feeding/details.vue';
  44. import jobDetails from '@/views/produce/components/jobBooking/details.vue';
  45. import basicDetails from '../basicDetails.vue';
  46. import productionDetails from '../productionDetails.vue';
  47. import btnlist from '../btnlist.vue';
  48. import { getTaskInstanceList } from '@/api/produce/job';
  49. export default {
  50. components: {
  51. Info,
  52. feedDetails,
  53. jobDetails,
  54. basicDetails,
  55. btnlist,
  56. productionDetails
  57. },
  58. data() {
  59. return {
  60. drawer: false,
  61. isFullscreen: true,
  62. workOrderInfo: {},
  63. routeList: [],
  64. activeIndex: 0,
  65. desIndex: 0,
  66. curTaskObj: null,
  67. newId: '',
  68. routeObj: {
  69. id: null
  70. }
  71. };
  72. },
  73. methods: {
  74. operate() {
  75. console.log(2)
  76. },
  77. refresh() {
  78. console.log(1)
  79. this.getInfo()
  80. },
  81. handleClose() {
  82. this.activeIndex = 0;
  83. this.drawer = false;
  84. },
  85. handleFull() {
  86. this.isFullscreen = !this.isFullscreen;
  87. this.$forceUpdate();
  88. },
  89. open(row) {
  90. this.workOrderInfo = row;
  91. this.routeObj.id = this.workOrderInfo.id;
  92. this.getTaskFn();
  93. this.drawer = true;
  94. },
  95. getTaskFn() {
  96. getTaskInstanceList(this.workOrderInfo.id).then((res) => {
  97. this.routeList = res;
  98. // 使用findIndex方法查找
  99. const index = this.routeList.findIndex(
  100. (item) => Number(item.taskId) == Number(this.workOrderInfo.taskId)
  101. );
  102. this.desIndex = index;
  103. console.log(this.routeList, '888888');
  104. this.newId = this.routeList[this.desIndex].taskId || '';
  105. if (this.workOrderInfo.taskId != -2) {
  106. this.curTaskObj = JSON.parse(JSON.stringify(this.routeObj));
  107. } else {
  108. this.curTaskObj = JSON.parse(JSON.stringify(this.routeList[0]));
  109. this.desIndex = 0;
  110. }
  111. this.activeIndex = index;
  112. });
  113. },
  114. handIdx(index, item) {
  115. this.curTaskObj = JSON.parse(JSON.stringify(item));
  116. if (item.taskId == -2) {
  117. this.$message.info('完结状态不能点击');
  118. } else {
  119. this.desIndex = index;
  120. this.newId = this.routeList[this.desIndex].taskId || '';
  121. }
  122. }
  123. }
  124. };
  125. </script>
  126. <style lang="scss" scoped>
  127. /* 自定义全屏样式 */
  128. ::v-deep .is-fullscreen {
  129. width: 100vw !important;
  130. height: 100vh !important;
  131. overflow: hidden !important;
  132. /* 隐藏滚动条 */
  133. }
  134. ::v-deep .not-fullscreen {
  135. width: calc(100vw - 260px) !important;
  136. height: 100vh !important;
  137. overflow: hidden !important;
  138. /* 隐藏滚动条 */
  139. }
  140. .custom-drawer-header {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. padding: 4px 15px;
  145. background-color: #f5f7fa;
  146. /* 自定义背景色 */
  147. border-bottom: 1px solid #ebeef5;
  148. /* 自定义边框,与抽屉内容分隔 */
  149. }
  150. .drawer_content {
  151. margin: 10px 20px;
  152. box-sizing: border-box;
  153. }
  154. .drawer_content {
  155. margin: 10px 20px;
  156. box-sizing: border-box;
  157. }
  158. ::v-deep .active .is-text {
  159. background: #FFA929;
  160. /* 背景色 */
  161. border-color: #FFA929;
  162. color: #ffffff;
  163. /* 图标文字颜色 */
  164. }
  165. </style>