index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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"
  7. @selectStep='selectStep'></stepsNav>
  8. <view class="tab_box rx-sc">
  9. <view class="tab_item" :class="{active: tabType == 1}" @click="handTab(1)">基本信息</view>
  10. <view class="tab_item" :class="{active: tabType == 2}" @click="handTab(2)">生产明细</view>
  11. <view class="tab_item" :class="{active: tabType == 3}" @click="handTab(3)">详情</view>
  12. </view>
  13. </view>
  14. <view class="list_box">
  15. <u-list @scrolltolower="scrolltolower" key="info" v-if="tabType == 1">
  16. <view class="item_list rx-bc">
  17. <text class="lable">生产工单号</text>
  18. <text>{{ info.code }}</text>
  19. </view>
  20. <view class="item_list rx-bc">
  21. <text class="lable">计划编号</text>
  22. <text>{{ info.productionPlanCode }}</text>
  23. </view>
  24. <view class="item_list rx-bc">
  25. <text class="lable">工艺路线版本</text>
  26. <text>{{ info.routingVersion }}</text>
  27. </view>
  28. <view class="item_list rx-bc">
  29. <text class="lable">产品编码</text>
  30. <text> {{ info.productCode }}</text>
  31. </view>
  32. <view class="item_list rx-bc">
  33. <text class="lable">产品名称</text>
  34. <text>{{ info.productName }}</text>
  35. </view>
  36. <view class="item_list rx-bc">
  37. <text class="lable">牌号</text>
  38. <text>{{ info.brandNo }}</text>
  39. </view>
  40. <view class="item_list rx-bc">
  41. <text class="lable">型号</text>
  42. <text>{{info.model}}</text>
  43. </view>
  44. <view class="item_list rx-bc">
  45. <text class="lable">要求成型数量</text>
  46. <text>{{info.formingNum }} {{info.weightUnit}} </text>
  47. </view>
  48. <view class="item_list rx-bc">
  49. <text class="lable">要求成型重量</text>
  50. <text>{{ info.formingWeight }} {{info.weightUnit}}</text>
  51. </view>
  52. <view class="item_list rx-bc">
  53. <text class="lable">已完成生产数量</text>
  54. <text></text>
  55. </view>
  56. <view class="item_list rx-bc">
  57. <text class="lable">已完成生产重量</text>
  58. <text></text>
  59. </view>
  60. <view class="item_list rx-bc">
  61. <text class="lable">计划开始时间</text>
  62. <text>{{ info.planStartTime }}</text>
  63. </view>
  64. </u-list>
  65. <u-list @scrolltolower="scrolltolower" key="detail" v-if="tabType == 2">
  66. <view v-for="(item,index) in produceList" :key="index" class="detail-list">
  67. <view class="name">{{item.taskName}}</view>
  68. <view class="list rx-bc">
  69. <view class="title rx-sc">
  70. <image class="icon" src="~@/static/pda/layers.svg"></image>
  71. 待投料数量
  72. </view>
  73. <view class="rx-ec">
  74. {{item.waitFeedNum}}
  75. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  76. </view>
  77. </view>
  78. <view class="list rx-bc">
  79. <view class="title rx-sc">
  80. <image class="icon" src="~@/static/pda/check-square.svg"></image>
  81. 生产中数量
  82. </view>
  83. <view class="rx-ec">
  84. 0
  85. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  86. </view>
  87. </view>
  88. <view class="list rx-bc">
  89. <view class="title rx-sc">
  90. <image class="icon" src="~@/static/pda/target.svg"></image>
  91. 待投料数量
  92. </view>
  93. <view class="rx-ec">
  94. {{item.waitFeedNum}}
  95. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  96. </view>
  97. </view>
  98. </view>
  99. </u-list>
  100. <u-list @scrolltolower="scrolltolower" key="btnDeatils" v-if="tabType == 3">
  101. <view style="margin-top: 15px;">
  102. <button class="search_btn" @click="handleDetails">报工详情</button>
  103. </view>
  104. </u-list>
  105. </view>
  106. <view class="bottom-wrapper">
  107. <bottomOperate state='1' @operate='operate'></bottomOperate>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import bottomOperate from '../../components/bottomOperate.vue'
  113. import stepsNav from '../../components/stepsNav.vue'
  114. import {
  115. getTaskInstanceList,
  116. workorderInfo,
  117. produceDetail,
  118. checkStatus
  119. } from '@/api/pda/workOrder.js'
  120. import {
  121. noop
  122. } from 'lodash'
  123. export default {
  124. components: {
  125. bottomOperate,
  126. stepsNav
  127. },
  128. data() {
  129. return {
  130. title: '',
  131. tabType: 1,
  132. id: null,
  133. stepsList: [],
  134. info: {},
  135. taskId: null,
  136. produceList: [],
  137. feedAllow: true,
  138. currentTaskId: null,
  139. currentTaskName: null,
  140. }
  141. },
  142. onLoad(options) {
  143. this.title = options.title
  144. this.id = options.id
  145. uni.showLoading({
  146. title: '加载中'
  147. });
  148. },
  149. onShow() {
  150. this.getSteps()
  151. this.getInfo()
  152. this.produce()
  153. },
  154. methods: {
  155. scrolltolower() {},
  156. handTab(type) {
  157. if (type != this.tabType) {
  158. this.tabType = type
  159. }
  160. },
  161. getSteps() {
  162. getTaskInstanceList(this.id).then(res => {
  163. // for(let i = 0; i < res.length; i++) {
  164. // if(res[i].taskTypeName == '自然干燥' ||res[i].taskTypeName == '升温干燥') {
  165. // res[i - 1].btns = [ { name: '更换周转车', type: 'turnover'}]
  166. // }
  167. // }
  168. this.stepsList = res
  169. })
  170. },
  171. getInfo() {
  172. workorderInfo(this.id).then(res => {
  173. this.info = res
  174. this.taskId = res.taskId
  175. this.feedStatus()
  176. uni.hideLoading();
  177. }).catch(() => {
  178. uni.hideLoading();
  179. })
  180. },
  181. feedStatus() {
  182. let taskId = this.currentTaskId || this.taskId
  183. checkStatus(this.id, taskId).then(res => {
  184. this.feedAllow = res
  185. })
  186. },
  187. selectStep(item) {
  188. this.currentTaskId = item.taskId
  189. this.currentTaskName = item.taskTypeName
  190. this.feedStatus()
  191. },
  192. operate(type) {
  193. let url
  194. let taskId = this.currentTaskId || this.taskId
  195. let taskName = this.currentTaskName || this.info.taskName
  196. if (type == 'picking') {
  197. url = '/pages/pda/picking/details'
  198. let _arr = JSON.stringify([this.info.id])
  199. url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId}`
  200. uni.navigateTo({
  201. url
  202. })
  203. } else if (type == 'feeding') {
  204. if (this.feedAllow) {
  205. url = '/pages/pda/feeding/details'
  206. let _arr = JSON.stringify([this.info.id])
  207. url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId }&taskName=${taskName}`
  208. uni.navigateTo({
  209. url
  210. })
  211. } else {
  212. uni.showToast({
  213. title: "已投料,请先报工",
  214. icon: "none",
  215. })
  216. }
  217. } else if (type == 'jobBooking') {
  218. if (!this.feedAllow) {
  219. url = '/pages/pda/jobBooking/index/index'
  220. url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
  221. uni.navigateTo({
  222. url
  223. })
  224. } else {
  225. uni.showToast({
  226. title: "请先投料",
  227. icon: "none",
  228. })
  229. }
  230. } else if (type == 'turnover') {
  231. url = '/pages/pda/turnover/index/index'
  232. url += `?workOrderId=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
  233. uni.navigateTo({
  234. url
  235. })
  236. }
  237. },
  238. produce() {
  239. produceDetail(this.id).then(res => {
  240. this.produceList = res.produceDetail
  241. })
  242. },
  243. handleDetails() {
  244. let taskId = this.currentTaskId || this.taskId
  245. let taskName = this.currentTaskName || this.info.taskName
  246. let url = '/pages/pda/workOrder/index/details'
  247. url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
  248. uni.navigateTo({
  249. url
  250. })
  251. },
  252. }
  253. }
  254. </script>
  255. <style lang="scss" scoped>
  256. .content-box {
  257. height: 100vh;
  258. overflow: hidden;
  259. display: flex;
  260. flex-direction: column;
  261. background-color: $page-bg;
  262. }
  263. .top-wrapper {
  264. background-color: #fff;
  265. display: flex;
  266. width: 750rpx;
  267. background: #fff;
  268. align-items: center;
  269. }
  270. .tab_box {
  271. width: 100%;
  272. height: 68rpx;
  273. .tab_item {
  274. height: 68rpx;
  275. line-height: 68rpx;
  276. padding: 0 20rpx;
  277. font-size: 32rpx;
  278. color: #979C9E;
  279. }
  280. .active {
  281. box-sizing: border-box;
  282. border-bottom: 6rpx solid $theme-color;
  283. color: $theme-color;
  284. }
  285. }
  286. .list_box {
  287. flex: 1;
  288. overflow: hidden;
  289. padding: 4rpx 0;
  290. .u-list {
  291. height: 100% !important;
  292. }
  293. .item_list {
  294. width: 100%;
  295. height: 80rpx;
  296. box-sizing: border-box;
  297. padding: 0 32rpx;
  298. font-size: 32rpx;
  299. color: #979C9E;
  300. font-weight: 400;
  301. border-bottom: 1rpx solid #E3E5E5;
  302. .lable {
  303. color: #090A0A;
  304. font-weight: 500;
  305. }
  306. }
  307. .detail-list {
  308. line-height: 80rpx;
  309. .name {
  310. color: #090A0A;
  311. font-size: 32rpx;
  312. font-weight: 600;
  313. padding: 0 32rpx;
  314. box-sizing: border-box;
  315. border-bottom: 1rpx solid #E3E5E5;
  316. }
  317. .list {
  318. padding: 0 32rpx;
  319. box-sizing: border-box;
  320. border-bottom: 1rpx solid #E3E5E5;
  321. .title {
  322. font-weight: 400;
  323. color: #090A0A;
  324. }
  325. .icon {
  326. width: 36rpx;
  327. height: 36rpx;
  328. margin-right: 8rpx;
  329. }
  330. .arrow_right2 {
  331. width: 12rpx;
  332. height: 24rpx;
  333. margin-left: 8rpx;
  334. }
  335. }
  336. }
  337. }
  338. .bottom-wrapper {}
  339. .search_btn {
  340. width: 240rpx;
  341. height: 70rpx;
  342. line-height: 70rpx;
  343. padding: 0 24rpx;
  344. background: $theme-color;
  345. font-size: 32rpx;
  346. color: #fff;
  347. margin: 0;
  348. margin-left: 26rpx;
  349. }
  350. </style>