123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <view class="content">
- <homenav :iStatusBarHeight="iStatusBarHeight" :title="'保养周期'"></homenav>
- <view class="tabbox">
- <view class="tabline" @click="tabindex=1">
- <view class="tabName" :class="{'tabActive':tabindex==1}">保养计划</view>
- <view class="tabHx" v-if="tabindex==1"></view>
- </view>
- <view class="tabline" @click="tabindex=2">
- <view class="tabName " :class="{'tabActive':tabindex==2}">原厂配件参数</view>
- <view class="tabHx" v-if="tabindex==2"></view>
- </view>
- </view>
-
- <view class="tableBox" v-if="tabindex==1">
- <view class="teamContent" >
- <view v-for="(itemRow,indexRow) in itemData" :key="indexRow">
- <view class="row" :class="{grayColor:indexRow==0}">
- <view class="colBg grayColor" >
- <view class="col" >{{itemRow[0]}}</view>
-
- </view>
- </view>
- </view>
- </view>
- <scroll-view scroll-y="true" scroll-x="true" :scroll-top="scrollTop" :scroll-left="scrollTop" @scroll="scroll">
-
- <!-- 内容 -->
- <view class="teamContent" :style="{width:HN_width}">
- <view v-for="(itemRow,indexRow) in itemData" :key="indexRow">
- <view class="row" :class="{grayColor:indexRow==0}">
- <view v-for="(itemCol,indexCol) in itemRow" v-if="indexCol!=0" :key="indexCol" class="colBg" :class="{grayColor:indexCol==0}">
- <view class="col" v-if="indexCol==0">{{itemCol}}</view>
- <view class="col" v-else-if="indexRow==0">{{itemCol}}</view>
- <view class="redCol" v-else-if="indexRow!=0 && indexCol!=0 && itemCol==1"></view>
- <view class="grayCol" v-else-if="indexRow!=0 && indexCol!=0 && itemCol==0"></view>
-
- </view>
- <view class="colBg"></view>
- </view>
- </view>
- </view>
-
-
-
- </scroll-view>
- </view>
- <view class="" v-if="tabindex==2">
- <!-- <view class="pjTitleBox">
- <view class="pjTitle">保养计划</view>
- <view class="pjTitle">规格型号</view>
- <view class="pjTitle">参考用量</view>
- </view> -->
- <view class="pjlineBox">
- <view class="pjline" v-for="(item,index) in pjList">
- <view class="pjitem">{{item[0]}}</view>
- <view class="pjitem">{{item[1]}}</view>
- <view class="pjitem">{{item[2]}}</view>
- </view>
- </view>
- </view>
-
- </view>
- </template>
- <script>
- import homenav from "../../components/homenav/nav.vue"
- export default {
- components: {
- homenav
- },
- data() {
- return {
- tabindex:1,
- liyangId :'',
- itemData:[],
- noMoreShow: false,
- mileage: '',
- liyangId: '',
- scrollTop: 0,
- old: {
- scrollTop: 0
- },
- leftData:[],
- pjList:[],
- iStatusBarHeight:'',
- }
- },
- onLoad(opt) {
- this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
- this.optdata=opt;
- this.queryPlan();
- this.queryOilInfoByGroupID()
- },
- computed: {
- HN_width() {
- var MaxLength = 2;
- var Row_Materials = this.itemData[0];
- if (Row_Materials != null && Row_Materials.length > 0) {
- MaxLength = Row_Materials.length * (180 + 40)
- }
-
- return MaxLength + 'rpx';
-
- },
- },
- methods: {
- queryPlan(){
- uni.showLoading({ title: '加载中'});
- this.$http('matchingByOpen/queryPlan', {
- mileage:'0',
- liyangId:this.optdata.nLevelID,
-
- },'POST').then(res => {
- uni.hideLoading();
- this.itemData = res.data
-
- // 首列数据
- for (var i = 0; i < res.data.length; i++) {
- var leftArr = res.data[i]
- this.leftData.push(leftArr[0])
- }
- })
- },
- queryOilInfoByGroupID(){
- this.$http('matchingByOpen/queryOilInfoByGroupID', {
- // mileage:'30000',
- groupId:this.optdata.id,
-
- },'POST').then(res => {
- this.pjList=res.data
- })
- },
- scroll: function(e) {
- this.old.scrollTop = e.detail.scrollTop
- },
- }
- }
- </script>
- <style scoped>
- .tabbox{
- display: flex;
- }
- .tableBox{
- display: flex;
- }
- .tabline{
- width: 50%;
- }
- .tabHx{
- width: 40rpx;
- height: 4rpx;
- background: #FF4F00;
- margin: 0 auto;
- }
- .tabName{
- font-weight: 400;font-size: 30rpx;
- color: #1A1A1A;
- line-height: 42rpx;
- padding-top: 23rpx;padding-bottom: 8rpx;
- text-align: center;
- }
- .tabActive{
- color: #FF4F00;
- }
- .scroll-view {
- white-space: nowrap;
- height: 1000;
- }
- .teamContent {
- width: 100%;
- align-items: center;
- }
- .row {
- display: flex;
- justify-content: space-around;
- width: 100%;
-
- }
- .colBg{
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20rpx;
- width: 180rpx;
- border: 1rpx #EEEEEE solid;
- height: 80rpx;
-
- }
- .col {
- color: #333333;
- font-size: 28rpx;
-
- }
- .redCol,
- .grayCol{
- width: 24rpx;
- height: 24rpx;
- background-color: #FF4F00;
- border-radius: 12rpx;
-
- }
- .grayCol{
- background-color: #DDDDDD;
- }
- .grayColor{
- background-color: #F7F7F7;
- }
- .leftView{
- display: flex;
- justify-content: space-around;
- flex-flow: column;
-
- position: absolute;
- left: 0rpx;
- top: 0rpx;
- background-color: #FFFFFF;
- z-index: 99;
-
- }
-
- .leftTitleBg{
-
- padding: 20rpx;
- width: 180rpx;
- background-color: #F7F7F7;
- border: 1rpx #EEEEEE solid;
- }
- .leftTitle{
- color: #333333;
- font-size: 28rpx;
- }
- .firstRow{
- height: 80rpx;
- }
- .pjTitle{
- width: 33.3%;text-align: center;font-weight: 400;
- color: #1A1A1A;font-size: 26rpx;
- }
- .pjTitleBox{
- display: flex;
- justify-content: space-between;
- background: #F7F7F7;
- line-height: 93rpx;
- }
- .pjline{
- display: flex;justify-content: space-between;padding: 20rpx 0;
- border-bottom: 1px solid #EEEEEE;
- }
- .pjitem{
- width: 33.3%;text-align: center;font-weight: 400;
- color: #1A1A1A;font-size: 26rpx;
- }
- .grayColorOne{
- position: fixed;
- left: 0;
- background-color: #F7F7F7;
- }
- </style>
|