首页调整

test
zhangdi 1 year ago
parent 48df29845f
commit e6f2effa8e
  1. 2
      pages/home/components/swiper.vue
  2. 177
      pages/home/components/swiperRepair.vue
  3. 12
      pages/home/index.vue
  4. 13
      pages/submission/records.vue

@ -1,6 +1,6 @@
<template>
<view v-if="list.length>0">
<view class="work-title">实验室巡检</view>
<view class="notice_bg">
<view class="line"></view>
<swiper

@ -0,0 +1,177 @@
<template>
<view v-if="list.length > 0">
<view class="work-title">维修提报</view>
<view class="notice_bg">
<view class="line"></view>
<swiper autoplay="true" display-multiple-items="1" vertical="true" circular interval="7000" class="bar-swiper">
<swiper-item v-for="(item, index) in list" :key="index" class="swiper-item" @click="goPage(item)">
<view class="time">单号:{{ item.requirementCode }}</view>
<view class="name">故障描述:{{ item.faultDescribe }}</view>
<view class="type"> <u-tag :text="statusName(item.status)" type="success" mode="dark" shape="circle"
:bg-color="tagColor[statusName(item.status)]" /></view>
</swiper-item>
</swiper>
</view>
</view>
</template>
<script>
import { tabList, tabListColor } from '@/config/status.js'
export default {
data() {
return {
list: [
],
tabList: [],//tab
};
},
computed: {
dataTypes() {
this.tabList = tabList[this.$store.state.dataType]
return this.$store.state.dataType
},
tagColor() {
return tabListColor
},
},
mounted() {
this.workList()
},
methods: {
//
click(id) {
// console.log(id, "======>id");
},
workList() {
this.loadingState = "loading";
let query = {
current: 1, //
size: 20, //
dataType: this.dataTypes,//
statusSearch: '1,2,3,4,6,20,7',//5
}
this.$u.api.getWorkOrderRecords(query).then(res => {
if (res.code == 200) {
this.list = res.data.records
}
}).catch(err => {
})
},
statusName(item) {
if (this.tabList.length > 0) {
let newArr = this.tabList.filter(i => {
let sta = i.key.split(',')
return sta.includes(item + '')
})
if (this.dataTypes == 2 || this.dataTypes == 3 || this.dataTypes == 4) {
if (item == 100) {
return '维修驳回'
}
if (item == 101) {
return '主管驳回'
}
if (item == 102) {
return '客户驳回'
}
}
return newArr.length <= 0 ? '' : newArr[0].name
}
},
goPage(item){
uni.navigateTo({
url: '/pages/submission/records?type=submission&requirementCode='+item.requirementCode,
});
}
},
};
</script>
<style scoped lang="scss">
.work-title {
color: rgba(16, 16, 16, 1);
font-size: 32rpx;
padding: 0 0 32rpx 36rpx;
}
.notice_bg {
margin: 0 40rpx 32rpx;
background-color: #ffffff;
border-radius: 20rpx;
padding: 16rpx 20rpx;
display: flex;
align-items: center;
position: relative;
.icon {
width: 74rpx;
height: 72rpx;
}
.bar-swiper {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(34, 34, 34, 0.5);
height: 140rpx;
display: flex;
align-items: center;
flex: 1;
margin-left: 12rpx;
}
.swiper-item {
overflow: hidden;
}
//
.title {
font-size: 32rpx;
color: rgba(16, 16, 16, 1);
text-align: left;
margin-top: 22rpx;
line-height: 38rpx;
}
.time {
margin-top: 20rpx;
margin-bottom: 28rpx;
}
.time,
.name {
font-size: 26rpx;
color: rgba(108, 108, 108, 1);
line-height: 38rpx;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.status {
font-size: 26rpx;
line-height: 38rpx;
margin-top: 20rpx;
.status-name {
color: rgba(58, 98, 215, 1);
padding-right: 10rpx;
}
}
.type {
position: absolute;
top: 20rpx;
right: 20rpx;
color: rgba(58, 98, 215, 1);
font-size: 26rpx;
}
}
</style>

@ -24,11 +24,14 @@
<view class="workbench-name">{{ item.name }}</view>
</view>
</view>
<view>
<swiperSlider></swiperSlider>
</view>
<!-- <view class="work-title">设备报警</view> -->
<view>
<swiperRepair></swiperRepair>
</view>
<!-- -->
<view>
<alarm></alarm>
</view>
@ -55,13 +58,16 @@ import alarm from "./components/alarm.vue";
import eacharts from "./components/eacharts.vue";
import eachartsPie from "./components/eacharts_pie.vue";
import eachartsNightpie from "./components/eacharts_nightpie.vue";
// swiperRepair
import swiperRepair from "./components/swiperRepair.vue";
export default {
components: {
swiperSlider,
alarm,
eacharts,
eachartsPie,
eachartsNightpie
eachartsNightpie,
swiperRepair
},
data() {
return {

@ -169,7 +169,7 @@ export default {
reportUnit: '',//
},
current: 1,
current: 0,
loadingState: "loadmore",
isNomore: false,
noDataFlag: false,
@ -200,6 +200,7 @@ export default {
tabList: [],//tab
messageCount: 0,//
requirementCode:'',//
};
},
computed: {
@ -229,6 +230,7 @@ export default {
},
onLoad(options) {
this.type = options.type ? options.type : ''
this.requirementCode = options.requirementCode ? options.requirementCode : ''
},
onShow() {
this.$nextTick(() => {
@ -236,7 +238,14 @@ export default {
if (this.type == '') {
this.$refs.tabbarRef.getPermission();
}
this.changeTab(1)
if(this.requirementCode != ''){
this.current = 0
this.searchInfo.requirementCode = this.requirementCode
}else{
this.current = 1
this.changeTab(1)
}
this.getRecordsList()
});
},

Loading…
Cancel
Save