|
|
@@ -50,7 +50,7 @@
|
|
|
<view class="rx ww55 ">
|
|
|
<view class="lable lable150 rx-cc ">合格品数量</view>
|
|
|
<view class="content content_num">
|
|
|
- <input class="uni-input" v-model="item.workReportInfo.formedNum" :disabled="isDetails"
|
|
|
+ <input class="uni-input" v-model="formedNum" :disabled="isDetails"
|
|
|
@input="blurNum(item.workReportInfo)" type="digit"></input>
|
|
|
<view class="unit">{{ item.unit }}</view>
|
|
|
</view>
|
|
|
@@ -60,7 +60,7 @@
|
|
|
<view class="lable rx-cc ww80">重量</view>
|
|
|
<view class="content content_num">
|
|
|
<input class="uni-input" v-model="formedWeight" type="digit"
|
|
|
- :disabled="isDetails"></input>
|
|
|
+ :disabled="isDetails" @input="blurWeight()"></input>
|
|
|
<view class="unit">{{ item.weightUnit }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -80,9 +80,9 @@
|
|
|
v-if="isDetails"
|
|
|
@input="changeNum"></input>
|
|
|
|
|
|
- <input class="uni-input" v-model="not.notFormedNum" type="number"
|
|
|
+ <input class="uni-input" v-model="notFormedNum" type="number"
|
|
|
v-else
|
|
|
- @input="changeNum(not)"></input>
|
|
|
+ @input="blurNum2(item.workReportInfo)"></input>
|
|
|
<view class="unit">{{ item.unit }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -92,8 +92,8 @@
|
|
|
<view class="content content_num">
|
|
|
<input class="uni-input" v-model="item.workReportInfo.notFormedWeight" type="digit"
|
|
|
:disabled="isDetails" v-if="isDetails"></input>
|
|
|
- <input class="uni-input" v-model="not.notFormedWeight" type="digit"
|
|
|
- :disabled="isDetails" v-else></input>
|
|
|
+ <input class="uni-input" v-model="notFormedWeight" type="digit"
|
|
|
+ :disabled="isDetails" v-else @input="blurWeight2()"></input>
|
|
|
<view class="unit">{{ item.weightUnit }}</view>
|
|
|
|
|
|
<!-- <view class="penalize" v-if='!isDetails'
|
|
|
@@ -179,7 +179,10 @@ export default {
|
|
|
notFormedList: [],
|
|
|
clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
|
|
|
.clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
|
|
|
+ formedNum:'',
|
|
|
formedWeight:'',
|
|
|
+ notFormedNum:'',
|
|
|
+ notFormedWeight:'',
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -204,6 +207,13 @@ export default {
|
|
|
this.formedWeight=formedWeight
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
+ formedTotal(formedNumCount,formedWeightCount,notFormedNumCount,notFormedWeightCount){
|
|
|
+ this.formedNum=formedNumCount
|
|
|
+ this.formedWeight=formedWeightCount
|
|
|
+ this.notFormedNum=notFormedNumCount,
|
|
|
+ this.notFormedWeight=notFormedWeightCount,
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
batchNoNew(e){
|
|
|
|
|
|
this.item.workReportInfo.batchNo = this.item.batchNo+e.target.value;
|
|
|
@@ -243,6 +253,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
blurNum(value) {
|
|
|
+ this.$set(this.item.workReportInfo, 'formedNum', this.formedNum)
|
|
|
let total = 0;
|
|
|
//匹配非数字
|
|
|
let val=value.formedNum;
|
|
|
@@ -268,6 +279,8 @@ export default {
|
|
|
if (value.formedNum > this.item.formingNum) {
|
|
|
this.$set(this.item.workReportInfo, 'workReportInfo', this.item.formingNum)
|
|
|
this.$set(this.notFormedList[0], 'notFormedNum', 0)
|
|
|
+ this.formedNum=0
|
|
|
+ this.$forceUpdate()
|
|
|
this.notForme()
|
|
|
return uni.showToast({
|
|
|
icon: 'none',
|
|
|
@@ -281,6 +294,8 @@ export default {
|
|
|
console.log(this.item.product[0].feedQuantity);
|
|
|
this.$set(this.item.workReportInfo, 'workReportInfo', this.item.product[0].feedQuantity)
|
|
|
this.$set(this.notFormedList[0], 'notFormedNum', 0)
|
|
|
+ this.formedNum=0
|
|
|
+ this.$forceUpdate()
|
|
|
this.notForme()
|
|
|
return uni.showToast({
|
|
|
icon: 'none',
|
|
|
@@ -322,6 +337,68 @@ export default {
|
|
|
this.$forceUpdate()
|
|
|
|
|
|
},
|
|
|
+ blurNum2(value) {
|
|
|
+ this.$set(this.item.workReportInfo, 'notFormedNum', this.notFormedNum)
|
|
|
+
|
|
|
+ let total = 0;
|
|
|
+ //匹配非数字
|
|
|
+ let val=value.notFormedNum;
|
|
|
+ let reg = new RegExp("([^0-9]*)","g");
|
|
|
+ let ma = val.match(reg);
|
|
|
+ //如果有非数字,替换成""
|
|
|
+ if(ma.length>0){
|
|
|
+ for(let k in ma){
|
|
|
+ if(ma[k]!=""){
|
|
|
+ val = val.replace(ma[k],0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //可以为0,但不能以0开头
|
|
|
+ if(val.startsWith("0")&&val.length>1){
|
|
|
+ val = val.substring(1,val.length);
|
|
|
+ }
|
|
|
+ value.notFormedNum=val;
|
|
|
+
|
|
|
+ if (this.item.currentTaskDiagram.isFirstTask) {
|
|
|
+
|
|
|
+ // formingNum 生产数量 feedQuantity this.item.product[0] //投料数量
|
|
|
+ if (value.notFormedNum > this.item.formingNum) {
|
|
|
+ this.$set(this.item.workReportInfo, 'workReportInfo', this.item.formingNum)
|
|
|
+ this.$set(this.notFormedList[0], 'notFormedNum', 0)
|
|
|
+ this.notFormedNum=0
|
|
|
+ this.$forceUpdate()
|
|
|
+ this.notForme()
|
|
|
+ return uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '不合格品数量不能大于要求生产数量'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.item.product.length) {
|
|
|
+
|
|
|
+ if (value.formedNum > this.item.product[0].feedQuantity) {
|
|
|
+ console.log(this.item.product[0].feedQuantity);
|
|
|
+ this.$set(this.item.workReportInfo, 'workReportInfo', this.item.product[0].feedQuantity)
|
|
|
+ this.$set(this.notFormedList[0], 'notFormedNum', 0)
|
|
|
+ this.notFormedNum=0
|
|
|
+ this.$forceUpdate()
|
|
|
+ this.notForme()
|
|
|
+ return uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '合格品数量不能大于投料数量'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ blurWeight(){
|
|
|
+ this.$set(this.item.workReportInfo, 'formedWeight', this.formedWeight)
|
|
|
+ },
|
|
|
+
|
|
|
+ blurWeight2(){
|
|
|
+ this.$set(this.item.workReportInfo, 'notFormedWeight', this.notFormedWeight)
|
|
|
+ },
|
|
|
|
|
|
notForme() {
|
|
|
|