<template>
|
<view class="container">
|
<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="index">
|
<block slot="backText">返回</block>
|
<block slot="content">生产检验</block>
|
</cu-custom>
|
|
|
<uni-card v-for="(item,index) in tableList" :key="index" margin="10px" spacing="1px">
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">检验项名称:</view>
|
<view class=" bg-white padding-xs margin-xs">
|
<uni-easyinput v-model="item.name" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">最大值:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs">
|
|
|
<uni-easyinput v-model="item.upperLimit" :disabled="true" />
|
</view>
|
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">最小值:</view>
|
<view class="flex-sub bg-white padding-xs margin-xs">
|
<uni-easyinput v-model="item.lowerLimit" :disabled="true" />
|
|
|
</view>
|
</view>
|
|
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">实测值:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right">
|
<uni-number-box :max="99999" @change="changeText($event,item)" v-model="item.measuredValue" />
|
</view>
|
</view>
|
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right">
|
|
<radio-group @change="radioChange" style="margin-left: 30rpx;">
|
<label style="margin-right: 20rpx;">
|
<radio :checked="item.result=='qualified'" value="qualified" />合格
|
</label>
|
|
<label style="margin-right: 20rpx;">
|
<radio :checked="item.result=='unqualified'" value="unqualified" />不合格
|
</label>
|
|
|
</radio-group>
|
|
</view>
|
</view>
|
|
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">缺陷代码:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right">
|
<uni-easyinput v-model="item.defectName" :disabled=true placeholder="请输入缺陷代码" suffixIcon="search"
|
@iconClick="serialNumScan(index,item)" />
|
</view>
|
</view>
|
|
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">缺陷描述:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.defectDescription" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">检验人:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.createBy" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">检验时间:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.createTime" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex" v-show="isShow">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否自动判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.itemReference" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex" v-show="isShow">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否自动判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.id" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex" v-show="isShow">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否自动判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.inspectionId" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex" v-show="isShow">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否自动判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.inspectionSubId" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex" v-show="isShow">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否自动判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.itemId" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex" v-show="isShow">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否自动判定:</view>
|
<view class="bg-white padding-xs margin-xs radius text-right" :disabled=true>
|
<uni-easyinput v-model="item.productiveInspectionId" :disabled="true" />
|
</view>
|
</view>
|
<view class="flex">
|
<view class="flex-sub text-light bg-white padding-xs margin-xs radius">操作:</view>
|
<view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center text-white"
|
v-if="item.createTime!=null" @click="productionEditor(item)">编辑</view>
|
<view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center text-white" v-else
|
@click="productionSub(item)">提交</view>
|
</view>
|
</uni-card>
|
|
<view class="padding-xl">
|
<button class="cu-btn block bg-blue lg" @click="addDate">
|
<text class="cuIcon-add"></text>新增检测值</button>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
<script>
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
export default {
|
mixins: [MescrollMixin], // 使用mixin
|
data() {
|
return {
|
num: '',
|
muber: '0',
|
isShow: false,
|
time: new Date().toUTCString(),
|
items: '',
|
current: '',
|
announcement1: [],
|
radioType: true,
|
releaseList: [{
|
value: 'qualified',
|
name: '合格',
|
checked: 'true'
|
|
},
|
{
|
value: 'unqualified',
|
name: '不合格',
|
checked: 'true'
|
|
}
|
],
|
|
user: {
|
|
|
},
|
defectId: '',
|
applicant: '',
|
applicantName: '',
|
title: '',
|
tableList: [],
|
sheetId: '',
|
inspectionId: '',
|
inspectionSubId: '',
|
id: '',
|
mes: '',
|
cut: '',
|
createBy: '',
|
createTime: '',
|
|
itemId: '',
|
name: '',
|
upperLimit: '',
|
lowerLimit: '',
|
url: {
|
|
add: "qm/InspectionDetails/add",
|
list: "qm/InspectionDetails/query/findInspectionDetails",
|
|
}
|
}
|
},
|
|
|
|
onShow() {
|
let that = this
|
uni.$once('codeDefects', function(e) {
|
console.log('监听到事件来自 stallname ,携带参数 msg 为:', e.msg)
|
const annItems = JSON.parse(e.msg);
|
that.defectId = annItems.id
|
that.tableList[that.items].defectName = annItems.name
|
that.tableList[that.items].defectDescription = annItems.descreption
|
});
|
},
|
|
onLoad: function(option) {
|
this.applicant = this.$store.getters.staffId
|
this.applicantName = this.$store.getters.staffName
|
this.title = uni.getStorageSync('titlies')
|
console.log(this.title)
|
this.sheetId = option.workSheetId
|
this.inspectionType = option.inType
|
const annItem = JSON.parse(decodeURIComponent(option.item));
|
this.itemId = annItem.itemId
|
this.inspectionId = annItem.inspectionId
|
this.inspectionSubId = annItem.inspectionSubId
|
this.name = annItem.name
|
this.upperLimit = annItem.upperLimit
|
this.itemReference = annItem.itemReference
|
console.log(this.itemReference)
|
this.lowerLimit = annItem.lowerLimit
|
console.log(this.sheetId)
|
|
console.log(this.inspectionType)
|
},
|
|
|
|
created() {
|
|
this.searBut()
|
|
},
|
methods: {
|
|
changeText(event, item) {
|
|
this.num = event
|
//输入的值
|
/* alert(item.itemReference) */
|
console.log(item.itemReference)
|
if ("Y" == item.itemReference) {
|
|
if (item.upperLimit > this.num && this.num > item.lowerLimit) {
|
item.result = 'qualified';
|
this.current = 'qualified'
|
|
} else {
|
item.result = 'unqualified';
|
this.current = 'unqualified'
|
}
|
}
|
|
|
|
|
},
|
radioChange(evt) {
|
|
this.current = evt.detail.value
|
console.log(this.current)
|
|
},
|
searBut() {
|
if (this.tableList != null || this.tableList.length > 0) {
|
this.tableList = []
|
}
|
|
this.$http.get(this.url.list, {
|
params: {
|
workSheetId: this.sheetId,
|
inspectionType: this.inspectionType,
|
inspectionId: this.inspectionId,
|
inspectionSubId: this.inspectionSubId
|
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
this.announcement1 = res.data.result.records
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
|
for (let annItem of this.announcement1) {
|
this.tableList.push(annItem)
|
}
|
}
|
|
|
}).catch(() => {
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
* 跳转检测号页面方法
|
*/
|
serialNumScan(index, item) {
|
this.items = index
|
uni.navigateTo({
|
url: "../../../qm/productiveinspection/productiveinspectionCompletion/codeDefects/codeDefects"
|
})
|
|
},
|
|
|
|
productionSub(item) {
|
console.log(item.defectName)
|
this.$http.put(this.url.add, {
|
defectDescription: item.defectDescription,
|
defectId: this.defectId,
|
defectName: item.defectName,
|
inspectionId: this.inspectionId,
|
inspectionSubId: this.inspectionSubId,
|
inspectionType: this.inspectionType,
|
itemId: this.itemId,
|
itemReference: this.itemReference,
|
lowerLimit: this.lowerLimit,
|
measuredValue: item.measuredValue,
|
name: item.name,
|
productiveInspectionId: this.productiveInspectionId,
|
result: item.result,
|
upperLimit: item.upperLimit,
|
workSheetId: this.sheetId,
|
/* defectDescription: item.defectDescription,
|
defectId: this.defectId,
|
defectName: item.defectName,
|
inspectionId: item.inspectionId,
|
inspectionSubId: item.inspectionSubId,
|
inspectionType: this.inspectionType,
|
itemId: item.itemId,
|
itemReference: this.itemReference,
|
lowerLimit: this.lowerLimit,
|
measuredValue: item.measuredValue,
|
name: item.name,
|
productiveInspectionId: item.productiveInspectionId,
|
result: item.result,
|
upperLimit: item.upperLimit,
|
workSheetId: this.sheetId, */
|
|
}).then(res => {
|
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
this.mes = res.data.message
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
uni.showToast({
|
icon: "none",
|
title: this.mes,
|
duration: 2000
|
});
|
this.searBut();
|
|
} else {
|
uni.showToast({
|
icon: "none",
|
title: this.mes,
|
duration: 2000
|
});
|
|
}
|
|
|
}).catch(() => {
|
|
uni.showToast({
|
title: '网络异常,请稍后再试',
|
icon: 'none'
|
});
|
})
|
|
},
|
productionEditor(item) {
|
console.log(item.id)
|
console.log(item.id)
|
debugger
|
if (this.defectId == null || this.defectId == '') {
|
this.defectId = item.defectId
|
}
|
|
this.$http.put(this.url.add, {
|
id: item.id,
|
createBy: item.createBy,
|
createTime: item.createTime,
|
defectDescription: item.defectDescription,
|
defectId: this.defectId,
|
defectName: item.defectName,
|
inspectionId: item.inspectionId,
|
inspectionSubId: item.inspectionSubId,
|
inspectionType: this.inspectionType,
|
itemId: item.itemId,
|
itemReference: item.itemReference,
|
lowerLimit: this.lowerLimit,
|
measuredValue: item.measuredValue,
|
name: item.name,
|
productiveInspectionId: item.productiveInspectionId,
|
result: item.result,
|
upperLimit: item.upperLimit,
|
workSheetId: this.sheetId
|
}).then(res => {
|
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
this.mes = res.data.message
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
uni.showToast({
|
icon: "none",
|
title: this.mes,
|
duration: 2000
|
});
|
this.searBut();
|
|
} else {
|
uni.showToast({
|
icon: "none",
|
title: this.mes,
|
duration: 2000
|
});
|
|
}
|
|
|
}).catch(() => {
|
uni.showToast({
|
title: '网络异常,请稍后再试',
|
icon: 'none'
|
});
|
})
|
|
},
|
|
|
|
|
|
|
|
addDate() {
|
|
this.user.name = this.name
|
this.user.upperLimit = this.upperLimit
|
this.user.lowerLimit = this.lowerLimit
|
this.user.itemReference = this.itemReference
|
this.tableList.push(this.user)
|
|
},
|
|
|
}
|
}
|
</script>
|
|
<style>
|
.container {
|
|
background: white;
|
}
|
|
.title {
|
|
display: block;
|
font-size: 14px;
|
padding: 10px;
|
color: black;
|
padding-left: 20px;
|
color: #1890FF;
|
|
|
}
|
|
.first_tab {
|
background-color: #fff;
|
border-radius: 10rpx;
|
box-shadow: 2rpx 2rpx 2rpx 2rpx #eeeeee;
|
border: 2rpx solid #ccc;
|
width: 100%-40rpx;
|
margin-left: 20rpx;
|
margin-right: 20rpx;
|
margin-top: 20px;
|
|
/* display: flex; */
|
/* flex-direction: row;
|
align-items: center;
|
justify-content: space-between; */
|
}
|
|
|
.button-yuanjiao {
|
height: 50rpx;
|
display: flex;
|
margin-top: 10rpx;
|
line-height: 50rpx;
|
justify-content: center;
|
border-radius: 5px;
|
color: #fff;
|
/* 这里可以改成渐变: background:linear-gradient(to right, #FFDE28,#FF3228) */
|
background-color: #5CBB67;
|
font-size: 28rpx;
|
}
|
|
.button-stop {
|
height: 50rpx;
|
display: flex;
|
margin-top: 10rpx;
|
line-height: 50rpx;
|
justify-content: center;
|
border-radius: 5px;
|
color: #fff;
|
/* 这里可以改成渐变: background:linear-gradient(to right, #FFDE28,#FF3228) */
|
background-color: #EE1E23;
|
font-size: 28rpx;
|
}
|
|
.margin-bottom {
|
margin-top: 5px;
|
margin-left: 10px;
|
margin-right: 10px;
|
margin-bottom: 0px;
|
}
|
|
.button-end {
|
height: 50rpx;
|
display: flex;
|
margin-top: 10rpx;
|
line-height: 50rpx;
|
justify-content: center;
|
border-radius: 5px;
|
color: #fff;
|
/* 这里可以改成渐变: background:linear-gradient(to right, #FFDE28,#FF3228) */
|
background-color: #F79B4D;
|
font-size: 28rpx;
|
}
|
|
|
/* 生成任务 */
|
.footer-box {
|
padding: 10rpx;
|
display: flex;
|
justify-content: space-between;
|
flex-direction: row;
|
}
|
|
.box_ta {
|
margin-top: 10px;
|
padding: 5px;
|
text-align: center;
|
border: 2px dashed gainsboro;
|
width: 100%;
|
}
|
|
.bg-click {
|
|
color: #666;
|
}
|
|
.uni-collapse-item__wrap.is--transition[data-v-41027c34] {
|
|
height: 990px;
|
}
|
|
.line {
|
|
height: 10rpx;
|
background-color: #E1E1E1;
|
width: 100%;
|
}
|
|
.task_title {
|
|
display: flex;
|
justify-content: space-between;
|
padding: 10px 10px;
|
}
|
|
.task_title .task_title_left {
|
font-weight: 800;
|
font-size: 30rpx;
|
margin-left: 10px;
|
}
|
|
.task_title .task_title_right {
|
display: flex;
|
align-items: center;
|
|
}
|
|
.task_title .task_title_right .task_title_icon {
|
width: 15px;
|
height: 15px;
|
margin-right: 5px;
|
}
|
|
.task_title .task_title_right .task_title_icon image {
|
|
width: 100%;
|
height: 100%;
|
}
|
|
.task_content {
|
display: flex;
|
width: 80%;
|
margin-top: 10px;
|
}
|
|
.task_content .task_name {
|
width: auto;
|
color: #857e7e;
|
}
|
|
.task_bottom_left_name {
|
margin-left: 5px;
|
}
|
|
.task_content .tt {
|
padding: 5px;
|
text-align: left;
|
}
|
|
.task_content .task_key {
|
flex: 1;
|
}
|
|
.task_line {
|
width: 100%;
|
height: 2px;
|
border: 1px dashed #E1E1E1;
|
}
|
|
.task_bottom {
|
display: flex;
|
justify-content: space-between;
|
padding: 0 10px;
|
margin-top: 10px;
|
margin-bottom: 10px;
|
height: 20px;
|
}
|
|
.task_bottom .task_bottom_left {
|
display: flex;
|
color: #a19797;
|
align-items: center;
|
}
|
|
.task_bottom .task_bottom_left .task_bottom_left_icon {
|
width: 15px;
|
margin-left: 10px;
|
height: 15px;
|
}
|
|
.task_bottom .task_bottom_left .task_bottom_left_icon image {
|
width: 100%;
|
height: 100%
|
}
|
|
.task_bottom .task_bottom_right {
|
/* background-color: #15a515; */
|
/* border-radius: 5px; */
|
width: 60px;
|
font-size: 18rpx;
|
text-align: center;
|
height: 100%;
|
background-size: 100% 100%;
|
color: #fff;
|
padding: 5px;
|
display: flex;
|
align-items: center;
|
}
|
|
.task_bottom .task_bottom_right .task_bottom_right_button {
|
width: 100%;
|
}
|
|
.first_tab {
|
background-color: #fff;
|
border-radius: 10rpx;
|
box-shadow: 2rpx 2rpx 2rpx 2rpx #eeeeee;
|
border: 2rpx solid #ccc;
|
width: 100%-40rpx;
|
margin-left: 20rpx;
|
margin-right: 20rpx;
|
margin-top: 10rpx;
|
|
/* display: flex; */
|
/* flex-direction: row;
|
align-items: center;
|
justify-content: space-between; */
|
}
|
|
.tt {
|
line-height: 50rpx;
|
}
|
|
.ttt {
|
font-size: 30rpx;
|
font-weight: 800;
|
}
|
|
.task_name {
|
font-size: 24rpx;
|
margin-left: 32rpx;
|
padding: 20rpx 0;
|
}
|
|
.task_key {
|
margin-left: 20px;
|
font-size: 24rpx;
|
padding: 20rpx 0;
|
}
|
|
.task_key view {
|
color: #;
|
text-align: right;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
|
.search_row {
|
|
height: 120rpx;
|
display: flex;
|
background-color: #F1F1F1;
|
padding: 20rpx;
|
}
|
|
.task_key view.ttstatus {
|
|
color: #4082ff;
|
}
|
|
.footer {
|
color: #fff;
|
line-height: 100rpx;
|
flex: 0 0 100rpx;
|
/* 不放大不缩小固定100rpx */
|
}
|
|
.table-main {
|
overflow: auto;
|
}
|
|
|
.scroll-view_H {
|
width: 200%;
|
display: flex;
|
flex-wrap: nowrap;
|
}
|
|
table {
|
border-collapse: collapse;
|
margin: 0 auto;
|
text-align: center;
|
}
|
|
table td,
|
table th {
|
border: 1px solid #cad9ea;
|
color: #666;
|
height: 30px;
|
}
|
|
table thead th {
|
background-color: #CCE8EB;
|
width: 100px;
|
}
|
|
table tr:nth-child(odd) {
|
background: #fff;
|
}
|
|
table tr:nth-child(even) {
|
background: #F5FAFA;
|
}
|
</style>
|