548 lines
17 KiB
Vue
Executable File
548 lines
17 KiB
Vue
Executable File
<template>
|
||
<view class="page">
|
||
<view class="detail-top-class">
|
||
<view class="detail-top-title-class">过程检项目</view>
|
||
<view :class="[currentIndex==0?'view-next-disable-class':'view-next-class']" @tap="preBtnClick()">上一项</view>
|
||
<view style="flex-grow: 0; flex-shrink: 0; width: 20px; text-align: center; color: #E5E5E5;">|</view>
|
||
<view :class="[currentIndex==(taskItem.itemArray.length-1)?'view-next-disable-class':'view-next-class']" @tap="nextBtnClick()">下一项</view>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">单据编号:</text>
|
||
<text class="detail-row-context-class">{{taskItem.headData.FBillNO}}</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">工序:</text>
|
||
<text class="detail-row-context-class">{{taskItem.headData.FProcessName}}</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">项目序号:</text>
|
||
<text class="detail-row-context-class">{{taskItem.itemArray[currentIndex].FEntryID}}</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">项目分组:</text>
|
||
<text class="detail-row-context-class">{{taskItem.itemArray[currentIndex].FTestStandardName}}</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">项目名称:</text>
|
||
<text class="detail-row-context-class">{{taskItem.itemArray[currentIndex].FTestProjectName}}</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">分析方法:</text>
|
||
<xfl-select :list="analysisArray" :listOrigin="analysisArray" :clearable="false" :isCanInput="false" v-if="taskItem.headData.FStatus!=40"
|
||
@change="analysisChange" :defaultSelectText="FAnalysisWayNameDefaultSelectText"
|
||
class="detail-row-xfl-class" ref="analysisArrayRef" :style_Container="xlfStyleContainer"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FAnalysisWayName}}
|
||
</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class" v-if="taskItem.itemArray[currentIndex].FAnalysisWay==1">
|
||
<text class="detail-row-title-class">检 验 值:</text>
|
||
<input class="detail-row-input-class" type="number" v-if="taskItem.headData.FStatus!=40"
|
||
v-model="taskItem.itemArray[currentIndex].FQualTestValue" @input="onKeyInput"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FQualTestValue}}
|
||
</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class" v-if="taskItem.itemArray[currentIndex].FAnalysisWay==2">
|
||
<text class="detail-row-title-class">检 验 值:</text>
|
||
<input class="detail-row-input-class" type="number" v-if="taskItem.headData.FStatus!=40"
|
||
v-model="taskItem.itemArray[currentIndex].FQuanTestValue" @input="onKeyInput"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FQuanTestValue}}
|
||
</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class" v-if="taskItem.itemArray[currentIndex].FAnalysisWay==2">
|
||
<text class="detail-row-title-class">目 标 值:</text>
|
||
<input class="detail-row-input-class" type="number" v-if="taskItem.headData.FStatus!=40"
|
||
v-model="taskItem.itemArray[currentIndex].FValue" @input="onKeyInput"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FValue}}
|
||
</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class" v-if="taskItem.itemArray[currentIndex].FAnalysisWay==2">
|
||
<text class="detail-row-title-class">下 限 值:</text>
|
||
<input class="detail-row-input-class" type="number" v-if="taskItem.headData.FStatus!=40"
|
||
v-model="taskItem.itemArray[currentIndex].FLwerLimit" @input="onKeyInput"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FLwerLimit}}
|
||
</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class" v-if="taskItem.itemArray[currentIndex].FAnalysisWay==2">
|
||
<text class="detail-row-title-class">上 限 值:</text>
|
||
<input class="detail-row-input-class" type="number" v-if="taskItem.headData.FStatus!=40"
|
||
v-model="taskItem.itemArray[currentIndex].FUpperLimit" @input="onKeyInput"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FUpperLimit}}
|
||
</text>
|
||
</view>
|
||
|
||
<view class="detail-row-class">
|
||
<text class="detail-row-title-class">检测结果:</text>
|
||
<xfl-select :list="checkArray" :listOrigin="checkArray" :clearable="false" :isCanInput="false" v-if="taskItem.headData.FStatus!=40"
|
||
@change="checkChange" :defaultSelectText="FTestResultNameDefaultSelectText"
|
||
class="detail-row-xfl-class" ref="checkArrayRef" :style_Container="xlfStyleContainer"/>
|
||
<text class="detail-row-context-class" v-if="taskItem.headData.FStatus==40">
|
||
{{taskItem.itemArray[currentIndex].FTestResultName}}
|
||
</text>
|
||
</view>
|
||
|
||
<view style="height: 80rpx; flex-shrink: 0; flex-grow: 0;"></view>
|
||
<view class="detail-btn-row-class">
|
||
<button @tap="saveBtnClick()" :disabled="taskItem.headData.FStatus==40">保存</button>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
<script>
|
||
import xflSelect from '../../../components/xfl-select/xfl-select.vue';
|
||
import Vue from 'vue';
|
||
import {
|
||
mapState,
|
||
mapMutations
|
||
} from 'vuex';
|
||
var _self;
|
||
|
||
export default {
|
||
data() {
|
||
return {
|
||
scrollTop: 0,
|
||
old: {
|
||
scrollTop: 0
|
||
},
|
||
|
||
taskItem: new Object(),
|
||
currentIndex:0,
|
||
backFlag:true,
|
||
analysisArray:[{value:"定性分析", key:1}, {value:"定量分析", key:2}],
|
||
checkArray:[{value:"合格", key:1}, {value:"不合格", key:2}],
|
||
defaultKey:"defaultKey",
|
||
FAnalysisWayNameDefaultSelectText:"",
|
||
FTestResultNameDefaultSelectText:"",
|
||
xlfStyleContainer:"height: 60rpx; line-height: 60rpx"
|
||
}
|
||
},
|
||
|
||
onLoad(options) {
|
||
_self = this;
|
||
if(options.item) {
|
||
let item = JSON.parse(options.item);
|
||
this.taskItem = item;
|
||
this.taskItem.updateFlag = "N"
|
||
this.currentIndex = this.taskItem.currentdIndex;
|
||
let dataKey = _self.defaultKey;
|
||
if (_self.taskItem.headData.FInterID) {
|
||
dataKey = _self.taskItem.headData.FInterID;
|
||
}
|
||
uni.setStorage({
|
||
key: dataKey,
|
||
data: _self.taskItem
|
||
});
|
||
|
||
if(!this.taskItem.headData) {
|
||
this.taskItem.headData = new Object();
|
||
}
|
||
if(!this.taskItem.itemArray) {
|
||
this.taskItem.itemArray = new Array();
|
||
}
|
||
|
||
this.updataPage();
|
||
}
|
||
},
|
||
|
||
onReady() {
|
||
if(!this.taskItem.itemArray[this.currentIndex].FTestResultName || this.taskItem.itemArray[this.currentIndex].FTestResultName.length==0) {
|
||
if(this.$refs.checkArrayRef) {
|
||
this.$refs.checkArrayRef.selectText = "请选择";
|
||
}
|
||
}
|
||
else {
|
||
if(this.$refs.checkArrayRef) {
|
||
this.$refs.checkArrayRef.selectText = this.taskItem.itemArray[this.currentIndex].FTestResultName;
|
||
}
|
||
}
|
||
|
||
if(!this.taskItem.itemArray[this.currentIndex].FAnalysisWayName || this.taskItem.itemArray[this.currentIndex].FAnalysisWayName.length==0) {
|
||
if(this.$refs.analysisArrayRef) {
|
||
this.$refs.analysisArrayRef.selectText = "请选择";
|
||
}
|
||
}
|
||
else {
|
||
if(this.$refs.analysisArrayRef) {
|
||
this.$refs.analysisArrayRef.selectText = this.taskItem.itemArray[this.currentIndex].FAnalysisWayName;
|
||
}
|
||
}
|
||
},
|
||
|
||
onBackPress() {
|
||
if(_self.taskItem.FStatus == 40) {
|
||
this.backFlag = false;
|
||
}
|
||
|
||
if(this.backFlag && _self.taskItem.updateFlag == "Y") {
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: '请确认是否暂存检验项目数据',
|
||
success: function (res) {
|
||
if (res.confirm) {
|
||
_self.backFlag = false;
|
||
let dataKey = _self.defaultKey;
|
||
if (_self.taskItem.headData.FInterID) {
|
||
dataKey = _self.taskItem.headData.FInterID;
|
||
}
|
||
uni.setStorage({
|
||
key: dataKey,
|
||
data: _self.taskItem,
|
||
success: function (res) {
|
||
uni.showToast({
|
||
title:"保存成功",
|
||
});
|
||
},
|
||
});
|
||
|
||
_self.taskItem.updateFlag = "N";
|
||
setTimeout(function(){
|
||
uni.navigateBack({
|
||
delta:1
|
||
});
|
||
}, 2000);
|
||
}else if (res.cancel) {
|
||
_self.backFlag = false;
|
||
_self.taskItem.updateFlag = "N";
|
||
|
||
uni.navigateBack({
|
||
delta:1
|
||
});
|
||
}
|
||
}
|
||
});
|
||
} else {
|
||
this.backFlag = false;
|
||
}
|
||
|
||
return this.backFlag;
|
||
},
|
||
|
||
computed: {
|
||
...mapState(['userInfo']),
|
||
},
|
||
|
||
methods: {
|
||
upper: function(e) {
|
||
console.log(e)
|
||
},
|
||
|
||
lower: function(e) {
|
||
console.log(e)
|
||
},
|
||
|
||
scroll: function(e) {
|
||
console.log(e)
|
||
this.old.scrollTop = e.detail.scrollTop
|
||
},
|
||
|
||
goTop: function(e) {
|
||
// 解决view层不同步的问题
|
||
this.scrollTop = this.old.scrollTop
|
||
this.$nextTick(function() {
|
||
this.scrollTop = 0
|
||
});
|
||
|
||
uni.showToast({
|
||
icon:"none",
|
||
title:"纵向滚动 scrollTop 值已被修改为 0"
|
||
});
|
||
},
|
||
|
||
updataPage: function(){
|
||
if(!this.taskItem.itemArray[this.currentIndex]) {
|
||
this.taskItem.itemArray[this.currentIndex] = new Object();
|
||
}
|
||
if(!this.taskItem.itemArray[this.currentIndex].FTestResult ||
|
||
this.taskItem.itemArray[this.currentIndex].FTestResult == 0){
|
||
this.taskItem.itemArray[this.currentIndex].FTestResult = 0;
|
||
this.taskItem.itemArray[this.currentIndex].FTestResultName = "";
|
||
this.FTestResultNameDefaultSelectText = "请选择";
|
||
if(this.$refs.checkArrayRef) {
|
||
this.$refs.checkArrayRef.selectText = "请选择";
|
||
}
|
||
}
|
||
if(this.taskItem.itemArray[this.currentIndex].FTestResult == 1){
|
||
this.taskItem.itemArray[this.currentIndex].FTestResultName = "合格";
|
||
this.FTestResultNameDefaultSelectText = "合格";
|
||
if(this.$refs.checkArrayRef) {
|
||
this.$refs.checkArrayRef.selectText = "合格";
|
||
}
|
||
}
|
||
if(this.taskItem.itemArray[this.currentIndex].FTestResult == 2){
|
||
this.taskItem.itemArray[this.currentIndex].FTestResultName = "不合格";
|
||
this.FTestResultNameDefaultSelectText = "不合格";
|
||
if(this.$refs.checkArrayRef) {
|
||
this.$refs.checkArrayRef.selectText = "不合格";
|
||
}
|
||
}
|
||
|
||
if(!this.taskItem.itemArray[this.currentIndex].FAnalysisWay ||
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWay == 0) {
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWay = 0;
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWayName = "";
|
||
this.FAnalysisWayNameDefaultSelectText = "请选择";
|
||
if(this.$refs.analysisArrayRef) {
|
||
this.$refs.analysisArrayRef.selectText = "请选择";
|
||
}
|
||
}
|
||
if(this.taskItem.itemArray[this.currentIndex].FAnalysisWay == 1) {
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWay = 1;
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWayName = "定性分析";
|
||
this.FAnalysisWayNameDefaultSelectText = "定性分析";
|
||
if(this.$refs.analysisArrayRef) {
|
||
this.$refs.analysisArrayRef.selectText = "定性分析";
|
||
}
|
||
}
|
||
if(this.taskItem.itemArray[this.currentIndex].FAnalysisWay == 2) {
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWay = 2;
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWayName = "定量分析";
|
||
this.FAnalysisWayNameDefaultSelectText = "定量分析";
|
||
if(this.$refs.analysisArrayRef) {
|
||
this.$refs.analysisArrayRef.selectText = "定量分析";
|
||
}
|
||
}
|
||
|
||
this.$forceUpdate();
|
||
},
|
||
|
||
nextBtnClick: function(){
|
||
if(this.currentIndex==(this.taskItem.itemArray.length-1)) {
|
||
return false;
|
||
}
|
||
_self.currentIndex++;
|
||
_self.updataPage();
|
||
},
|
||
|
||
preBtnClick: function(){
|
||
if(this.currentIndex==0) {
|
||
return false;
|
||
}
|
||
_self.currentIndex--;
|
||
_self.updataPage();
|
||
},
|
||
|
||
analysisChange:function({newVal, oldVal, index, orignItem}) {
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWay = orignItem.key;
|
||
this.taskItem.itemArray[this.currentIndex].FAnalysisWayName = orignItem.value;
|
||
this.FAnalysisWayNameDefaultSelectText = orignItem.value;
|
||
this.$refs.analysisArrayRef.selectText = orignItem.value;
|
||
this.taskItem.updateFlag = "Y";
|
||
this.$forceUpdate();
|
||
},
|
||
|
||
checkChange: function({newVal, oldVal, index, orignItem}) {
|
||
this.taskItem.itemArray[this.currentIndex].FTestResultName = orignItem.value;
|
||
this.taskItem.itemArray[this.currentIndex].FTestResult = orignItem.key;
|
||
this.FTestResultNameDefaultSelectText = orignItem.value;
|
||
this.$refs.checkArrayRef.selectText = orignItem.value;
|
||
this.taskItem.updateFlag = "Y";
|
||
this.$forceUpdate();
|
||
},
|
||
|
||
onKeyInput: function(){
|
||
this.taskItem.updateFlag = "Y";
|
||
},
|
||
|
||
saveBtnClick: function(){
|
||
_self = this;
|
||
let dataKey = _self.defaultKey;
|
||
|
||
if(_self.taskItem.itemArray[_self.currentIndex].FAnalysisWay==1 &&
|
||
_self.taskItem.headData.FStatus!=40 &&
|
||
!_self.taskItem.itemArray[_self.currentIndex].FQualTestValue){
|
||
uni.showToast({
|
||
title:"检验值不能为空",
|
||
icon:"none"
|
||
});
|
||
return false;
|
||
}
|
||
|
||
if(_self.taskItem.itemArray[_self.currentIndex].FAnalysisWay==2 &&
|
||
_self.taskItem.headData.FStatus!=40){
|
||
if(!_self.taskItem.itemArray[_self.currentIndex].FQuanTestValue ||
|
||
!_self.taskItem.itemArray[_self.currentIndex].FValue ||
|
||
!_self.taskItem.itemArray[_self.currentIndex].FLwerLimit ||
|
||
!_self.taskItem.itemArray[_self.currentIndex].FUpperLimit){
|
||
uni.showToast({
|
||
title:"4项分析值不能为空",
|
||
icon:"none"
|
||
});
|
||
}
|
||
return false;
|
||
}
|
||
|
||
if (_self.taskItem.headData.FInterID) {
|
||
dataKey = _self.taskItem.headData.FInterID;
|
||
}
|
||
uni.setStorage({
|
||
key: dataKey,
|
||
data: _self.taskItem,
|
||
success: function (res) {
|
||
uni.showToast({
|
||
title:"保存成功",
|
||
});
|
||
},
|
||
});
|
||
|
||
_self.taskItem.updateFlag = "N";
|
||
}
|
||
},
|
||
|
||
components: {
|
||
xflSelect
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
.page{
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: #FFFFFF;
|
||
display: flex;
|
||
flex-direction:column;
|
||
flex-wrap: nowrap;
|
||
justify-content: flex-start;
|
||
}
|
||
|
||
.content{
|
||
width: 100%;
|
||
height: 60%;
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
}
|
||
|
||
.detail-row-class{
|
||
display: flex;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
background-color: #FFFFFF;
|
||
padding-right: 25rpx;
|
||
padding-left: 25rpx;
|
||
}
|
||
|
||
.detail-item-row-title-class{
|
||
font-size: 30rpx;
|
||
font-style: auto;
|
||
color: #707070;
|
||
font-weight: 600;
|
||
flex-shrink: 0;
|
||
flex-grow: 0;
|
||
color: #28282B;
|
||
line-height: 70rpx;
|
||
width: 100%;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.detail-row-title-class{
|
||
font-size: 30rpx;
|
||
font-style: auto;
|
||
flex-shrink: 0;
|
||
flex-grow: 0;
|
||
color: #666666;
|
||
line-height: 60rpx;
|
||
text-align: end;
|
||
height: 60rpx;
|
||
width: 150rpx;
|
||
}
|
||
|
||
.detail-row-context-class{
|
||
font-size: 30rpx;
|
||
font-style: auto;
|
||
color: #333333;
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
line-height: 50rpx;
|
||
margin-top: 10rpx;
|
||
margin-bottom: 10rpx;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.detail-row-xfl-class{
|
||
height: 60rpx;
|
||
line-height: 60rpx; font-size: 30rpx;
|
||
color: #333333;
|
||
margin-top: 10rpx;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
|
||
.detail-row-input-class{
|
||
font-size: 30rpx;
|
||
color: #6B6B6B;
|
||
line-height: 50rpx;
|
||
height: 50rpx;
|
||
width: 100%;
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
margin-top: 10rpx;
|
||
margin-bottom: 10rpx;
|
||
padding: 5rpx 20rpx;
|
||
border-radius: 5px;
|
||
border: 1px solid #D8D8D8;
|
||
}
|
||
|
||
button{
|
||
bottom: 0px;
|
||
position: fixed;
|
||
width: 100%;
|
||
height: 80rpx;
|
||
line-height: 80rpx;
|
||
background-color: #5778FF;
|
||
font-size: 35rpx;
|
||
font-style: auto;
|
||
color: #FFFFFF;
|
||
border-radius: 0px
|
||
}
|
||
|
||
button::after{
|
||
border: 0px;
|
||
border-radius: 0px
|
||
}
|
||
|
||
.detail-placeholder-class{
|
||
flex-shrink: 0;
|
||
flex-grow: 0;
|
||
width: 5rem;
|
||
}
|
||
|
||
.detail-top-title-class {
|
||
font-size: 35rpx;
|
||
font-weight: bold;
|
||
color: #666666;
|
||
flex-shrink: 1;
|
||
flex-grow: 1;
|
||
}
|
||
|
||
.detail-top-class {
|
||
display: flex;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
margin-left: 25rpx;
|
||
margin-right: 25rpx;
|
||
}
|
||
|
||
.view-next-class{
|
||
font-size: 32rpx;
|
||
color: #395FF2
|
||
}
|
||
|
||
.view-next-disable-class{
|
||
font-size: 32rpx;
|
||
color: #CCCCCC
|
||
}
|
||
</style> |