planDetail.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="kp-details">
  3. <!-- 考评项 -->
  4. <view class="kp-tabsBox">
  5. <view class="kp-tabs">
  6. <view
  7. v-for="(item,index) in list"
  8. :key="item.id"
  9. @click="onTab(index)"
  10. :class="activeIndx==index?'active':''">
  11. <view>{{item.name}}</view>
  12. <view>({{item.assessTargetNum}}项)</view>
  13. </view>
  14. </view>
  15. <view class="kp-items">
  16. <view v-for="(item,index) in list[activeIndx].assessTargetList" :key="item.id">
  17. {{item.name}}
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 选择按钮 -->
  22. <view class="kp-ok" @click="kpOk">
  23. 确认选择该考评方案
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {queryItemBySchemeId} from '@/api/assess'
  29. export default {
  30. data() {
  31. return {
  32. list: [],
  33. activeIndx:0,
  34. schemeId:''
  35. }
  36. },
  37. onLoad(opts) {
  38. this.schemeId = opts.id
  39. // 查询方案的项
  40. queryItemBySchemeId({schemeId:opts.id}).then(res=>{
  41. console.log(res.data)
  42. if(res.status == 200){
  43. this.list = res.data
  44. }
  45. })
  46. },
  47. methods: {
  48. // 选中方案
  49. kpOk(item) {
  50. uni.$emit("resetTaskKpItem",this.schemeId)
  51. uni.navigateBack({
  52. delta:2
  53. })
  54. },
  55. // onTab
  56. onTab(index){
  57. this.activeIndx = index
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. page{
  64. height: 100%;
  65. background: #F8F8F8;
  66. }
  67. .kp-details{
  68. height: 100%;
  69. display: flex;
  70. flex-direction: column;
  71. .kp-tabsBox{
  72. flex-grow: 1;
  73. display: flex;
  74. .kp-tabs{
  75. width: 30%;
  76. text-align: center;
  77. margin: 15upx;
  78. overflow: auto;
  79. > view{
  80. padding: 15upx;
  81. background: #fff;
  82. border-radius: 6upx;
  83. box-shadow: 1px 2px 3px #eee;
  84. margin-bottom: 15upx;
  85. > view{
  86. &:last-child{
  87. color: #666;
  88. }
  89. }
  90. }
  91. > view.active{
  92. background: #00aaff;
  93. color: #fff;
  94. > view{
  95. &:last-child{
  96. color: #fff;
  97. }
  98. }
  99. }
  100. }
  101. .kp-items{
  102. width: 70%;
  103. margin: 15upx 15upx 15upx 6upx;
  104. overflow: auto;
  105. > view{
  106. padding: 20upx;
  107. background: #fff;
  108. border-bottom: 5px solid #F8F8F8;
  109. }
  110. }
  111. }
  112. .kp-ok{
  113. text-align: center;
  114. padding: 26upx;
  115. background: #55aaff;
  116. color: #fff;
  117. font-size: 18px;
  118. }
  119. }
  120. </style>