index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#157A2C"
  4. color="#fff" @clickLeft="back"></uni-nav-bar>
  5. <view class="top-wrapper cx">
  6. <stepsNav v-if='info.taskId && stepsList.length' :stepsList="stepsList" :taskId="info.taskId"></stepsNav>
  7. <view class="tab_box rx-sc">
  8. <view class="tab_item" :class="{active: tabType == 1}" @click="handTab(1)">基本信息</view>
  9. <view class="tab_item" :class="{active: tabType == 2}" @click="handTab(2)">生产明细</view>
  10. </view>
  11. </view>
  12. <view class="list_box">
  13. <u-list @scrolltolower="scrolltolower" key="info" v-if="tabType == 1">
  14. <view class="item_list rx-bc">
  15. <text class="lable">生产工单号</text>
  16. <text>{{ info.code }}</text>
  17. </view>
  18. <view class="item_list rx-bc">
  19. <text class="lable">计划编号</text>
  20. <text>{{ info.productionPlanCode }}</text>
  21. </view>
  22. <view class="item_list rx-bc">
  23. <text class="lable">工艺路线版本</text>
  24. <text>{{ info.routingVersion }}</text>
  25. </view>
  26. <view class="item_list rx-bc">
  27. <text class="lable">产品编码</text>
  28. <text> {{ info.productCode }}</text>
  29. </view>
  30. <view class="item_list rx-bc">
  31. <text class="lable">产品名称</text>
  32. <text>{{ info.productName }}</text>
  33. </view>
  34. <view class="item_list rx-bc">
  35. <text class="lable">牌号</text>
  36. <text>{{ info.brandNo }}</text>
  37. </view>
  38. <view class="item_list rx-bc">
  39. <text class="lable">型号</text>
  40. <text>{{info.model}}</text>
  41. </view>
  42. <view class="item_list rx-bc">
  43. <text class="lable">要求成型数量</text>
  44. <text>{{info.formingNum }} </text>
  45. </view>
  46. <view class="item_list rx-bc">
  47. <text class="lable">要求成型重量</text>
  48. <text>{{ info.formingWeight }} KG</text>
  49. </view>
  50. <view class="item_list rx-bc">
  51. <text class="lable">已完成生产数量</text>
  52. <text></text>
  53. </view>
  54. <view class="item_list rx-bc">
  55. <text class="lable">已完成生产重量</text>
  56. <text></text>
  57. </view>
  58. <view class="item_list rx-bc">
  59. <text class="lable">计划开始时间</text>
  60. <text>{{ info.planStartTime }}</text>
  61. </view>
  62. </u-list>
  63. <u-list @scrolltolower="scrolltolower" key="detail" v-if="tabType == 2">
  64. <view v-for="(item,index) in produceList" :key="index" class="detail-list">
  65. <view class="name">{{item.taskName}}</view>
  66. <view class="list rx-bc" >
  67. <view class="title rx-sc">
  68. <image class="icon" src="~@/static/pda/layers.svg"></image>
  69. 待投料数量
  70. </view>
  71. <view class="rx-ec">
  72. {{item.waitFeedNum}}
  73. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  74. </view>
  75. </view>
  76. <view class="list rx-bc" >
  77. <view class="title rx-sc">
  78. <image class="icon" src="~@/static/pda/check-square.svg"></image>
  79. 生产中数量
  80. </view>
  81. <view class="rx-ec">
  82. 0
  83. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  84. </view>
  85. </view>
  86. <view class="list rx-bc" >
  87. <view class="title rx-sc">
  88. <image class="icon" src="~@/static/pda/target.svg"></image>
  89. 待投料数量
  90. </view>
  91. <view class="rx-ec">
  92. {{item.waitFeedNum}}
  93. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  94. </view>
  95. </view>
  96. </view>
  97. </u-list>
  98. </view>
  99. <view class="bottom-wrapper">
  100. <bottomOperate state='1' @operate='operate'></bottomOperate>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import bottomOperate from '../../components/bottomOperate.vue'
  106. import stepsNav from '../../components/stepsNav.vue'
  107. import { getTaskInstanceList, workorderInfo, produceDetail } from '@/api/pda/workOrder.js'
  108. export default {
  109. components: {
  110. bottomOperate,
  111. stepsNav
  112. },
  113. data() {
  114. return {
  115. title: '',
  116. tabType: 1,
  117. id: null,
  118. stepsList: [],
  119. info: {},
  120. taskId: null,
  121. produceList: [],
  122. }
  123. },
  124. onLoad(options) {
  125. this.title = options.title
  126. this.id = options.id
  127. uni.showLoading({
  128. title: '加载中'
  129. });
  130. },
  131. onShow() {
  132. this.getSteps()
  133. this.getInfo()
  134. this.produce()
  135. },
  136. methods: {
  137. scrolltolower() {},
  138. handTab(type) {
  139. if (type != this.tabType) {
  140. this.tabType = type
  141. }
  142. },
  143. getSteps() {
  144. getTaskInstanceList(this.id).then(res => {
  145. this.stepsList = res
  146. })
  147. },
  148. getInfo() {
  149. workorderInfo(this.id).then(res => {
  150. this.info = res
  151. uni.hideLoading();
  152. }).catch(() => {
  153. uni.hideLoading();
  154. })
  155. },
  156. operate(type) {
  157. let url
  158. if(type == 'picking') {
  159. url = '/pages/pda/picking/details'
  160. let _arr = JSON.stringify([ this.info.id ])
  161. url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.info.taskId}`
  162. uni.navigateTo({
  163. url
  164. })
  165. } else if(type == 'feeding') {
  166. url = '/pages/pda/feeding/details'
  167. let _arr = JSON.stringify([ this.info.id ])
  168. url += `?arr=${encodeURIComponent(_arr)}&taskName=${this.info.taskName}`
  169. uni.navigateTo({
  170. url
  171. })
  172. }
  173. },
  174. produce() {
  175. produceDetail(this.id).then(res => {
  176. this.produceList = res.produceDetail
  177. })
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. .content-box {
  184. height: 100vh;
  185. overflow: hidden;
  186. display: flex;
  187. flex-direction: column;
  188. background-color: $page-bg;
  189. }
  190. .top-wrapper {
  191. background-color: #fff;
  192. display: flex;
  193. width: 750rpx;
  194. background: #fff;
  195. align-items: center;
  196. }
  197. .tab_box {
  198. width: 100%;
  199. height: 68rpx;
  200. .tab_item {
  201. height: 68rpx;
  202. line-height: 68rpx;
  203. padding: 0 20rpx;
  204. font-size: 32rpx;
  205. color: #979C9E;
  206. }
  207. .active {
  208. box-sizing: border-box;
  209. border-bottom: 6rpx solid $theme-color;
  210. color: $theme-color;
  211. }
  212. }
  213. .list_box {
  214. flex: 1;
  215. overflow: hidden;
  216. padding: 4rpx 0;
  217. .u-list {
  218. height: 100% !important;
  219. }
  220. .item_list {
  221. width: 100%;
  222. height: 80rpx;
  223. box-sizing: border-box;
  224. padding: 0 32rpx;
  225. font-size: 32rpx;
  226. color: #979C9E;
  227. font-weight: 400;
  228. border-bottom: 1rpx solid #E3E5E5;
  229. .lable {
  230. color: #090A0A;
  231. font-weight: 500;
  232. }
  233. }
  234. .detail-list {
  235. line-height: 80rpx;
  236. .name {
  237. color: #090A0A;
  238. font-size: 32rpx;
  239. font-weight: 600;
  240. padding: 0 32rpx;
  241. box-sizing: border-box;
  242. border-bottom: 1rpx solid #E3E5E5;
  243. }
  244. .list {
  245. padding: 0 32rpx;
  246. box-sizing: border-box;
  247. border-bottom: 1rpx solid #E3E5E5;
  248. .title {
  249. font-weight: 400;
  250. color: #090A0A;
  251. }
  252. .icon {
  253. width: 36rpx;
  254. height: 36rpx;
  255. margin-right: 8rpx;
  256. }
  257. .arrow_right2{
  258. width: 12rpx;
  259. height: 24rpx;
  260. margin-left: 8rpx;
  261. }
  262. }
  263. }
  264. }
  265. .bottom-wrapper {}
  266. </style>