maintenance.vue 5.7 KB

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