index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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" @selectStep='selectStep'></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 {
  108. getTaskInstanceList,
  109. workorderInfo,
  110. produceDetail,
  111. checkStatus
  112. } from '@/api/pda/workOrder.js'
  113. import {
  114. noop
  115. } from 'lodash'
  116. export default {
  117. components: {
  118. bottomOperate,
  119. stepsNav
  120. },
  121. data() {
  122. return {
  123. title: '',
  124. tabType: 1,
  125. id: null,
  126. stepsList: [],
  127. info: {},
  128. taskId: null,
  129. produceList: [],
  130. feedAllow: true,
  131. currentTaskId: null,
  132. currentTaskName: null,
  133. }
  134. },
  135. onLoad(options) {
  136. this.title = options.title
  137. this.id = options.id
  138. uni.showLoading({
  139. title: '加载中'
  140. });
  141. },
  142. onShow() {
  143. this.getSteps()
  144. this.getInfo()
  145. this.produce()
  146. },
  147. methods: {
  148. scrolltolower() {},
  149. handTab(type) {
  150. if (type != this.tabType) {
  151. this.tabType = type
  152. }
  153. },
  154. getSteps() {
  155. getTaskInstanceList(this.id).then(res => {
  156. // for(let i = 0; i < res.length; i++) {
  157. // if(res[i].taskTypeName == '自然干燥' ||res[i].taskTypeName == '升温干燥') {
  158. // res[i - 1].btns = [ { name: '更换周转车', type: 'turnover'}]
  159. // }
  160. // }
  161. this.stepsList = res
  162. })
  163. },
  164. getInfo() {
  165. workorderInfo(this.id).then(res => {
  166. this.info = res
  167. this.taskId = res.taskId
  168. this.feedStatus()
  169. uni.hideLoading();
  170. }).catch(() => {
  171. uni.hideLoading();
  172. })
  173. },
  174. feedStatus() {
  175. let taskId = this.currentTaskId || this.taskId
  176. checkStatus(this.id, taskId).then(res => {
  177. this.feedAllow = res
  178. })
  179. },
  180. selectStep(item) {
  181. this.currentTaskId = item.taskId
  182. this.currentTaskName = item.taskTypeName
  183. this.feedStatus()
  184. },
  185. operate(type) {
  186. let url
  187. let taskId = this.currentTaskId || this.taskId
  188. let taskName = this.currentTaskName || this.info.taskName
  189. if (type == 'picking') {
  190. url = '/pages/pda/picking/details'
  191. let _arr = JSON.stringify([this.info.id])
  192. url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId}`
  193. uni.navigateTo({
  194. url
  195. })
  196. } else if (type == 'feeding') {
  197. if (this.feedAllow) {
  198. url = '/pages/pda/feeding/details'
  199. let _arr = JSON.stringify([this.info.id])
  200. url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId }&taskName=${taskName}`
  201. uni.navigateTo({
  202. url
  203. })
  204. } else {
  205. uni.showToast({
  206. title: "已投料,请先报工",
  207. icon: "none",
  208. })
  209. }
  210. } else if (type == 'jobBooking') {
  211. if (!this.feedAllow) {
  212. url = '/pages/pda/jobBooking/index/index'
  213. url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
  214. uni.navigateTo({
  215. url
  216. })
  217. } else {
  218. uni.showToast({
  219. title: "请先投料",
  220. icon: "none",
  221. })
  222. }
  223. } else if (type == 'turnover') {
  224. url = '/pages/pda/turnover/index/index'
  225. url += `?workOrderId=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
  226. uni.navigateTo({
  227. url
  228. })
  229. }
  230. },
  231. produce() {
  232. produceDetail(this.id).then(res => {
  233. this.produceList = res.produceDetail
  234. })
  235. },
  236. }
  237. }
  238. </script>
  239. <style lang="scss" scoped>
  240. .content-box {
  241. height: 100vh;
  242. overflow: hidden;
  243. display: flex;
  244. flex-direction: column;
  245. background-color: $page-bg;
  246. }
  247. .top-wrapper {
  248. background-color: #fff;
  249. display: flex;
  250. width: 750rpx;
  251. background: #fff;
  252. align-items: center;
  253. }
  254. .tab_box {
  255. width: 100%;
  256. height: 68rpx;
  257. .tab_item {
  258. height: 68rpx;
  259. line-height: 68rpx;
  260. padding: 0 20rpx;
  261. font-size: 32rpx;
  262. color: #979C9E;
  263. }
  264. .active {
  265. box-sizing: border-box;
  266. border-bottom: 6rpx solid $theme-color;
  267. color: $theme-color;
  268. }
  269. }
  270. .list_box {
  271. flex: 1;
  272. overflow: hidden;
  273. padding: 4rpx 0;
  274. .u-list {
  275. height: 100% !important;
  276. }
  277. .item_list {
  278. width: 100%;
  279. height: 80rpx;
  280. box-sizing: border-box;
  281. padding: 0 32rpx;
  282. font-size: 32rpx;
  283. color: #979C9E;
  284. font-weight: 400;
  285. border-bottom: 1rpx solid #E3E5E5;
  286. .lable {
  287. color: #090A0A;
  288. font-weight: 500;
  289. }
  290. }
  291. .detail-list {
  292. line-height: 80rpx;
  293. .name {
  294. color: #090A0A;
  295. font-size: 32rpx;
  296. font-weight: 600;
  297. padding: 0 32rpx;
  298. box-sizing: border-box;
  299. border-bottom: 1rpx solid #E3E5E5;
  300. }
  301. .list {
  302. padding: 0 32rpx;
  303. box-sizing: border-box;
  304. border-bottom: 1rpx solid #E3E5E5;
  305. .title {
  306. font-weight: 400;
  307. color: #090A0A;
  308. }
  309. .icon {
  310. width: 36rpx;
  311. height: 36rpx;
  312. margin-right: 8rpx;
  313. }
  314. .arrow_right2 {
  315. width: 12rpx;
  316. height: 24rpx;
  317. margin-left: 8rpx;
  318. }
  319. }
  320. }
  321. }
  322. .bottom-wrapper {}
  323. </style>