drawer.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="采购需求详情"
  4. @clickLeft="back">
  5. </uni-nav-bar>
  6. <myCard :item="form" :columns="columns"></myCard>
  7. <!-- <u-sticky bgColor="#fff" :customNavHeight="88"> -->
  8. <u-tabs :list="list1" @change="change" :current="current"></u-tabs>
  9. <!-- </u-sticky> -->
  10. <info ref="infoRef" :isDrawer="true" v-show="current==0"></info>
  11. <produceList :pricingWay="form.pricingWay" ref="produceListRef" :isDrawer="true" v-show="current==1">
  12. </produceList>
  13. </view>
  14. </template>
  15. <script>
  16. import produceList from "../../components/produceList.vue"
  17. import info from "./info.vue"
  18. import {
  19. getDetail,
  20. } from '@/api/purchasingManage/purchaseNeedManage.js'
  21. import myCard from '../../components/myCard.vue'
  22. export default {
  23. components: {
  24. produceList,
  25. info,
  26. myCard
  27. },
  28. data() {
  29. return {
  30. columns: [
  31. [{
  32. label: '名称:',
  33. prop: 'requirementName',
  34. type: 'title',
  35. className: 'perce100',
  36. }],
  37. ],
  38. current: 0,
  39. list1: [{
  40. name: '基本信息',
  41. }, {
  42. name: '需求清单',
  43. }],
  44. form: {},
  45. }
  46. },
  47. onLoad(data) {
  48. getDetail(data.id).then(async res => {
  49. this.form = res
  50. setTimeout(() => {
  51. this.current = 0
  52. this.$nextTick(() => {
  53. this.$refs.infoRef.init(res)
  54. this.$refs.produceListRef.init(res.detailList)
  55. if (data.current) {
  56. this.current = +data.current
  57. }
  58. })
  59. }, 300)
  60. })
  61. },
  62. onUnload() {
  63. },
  64. methods: {
  65. change(data) {
  66. this.current = data.index
  67. },
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .item {
  73. padding: 16rpx 32rpx;
  74. .card {
  75. padding: 16rpx 32rpx;
  76. margin-top: 32rpx;
  77. display: flex;
  78. flex-wrap: wrap;
  79. // height: 80rpx;
  80. border-radius: 12rpx;
  81. border: 1px solid #cbcbcb;
  82. >view {
  83. font-size: 26rpx;
  84. width: 33%;
  85. .lable {
  86. color: #999;
  87. margin-bottom: 10rpx;
  88. }
  89. }
  90. }
  91. }
  92. </style>