<template>
|
<view>
|
<uni-card v-for="item in inspections" @click="gotoInfo(item)" class="card-box" >
|
<view :class="new Date().getTime()-new Date(item.BEGIN_TIME).getTime()>(3600000*item.FREQUENCY)?'red':''">
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>检验单号:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.TASK_NO}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>检验单创建时间:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.BEGIN_TIME}}</label>
|
</u-col>
|
</u-row>
|
<view class="f_type">
|
{{item.FTYPE}}
|
</view>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>机台号:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.MACHINE_NO}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px" v-if="item.PROC_NAME">
|
<u-col span="2">
|
<label>工序名称:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.PROC_NAME}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>产品名称:</label>
|
</u-col>
|
<u-col>
|
<label>{{item.ITEM_NO}} | {{item.ITEM_NAME}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>图号颜色:</label>
|
</u-col>
|
<u-col>
|
<label>{{item.ENGINEERING_NO}} / {{item.COLOR_NAME}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>规格材质:</label>
|
</u-col>
|
<u-col>
|
<label>{{item.MODEL}} / {{item.MATERIAL}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px" v-if="item.OPERATE_MAN">
|
<u-col span="2">
|
<label>操作员:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.OPERATE_MAN}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>检验类型:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.FTYPE}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>检验频率(H):</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.FREQUENCY}}小时</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>下次检验时间</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.NEXT_TIME}}</label>
|
</u-col>
|
</u-row>
|
</view>
|
|
</uni-card>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
import { getInspectionList } from '../../api/inspection'
|
export default {
|
data() {
|
return {
|
inspections: [],
|
moduleKey:0
|
}
|
},
|
onLoad() {
|
this.getInspections()
|
},
|
onPullDownRefresh() {
|
this.getInspections()
|
setTimeout(function () {
|
uni.stopPullDownRefresh();
|
}, 1000);
|
},
|
//onShow:function(){
|
// this.getInspections()
|
//},
|
methods: {
|
getInspections() {
|
getInspectionList().then(res => {
|
console.log(res)
|
if(!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
}
|
this.inspections = res.data
|
})
|
},
|
gotoInfo(e) {
|
console.log(e)
|
uni.navigateTo({
|
url:'/pages/inspection/inspectionInfo?item='+ encodeURIComponent(JSON.stringify(e).replace(/\%/g, '%25').replace(/\ /g,'%20').replace(/\?/g,'%3F').replace(/\+/g,'%2B').replace(/\&/g,'%26')) ,
|
})
|
},
|
reload(){
|
this.$nextTick(()=>{
|
this.$refs.uToast.show({
|
message: "提交成功",
|
type: 'success'
|
})
|
this.getInspections()
|
})
|
},
|
|
}
|
}
|
</script>
|
|
<style>
|
|
.red{
|
color: red;
|
}
|
.card-box{
|
position: relative;
|
}
|
.f_type{
|
position: absolute;
|
right: 13%;
|
top:12%;
|
width: 20px;
|
line-height: 100px;
|
font-size: 8vh;
|
margin: 0 auto;
|
}
|
</style>
|