index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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 :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 detailList" :key="index" class="detail-list">
  65. <view class="name">{{item.name}}</view>
  66. <view class="list rx-bc" v-for="(it, idx) in item.list">
  67. <view class="title rx-sc">
  68. <image v-if="it.state == 1" class="icon" src="~@/static/pda/layers.svg"></image>
  69. <image v-if="it.state == 2" class="icon" src="~@/static/pda/check-square.svg"></image>
  70. <image v-if="it.state == 3" class="icon" src="~@/static/pda/target.svg"></image>
  71. {{it.title}}
  72. </view>
  73. <view class="rx-ec">
  74. {{it.num}}
  75. <image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
  76. </view>
  77. </view>
  78. </view>
  79. </u-list>
  80. </view>
  81. <view class="bottom-wrapper">
  82. <bottomOperate state='1' @operate='operate'></bottomOperate>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import bottomOperate from '../../components/bottomOperate.vue'
  88. import stepsNav from '../../components/stepsNav.vue'
  89. import { getTaskInstanceList, workorderInfo } from '@/api/pda/workOrder.js'
  90. export default {
  91. components: {
  92. bottomOperate,
  93. stepsNav
  94. },
  95. data() {
  96. return {
  97. title: '',
  98. tabType: 1,
  99. id: null,
  100. stepsList: [],
  101. info: {},
  102. taskId: null,
  103. detailList: [{
  104. name: '挤压成型',
  105. list: [{
  106. state: 1,
  107. title: '待投料数量',
  108. num: 333
  109. },
  110. {
  111. state: 2,
  112. title: '已报工数量',
  113. num: 666
  114. }
  115. ]
  116. },
  117. {
  118. name: '自然干燥',
  119. list: [{
  120. state: 3,
  121. title: '生产中数量',
  122. num: 555
  123. },
  124. {
  125. state: 2,
  126. title: '已报工数量',
  127. num: 666
  128. }
  129. ]
  130. }
  131. ]
  132. }
  133. },
  134. onLoad(options) {
  135. this.title = options.title
  136. this.id = options.id
  137. uni.showLoading({
  138. title: '加载中'
  139. });
  140. this.getSteps()
  141. this.getInfo()
  142. },
  143. methods: {
  144. scrolltolower() {},
  145. handTab(type) {
  146. if (type != this.tabType) {
  147. this.tabType = type
  148. }
  149. },
  150. getSteps() {
  151. getTaskInstanceList(this.id).then(res => {
  152. this.stepsList = res
  153. if(!this.title && this.stepsList.length) {
  154. this.title = this.stepsList[0].taskTypeName
  155. }
  156. })
  157. },
  158. getInfo() {
  159. workorderInfo(this.id).then(res => {
  160. this.info = res
  161. uni.hideLoading();
  162. }).catch(() => {
  163. uni.hideLoading();
  164. })
  165. },
  166. operate(type) {
  167. let url
  168. if(type == 'picking') {
  169. url = '/pages/pda/picking/details'
  170. let _arr = JSON.stringify([ this.info.id ])
  171. url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.info.taskId}`
  172. uni.navigateTo({
  173. url
  174. })
  175. }
  176. },
  177. }
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. .content-box {
  182. height: 100vh;
  183. overflow: hidden;
  184. display: flex;
  185. flex-direction: column;
  186. background-color: $page-bg;
  187. }
  188. .top-wrapper {
  189. background-color: #fff;
  190. display: flex;
  191. width: 750rpx;
  192. background: #fff;
  193. align-items: center;
  194. }
  195. .tab_box {
  196. width: 100%;
  197. height: 68rpx;
  198. .tab_item {
  199. height: 68rpx;
  200. line-height: 68rpx;
  201. padding: 0 20rpx;
  202. font-size: 32rpx;
  203. color: #979C9E;
  204. }
  205. .active {
  206. box-sizing: border-box;
  207. border-bottom: 6rpx solid $theme-color;
  208. color: $theme-color;
  209. }
  210. }
  211. .list_box {
  212. flex: 1;
  213. overflow: hidden;
  214. padding: 4rpx 0;
  215. .u-list {
  216. height: 100% !important;
  217. }
  218. .item_list {
  219. width: 100%;
  220. height: 80rpx;
  221. box-sizing: border-box;
  222. padding: 0 32rpx;
  223. font-size: 32rpx;
  224. color: #979C9E;
  225. font-weight: 400;
  226. border-bottom: 1rpx solid #E3E5E5;
  227. .lable {
  228. color: #090A0A;
  229. font-weight: 500;
  230. }
  231. }
  232. .detail-list {
  233. line-height: 80rpx;
  234. .name {
  235. color: #090A0A;
  236. font-size: 32rpx;
  237. font-weight: 600;
  238. padding: 0 32rpx;
  239. box-sizing: border-box;
  240. border-bottom: 1rpx solid #E3E5E5;
  241. }
  242. .list {
  243. padding: 0 32rpx;
  244. box-sizing: border-box;
  245. border-bottom: 1rpx solid #E3E5E5;
  246. .title {
  247. font-weight: 400;
  248. color: #090A0A;
  249. }
  250. .icon {
  251. width: 36rpx;
  252. height: 36rpx;
  253. margin-right: 8rpx;
  254. }
  255. .arrow_right2{
  256. width: 12rpx;
  257. height: 24rpx;
  258. margin-left: 8rpx;
  259. }
  260. }
  261. }
  262. }
  263. .bottom-wrapper {}
  264. </style>