<template>
|
<view class="content">
|
<view class="infoArea">
|
<view class="name">{{infoData.设备名称}}</view>
|
<view class="dm">( 代码:{{infoData.设备代码}} )</view>
|
<view class="other">
|
<view class="half">出厂编号: <text>{{infoData.设备出厂编号}}</text></view>
|
<view class="half">出厂日期: <text>{{infoData.设备出厂日期.substr(0,10)}}</text></view>
|
<view class="half">设备编码: <text v-if="infoData.设备编码 != 'null'">{{infoData.设备编码}}</text></view>
|
<view class="half">设备类型: <text v-if="infoData.设备类型 != 'null'">{{infoData.设备类型}}</text></view>
|
</view>
|
<view class="other" style="margin-top: 0;">
|
<view class="all">设备规格: <text v-if="infoData.设备规格 != 'null'">{{infoData.设备规格}}</text></view>
|
<view class="all">设备型号: <text v-if="infoData.设备型号 != 'null'">{{infoData.设备型号}}</text></view>
|
</view>
|
|
<view class="choose">
|
<view class="tab" :class="{focus: number == 1}" @tap="changeTab(1)">日常记录</view>
|
<view class="tab" :class="{focus: number == 2}" @tap="changeTab(2)">维修记录</view>
|
</view>
|
</view>
|
|
<view style="width: 100%;height: 380rpx;"></view>
|
<view class="list" v-for="(item,index) in listData" :key="index">
|
<uni-card :title="item.单据类型" :extra="item.单据号" style="margin: 10px;" @tap="showDetail = showDetail==index?-1:index">
|
<view class="card-detail">
|
<view class="detail" v-if="item.制单人">
|
<text>制单人:</text>{{item.制单人}}
|
</view>
|
<view class="detail" v-if="item.制单日期">
|
<text>制单日期:</text>{{item.制单日期.substr(0,10)}}
|
</view>
|
<view class="detail" v-if="item.审核人">
|
<text>审核人:</text>{{item.审核人}}
|
</view>
|
<view class="detail" v-if="item.审核日期">
|
<text>审核日期:</text>{{item.审核日期.substr(0,10)}}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
|
<view class="over" v-if="listData.length == 0">暂无数据</view>
|
<view class="over" v-if="listData.length != 0">已到底</view>
|
</view>
|
</template>
|
|
<script>
|
import { getUserInfo } from "@/utils/auth.js";
|
export default {
|
data() {
|
return {
|
userInfo:getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
|
infoData:{},
|
number:1,
|
listData:[],
|
listData1:[],
|
listData2:[],
|
showDetail:-1,
|
}
|
},
|
onLoad(e) {
|
console.log(e)
|
// e = {
|
// HInterID: "9",
|
// 设备代码: "028",
|
// 设备出厂日期: "1900-01-01T00:00:00",
|
// 设备出厂编号: "",
|
// 设备名称: "沃德精机 125T",
|
// 设备型号: "",
|
// 设备类型: "null",
|
// 设备编码: "028",
|
// 设备规格: "125吨",
|
// }
|
uni.setNavigationBarTitle({
|
title: e.设备名称
|
});
|
this.infoData = e
|
this.getList(e.HInterID)
|
},
|
methods: {
|
getList(HInterID){
|
uni.showLoading({
|
title:'加载中...'
|
})
|
uni.request({
|
url: this.serverUrl + '/Gy_EquipFileMain/Sb_EquipFileBillResumeDate',
|
data: { "HInterID": HInterID },
|
success: (res) => {
|
if(res.data.count == 1){
|
this.listData1 = res.data.list[0]
|
this.listData2 = res.data.list[1]
|
this.listData = res.data.list[0]
|
console.log(1,this.listData1);
|
console.log(2,this.listData2);
|
uni.hideLoading()
|
}else{
|
uni.hideLoading()
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
changeTab(e){
|
this.number = e
|
if(e==1){
|
this.listData = this.listData1
|
}else{
|
this.listData = this.listData2
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.infoArea{
|
width: 100%;
|
padding-top: 20rpx;
|
background-color: #f0f0f0;
|
position: fixed;
|
top: 0;
|
left: 0;
|
z-index: 99;
|
.name{
|
text-align: center;
|
font-size: 32rpx;
|
font-weight: 600;
|
color: #333;
|
line-height: 150%;
|
}
|
.dm{
|
text-align: center;
|
font-size: 27rpx;
|
font-weight: 500;
|
color: #333;
|
}
|
.other{
|
display: flex;
|
flex-wrap: wrap;
|
width: 90%;
|
margin: 0 auto;
|
margin-top: 12rpx;
|
font-size: 27rpx;
|
color: #666;
|
text{
|
font-size: 28rpx;
|
color: #333;
|
margin-left: 10rpx;
|
}
|
.half{
|
width: 50%;
|
}
|
.all{
|
width: 100%;
|
}
|
}
|
.choose{
|
height: 70rpx;
|
margin-top: 20rpx;
|
padding: 0 30rpx;
|
background-color: #fff;
|
line-height: 86rpx;
|
border-radius: 40rpx 40rpx 0 0;
|
border-bottom: 2px solid #eee;
|
display: flex;
|
.tab{
|
margin: 0 20rpx;
|
text-align: center;
|
font-size: 28rpx;
|
color: #666;
|
}
|
.focus{
|
font-size: 30rpx;
|
color: #333;
|
font-weight: 600;
|
border-bottom: 2px solid #3a78ff;
|
}
|
}
|
}
|
|
.list{
|
width: 100%;
|
.card-detail{
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
line-height: 120%;
|
.detail{
|
// width: 50%;
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
margin-right: 20rpx;
|
text{
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
}
|
.more{
|
color: #888;
|
font-size: 24rpx;
|
display: flex;
|
border-top: 1px solid #eee;
|
padding-top: 20rpx;
|
.part{
|
width: 50%;
|
text-align: center;
|
}
|
}
|
}
|
|
</style>
|