maintenance.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view class="content">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'保养周期'"></homenav>
  4. <view class="tabbox">
  5. <view class="tabline" @click="tabindex=1">
  6. <view class="tabName" :class="{'tabActive':tabindex==1}">保养计划</view>
  7. <view class="tabHx" v-if="tabindex==1"></view>
  8. </view>
  9. <view class="tabline" @click="tabindex=2">
  10. <view class="tabName " :class="{'tabActive':tabindex==2}">原厂配件参数</view>
  11. <view class="tabHx" v-if="tabindex==2"></view>
  12. </view>
  13. </view>
  14. <view class="" v-if="tabindex==1">
  15. <scroll-view scroll-y="true" scroll-x="true" :scroll-top="scrollTop" :scroll-left="scrollTop" @scroll="scroll">
  16. <!-- 内容 -->
  17. <view class="teamContent" :style="{width:HN_width}">
  18. <view v-for="(itemRow,indexRow) in itemData" :key="indexRow">
  19. <view class="row" :class="{grayColor:indexRow==0}">
  20. <!-- <view class="colBg grayColorOne" >
  21. <view class="col" >{{itemRow[0]}}</view>
  22. </view> -->
  23. <view v-for="(itemCol,indexCol) in itemRow" :key="indexCol" class="colBg" :class="{grayColor:indexCol==0}">
  24. <view class="col" v-if="indexCol==0">{{itemCol}}</view>
  25. <view class="col" v-else-if="indexRow==0">{{itemCol}}</view>
  26. <view class="redCol" v-else-if="indexRow!=0 && indexCol!=0 && itemCol==1"></view>
  27. <view class="grayCol" v-else-if="indexRow!=0 && indexCol!=0 && itemCol==0"></view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </scroll-view>
  33. </view>
  34. <view class="" v-if="tabindex==2">
  35. <view class="pjTitleBox">
  36. <view class="pjTitle">保养计划</view>
  37. <view class="pjTitle">规格型号</view>
  38. <view class="pjTitle">参考用量</view>
  39. </view>
  40. <view class="pjlineBox">
  41. <view class="pjline" v-for="(item,index) in pjList">
  42. <view class="pjitem">{{item[0]}}</view>
  43. <view class="pjitem">{{item[1]}}</view>
  44. <view class="pjitem">{{item[2]}}</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import homenav from "../../components/homenav/nav.vue"
  52. export default {
  53. components: {
  54. homenav
  55. },
  56. data() {
  57. return {
  58. tabindex:1,
  59. liyangId :'',
  60. itemData:[],
  61. noMoreShow: false,
  62. mileage: '',
  63. liyangId: '',
  64. scrollTop: 0,
  65. old: {
  66. scrollTop: 0
  67. },
  68. leftData:[],
  69. pjList:[],
  70. iStatusBarHeight:'',
  71. }
  72. },
  73. onLoad(opt) {
  74. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  75. this.optdata=opt;
  76. this.queryPlan();
  77. this.queryOilInfoByGroupID()
  78. },
  79. computed: {
  80. HN_width() {
  81. var MaxLength = 2;
  82. var Row_Materials = this.itemData[0];
  83. if (Row_Materials != null && Row_Materials.length > 0) {
  84. MaxLength = Row_Materials.length * (180 + 40)
  85. }
  86. return MaxLength + 'rpx';
  87. },
  88. },
  89. methods: {
  90. queryPlan(){
  91. uni.showLoading({ title: '加载中'});
  92. this.$http('matchingByOpen/queryPlan', {
  93. mileage:'0',
  94. liyangId:this.optdata.nLevelID,
  95. },'POST').then(res => {
  96. uni.hideLoading();
  97. this.itemData = res.data
  98. // 首列数据
  99. for (var i = 0; i < res.data.length; i++) {
  100. var leftArr = res.data[i]
  101. this.leftData.push(leftArr[0])
  102. }
  103. })
  104. },
  105. queryOilInfoByGroupID(){
  106. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  107. // mileage:'30000',
  108. groupId:this.optdata.id,
  109. },'POST').then(res => {
  110. this.pjList=res.data
  111. })
  112. },
  113. scroll: function(e) {
  114. this.old.scrollTop = e.detail.scrollTop
  115. },
  116. }
  117. }
  118. </script>
  119. <style scoped>
  120. .tabbox{
  121. display: flex;
  122. }
  123. .tabline{
  124. width: 50%;
  125. }
  126. .tabHx{
  127. width: 40rpx;
  128. height: 4rpx;
  129. background: #FF4F00;
  130. margin: 0 auto;
  131. }
  132. .tabName{
  133. font-weight: 400;font-size: 30rpx;
  134. color: #1A1A1A;
  135. line-height: 42rpx;
  136. padding-top: 23rpx;padding-bottom: 8rpx;
  137. text-align: center;
  138. }
  139. .tabActive{
  140. color: #FF4F00;
  141. }
  142. .scroll-view {
  143. white-space: nowrap;
  144. height: 1000;
  145. }
  146. .teamContent {
  147. width: 100%;
  148. align-items: center;
  149. }
  150. .row {
  151. display: flex;
  152. justify-content: space-around;
  153. width: 100%;
  154. }
  155. .colBg{
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. padding: 20rpx;
  160. width: 180rpx;
  161. border: 1rpx #EEEEEE solid;
  162. }
  163. .col {
  164. color: #333333;
  165. font-size: 28rpx;
  166. }
  167. .redCol,
  168. .grayCol{
  169. width: 24rpx;
  170. height: 24rpx;
  171. background-color: #FF4F00;
  172. border-radius: 12rpx;
  173. }
  174. .grayCol{
  175. background-color: #DDDDDD;
  176. }
  177. .grayColor{
  178. background-color: #F7F7F7;
  179. }
  180. .leftView{
  181. display: flex;
  182. justify-content: space-around;
  183. flex-flow: column;
  184. position: absolute;
  185. left: 0rpx;
  186. top: 0rpx;
  187. background-color: #FFFFFF;
  188. z-index: 99;
  189. }
  190. .leftTitleBg{
  191. padding: 20rpx;
  192. width: 180rpx;
  193. background-color: #F7F7F7;
  194. border: 1rpx #EEEEEE solid;
  195. }
  196. .leftTitle{
  197. color: #333333;
  198. font-size: 28rpx;
  199. }
  200. .firstRow{
  201. height: 80rpx;
  202. }
  203. .pjTitle{
  204. width: 33.3%;text-align: center;font-weight: 400;
  205. color: #1A1A1A;font-size: 26rpx;
  206. }
  207. .pjTitleBox{
  208. display: flex;
  209. justify-content: space-between;
  210. background: #F7F7F7;
  211. line-height: 93rpx;
  212. }
  213. .pjline{
  214. display: flex;justify-content: space-between;padding: 20rpx 0;
  215. border-bottom: 1px solid #EEEEEE;
  216. }
  217. .pjitem{
  218. width: 33.3%;text-align: center;font-weight: 400;
  219. color: #1A1A1A;font-size: 26rpx;
  220. }
  221. .grayColorOne{
  222. position: fixed;
  223. left: 0;
  224. background-color: #F7F7F7;
  225. }
  226. </style>