record.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <template>
  2. <view class="content">
  3. <scroll-view scroll-x="true" class="class-box flex b-t" :scroll-with-animation="true">
  4. <view class="navbar">
  5. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  6. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  7. </view>
  8. </scroll-view>
  9. <swiper :style="{ height: maxheight }" :current="tabCurrentIndex" class="swiper-box" duration="300"
  10. @change="changeTab">
  11. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  12. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  13. <!-- 空白页 -->
  14. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  15. <!-- 订单列表 -->
  16. <view class="title">
  17. <view class="title-item flex">
  18. <view class="title-font">
  19. 提交人:
  20. </view>
  21. <view class="title-font">
  22. 全包员工
  23. </view>
  24. </view>
  25. <view class="xian">
  26. </view>
  27. <view class="title-item flex">
  28. <view class="title-font">
  29. 当前检验阶段:
  30. </view>
  31. <view class="title-font">
  32. 下料
  33. </view>
  34. </view>
  35. </view>
  36. <view v-for="(item,index) in tabItem.orderList">
  37. <view class="main" v-if="tabCurrentIndex == 0">
  38. <view class="main-top">
  39. <image class="main-icon" src="../../static/icon/order.png" mode=""></image>
  40. <view class="main-font">
  41. {{item.name}}
  42. </view>
  43. </view>
  44. <view class="xian"></view>
  45. <view class="main-bottom flex">
  46. <view class="num">
  47. 总数量:
  48. </view>
  49. <view class="main-input red">
  50. 363
  51. </view>
  52. </view>
  53. <view class="xian"></view>
  54. <view class="main-bottom flex">
  55. <view class="num">
  56. 合格数量:
  57. </view>
  58. <view class="main-input red">
  59. {{item.number}}
  60. </view>
  61. </view>
  62. <view class="xian"></view>
  63. <view class="main-bottom flex">
  64. <view class="num">
  65. 品质评级:
  66. </view>
  67. <view class="main-input">
  68. {{item.pj}}
  69. </view>
  70. </view>
  71. </view>
  72. <view class="main" v-if="tabCurrentIndex == 1">
  73. <view class="main-top">
  74. <image class="main-icon" src="../../static/icon/order.png" mode=""></image>
  75. <view class="main-font">
  76. {{item.name}}
  77. </view>
  78. </view>
  79. <view class="main-bottom flex">
  80. <view class="num">
  81. 合格/不合格:
  82. </view>
  83. <view class="main-input">
  84. 不合格
  85. </view>
  86. </view>
  87. <view class="xian"></view>
  88. <view class="main-bottom flex">
  89. <view class="num">
  90. 总数量:
  91. </view>
  92. <view class="main-input red">
  93. 363
  94. </view>
  95. </view>
  96. <view class="xian"></view>
  97. <view class="main-bottom flex">
  98. <view class="num">
  99. 不合格数量:
  100. </view>
  101. <view class="main-input red">
  102. {{item.number}}
  103. </view>
  104. </view>
  105. <view class="xian"></view>
  106. <view class="main-bottom">
  107. <view class="num">
  108. 图片:
  109. </view>
  110. <view class="banner-box">
  111. <view class="banner" v-for="(imgitem,imgindex) in item.images" :key="index">
  112. <view class="banner-main">
  113. <image :src="imgitem" mode=""></image>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="main" v-if="tabCurrentIndex == 2">
  120. <view class="main-top">
  121. <image class="main-icon" src="../../static/icon/order.png" mode=""></image>
  122. <view class="main-font">
  123. {{item.name}}
  124. </view>
  125. </view>
  126. <view class="main-bottom flex">
  127. <view class="num">
  128. 总数量:
  129. </view>
  130. <view class="main-input red">
  131. 363
  132. </view>
  133. </view>
  134. <view class="xian"></view>
  135. <view class="main-bottom flex">
  136. <view class="num">
  137. 缺漏数量:
  138. </view>
  139. <view class="main-input red">
  140. {{item.number}}
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  146. </scroll-view>
  147. </swiper-item>
  148. </swiper>
  149. </view>
  150. </template>
  151. <script>
  152. export default {
  153. data() {
  154. return {
  155. maxheight: '',
  156. tabCurrentIndex: 0,
  157. navList: [{
  158. state: 0,
  159. text: '合格记录',
  160. loadingType: 'more',
  161. orderList: [{
  162. name: '规格1(黄色,37码)',
  163. number: 10,
  164. pj: '优',
  165. images: []
  166. }, {
  167. name: '规格2(黄色,37码)',
  168. number: 10,
  169. pj: '及',
  170. images: []
  171. }, {
  172. name: '规格3(黄色,37码)',
  173. number: 10,
  174. pj: '良',
  175. images: []
  176. }, {
  177. name: '规格4(黄色,37码)',
  178. number: 10,
  179. pj: '不及',
  180. images: []
  181. }, {
  182. name: '规格5(黄色,37码)',
  183. number: 10,
  184. pj: '优',
  185. images: []
  186. }, {
  187. name: '规格6(黄色,37码)',
  188. number: 10,
  189. pj: '优',
  190. images: []
  191. }, {
  192. name: '规格7(黄色,37码)',
  193. number: 10,
  194. pj: '及',
  195. images: []
  196. }, {
  197. name: '规格8(黄色,37码)',
  198. number: 10,
  199. pj: '及',
  200. images: []
  201. }],
  202. page: 1, //当前页数
  203. limit: 10 //每次信息条数
  204. },
  205. {
  206. state: 1,
  207. text: '不合格记录',
  208. loadingType: 'more',
  209. orderList: [{
  210. name: '规格1(黄色,37码)',
  211. number: 20,
  212. images: []
  213. }, {
  214. name: '规格2(黄色,37码)',
  215. number: 20,
  216. images: []
  217. }, {
  218. name: '规格3(黄色,37码)',
  219. number: 20,
  220. images: []
  221. }, {
  222. name: '规格4(黄色,37码)',
  223. number: 20,
  224. images: []
  225. }, {
  226. name: '规格5(黄色,37码)',
  227. number: 20,
  228. images: []
  229. }, {
  230. name: '规格6(黄色,37码)',
  231. number: 20,
  232. images: []
  233. }, {
  234. name: '规格7(黄色,37码)',
  235. number: 20,
  236. images: []
  237. }, {
  238. name: '规格8(黄色,37码)',
  239. number: 20,
  240. images: []
  241. }],
  242. page: 1, //当前页数
  243. limit: 10 //每次信息条数
  244. },
  245. {
  246. state: 2,
  247. text: '缺漏',
  248. loadingType: 'more',
  249. orderList: [{
  250. name: '规格1(黄色,37码)',
  251. number: 28,
  252. images: []
  253. }, {
  254. name: '规格2(黄色,37码)',
  255. number: 28,
  256. images: []
  257. }, {
  258. name: '规格3(黄色,37码)',
  259. number: 28,
  260. images: []
  261. }, {
  262. name: '规格4(黄色,37码)',
  263. number: 28,
  264. images: []
  265. }, {
  266. name: '规格5(黄色,37码)',
  267. number: 28,
  268. images: []
  269. }, {
  270. name: '规格6(黄色,37码)',
  271. number: 28,
  272. images: []
  273. }, {
  274. name: '规格7(黄色,37码)',
  275. number: 28,
  276. images: []
  277. }, {
  278. name: '规格8(黄色,37码)',
  279. number: 28,
  280. images: []
  281. }],
  282. page: 1, //当前页数
  283. limit: 10 //每次信息条数
  284. },
  285. ],
  286. };
  287. },
  288. onLoad() {},
  289. onShow() {},
  290. onReachBottom() {},
  291. onReady(res) {
  292. var _this = this;
  293. uni.getSystemInfo({
  294. success: resu => {
  295. const query = uni.createSelectorQuery();
  296. query.select('.swiper-box').boundingClientRect();
  297. query.exec(function(res) {
  298. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  299. console.log('打印页面的剩余高度', _this.maxheight);
  300. });
  301. },
  302. fail: res => {}
  303. });
  304. },
  305. methods: {
  306. tabClick(index) {
  307. this.tabCurrentIndex = index;
  308. },
  309. changeTab(e) {
  310. this.tabCurrentIndex = e.target.current;
  311. // this.loadData('tabChange');
  312. },
  313. loadData() {
  314. }
  315. }
  316. };
  317. </script>
  318. <style lang="scss">
  319. page,
  320. .content {
  321. min-height: 100%;
  322. height: auto;
  323. }
  324. .navbar {
  325. display: flex;
  326. height: 40px;
  327. padding: 0 5px;
  328. background: #fff;
  329. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  330. position: relative;
  331. z-index: 10;
  332. .nav-item {
  333. background: #fff;
  334. display: flex;
  335. justify-content: center;
  336. align-items: center;
  337. width: 33%;
  338. flex-shrink: 0;
  339. height: 100%;
  340. font-size: 15px;
  341. color: #9c9c9c;
  342. position: relative;
  343. &.current {
  344. color: #333333;
  345. &:after {
  346. content: '';
  347. position: absolute;
  348. left: 50%;
  349. bottom: 0;
  350. transform: translateX(-50%);
  351. width: 44px;
  352. height: 0;
  353. border-bottom: 2px solid #ff4c4c;
  354. }
  355. }
  356. }
  357. }
  358. .list-scroll-content {
  359. height: 100%;
  360. }
  361. .title {
  362. width: 700rpx;
  363. background: #FFFFFF;
  364. border: 2px solid #EAECED;
  365. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  366. border-radius: 20rpx;
  367. margin: 20rpx auto 0;
  368. padding: 0 24rpx;
  369. .title-item {
  370. padding: 24rpx 6rpx;
  371. .title-font {
  372. font-size: 32rpx;
  373. font-family: PingFang SC;
  374. font-weight: bold;
  375. color: #323333;
  376. }
  377. }
  378. }
  379. .main {
  380. margin: 20rpx auto 0;
  381. padding: 0 20rpx;
  382. width: 700rpx;
  383. background: #FFFFFF;
  384. border: 2px solid #EAECED;
  385. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  386. border-radius: 20rpx;
  387. .main-top {
  388. display: flex;
  389. align-items: center;
  390. padding: 16rpx 0;
  391. border-bottom: 1px solid #EAECED;
  392. .main-icon {
  393. width: 32rpx;
  394. height: 37rpx;
  395. }
  396. .main-font {
  397. margin-left: 10rpx;
  398. font-size: 30rpx;
  399. font-family: PingFang SC;
  400. font-weight: bold;
  401. color: #333333;
  402. }
  403. }
  404. .main-bottom {
  405. padding: 20rpx 0;
  406. .num {
  407. font-size: 28rpx;
  408. font-family: PingFang SC;
  409. font-weight: 500;
  410. color: #666666;
  411. }
  412. .main-input {
  413. text-align: right;
  414. font-size: 28rpx;
  415. font-family: PingFang SC;
  416. font-weight: 500;
  417. color: #999999;
  418. }
  419. .red {
  420. color: #FF4C4C;
  421. }
  422. }
  423. }
  424. .banner-box {
  425. background: #ffffff;
  426. padding: 20rpx;
  427. display: flex;
  428. align-items: center;
  429. flex-wrap: wrap;
  430. image {
  431. width: 100%;
  432. height: 100%;
  433. }
  434. .banner {
  435. position: relative;
  436. width: 110rpx;
  437. height: 110rpx;
  438. margin-right: 10rpx;
  439. .banner-main {
  440. position: absolute;
  441. top: 0;
  442. left: 0;
  443. right: 0;
  444. width: 160rpx;
  445. height: 160rpx;
  446. border-radius: 20rpx;
  447. image {
  448. border-radius: 20rpx;
  449. }
  450. }
  451. .cha {
  452. position: absolute;
  453. top: 0;
  454. right: 0;
  455. width: 40rpx;
  456. height: 40rpx;
  457. }
  458. }
  459. }
  460. </style>