<template>
|
<view>
|
<view>
|
<uni-card>
|
<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.MACHINE_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.PROC_NAME}}</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.ITEM_NAME}}</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.ITEM_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>{{name}}</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.REMEKE}}</label>
|
</u-col>
|
</u-row>
|
</uni-card>
|
</view>
|
|
<view>
|
<uni-table border stripe emptyText="暂无更多数据" style="margin-left: 5px;margin-right: 5px;">
|
<!-- 表头行 -->
|
<uni-tr>
|
<uni-th align="center" width="80">检验项目</uni-th>
|
<uni-th align="left" width="100">检验工具</uni-th>
|
<uni-th align="left" width="180">备注</uni-th>
|
<uni-th align="left" width="30">检验数量</uni-th>
|
<uni-th align="left" width="80">上限值</uni-th>
|
<uni-th align="left" width="80">下限值</uni-th>
|
<uni-th align="left" width="100">检验值</uni-th>
|
<uni-th align="left" width="80">检验结果</uni-th>
|
</uni-tr>
|
<!-- 表格数据行 -->
|
<uni-tr v-for="item in table">
|
<uni-td>{{item.CHECK_ITEM}}</uni-td>
|
<uni-td>{{item.CHECK_TOOL}}</uni-td>
|
<uni-td>{{item.SPECIFICATION}}</uni-td>
|
<uni-td>{{item.CHECK_NUM}}</uni-td>
|
<uni-td>{{item.UP_ALLOW}}</uni-td>
|
<uni-td>{{item.DOWN_ALLOW}}</uni-td>
|
<uni-td>
|
<u--input v-model="item.VALUE" v-if="item.UP_ALLOW"></u--input>
|
<u-switch v-model="item.VALUE === '合格'" size="20" v-if="!item.UP_ALLOW"
|
@change="changeSwitch(item)"></u-switch>
|
</uni-td>
|
<uni-td>
|
<u-tag
|
v-if="item.UP_ALLOW && item.VALUE <= item.UP_ALLOW && item.VALUE >= item.DOWN_ALLOW || !item.UP_ALLOW && item.VALUE == '合格'"
|
text="合格" type="success"></u-tag>
|
<u-tag
|
v-if="item.UP_ALLOW && (item.VALUE > item.UP_ALLOW || item.VALUE < item.DOWN_ALLOW) || !item.UP_ALLOW && item.VALUE == '不合格'"
|
text="不合格" type="error"></u-tag>
|
</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
<u-button text="提交" type="primary" style="position: absolute;bottom:0;" @click="submit()"></u-button>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getInspectionInfo, saveInspectionInfo
|
} from '../../api/inspection';
|
export default {
|
data() {
|
return {
|
item: {},
|
table: [],
|
name:''
|
}
|
},
|
onLoad(option) {
|
let item = JSON.parse(decodeURIComponent(option.item));
|
this.item = item
|
this.getInspection(item.CHECK_NO)
|
this.name = uni.getStorageSync('userInfo').username
|
},
|
methods: {
|
getInspection(chenkNo) {
|
getInspectionInfo(chenkNo).then(res => {
|
// this.table = res.data
|
for (let item of res.data) {
|
for (let i = 0; i < parseInt(item.CHECK_NUM); i++) {
|
let insert = JSON.parse(JSON.stringify(item))
|
|
insert.CHECK_ITEM = insert.CHECK_ITEM + '-' + i
|
if (!insert.UP_ALLOW) {
|
insert.VALUE = '合格'
|
} else {
|
insert.VALUE = 0
|
}
|
this.table.push(insert)
|
}
|
}
|
})
|
},
|
changeSwitch(item) {
|
if (item.VALUE == '合格') {
|
item.VALUE = '不合格'
|
} else {
|
item.VALUE = '合格'
|
}
|
},
|
submit() {
|
saveInspectionInfo(this.item.CHECK_NO,this.table).then(res => {
|
console.log(res)
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.wrap {
|
padding: 12px;
|
}
|
|
.demo-layout {
|
height: 25px;
|
border-radius: 4px;
|
}
|
|
.bg-purple {
|
background: #CED7E1;
|
}
|
|
.bg-purple-light {
|
background: #e5e9f2;
|
}
|
|
.bg-purple-dark {
|
background: #99a9bf;
|
}
|
|
.text {
|
font-size: x-large;
|
}
|
</style>
|