|
|
@@ -32,9 +32,9 @@
|
|
|
<!-- v-if="(clientEnvironmentId == 3 && item.singleReport == 0) || taskObj.type == 4 || clientEnvironmentId == 2" -->
|
|
|
<div class="item rx-sc">
|
|
|
<div class="rx ww40">
|
|
|
- <div class="lable lable100 rx-cc">合格品数量</div>
|
|
|
+ <div class="lable lable100 rx-cc">合格品数量111</div>
|
|
|
<div class="content content_num rx-sc">
|
|
|
- <el-input size="mini" v-model="item.workReportInfo.formedNum" placeholder="请输入合格品数量"
|
|
|
+ <el-input size="mini" v-model.number="item.workReportInfo.formedNum" placeholder="请输入合格品数量"
|
|
|
@input="blurNum">
|
|
|
<template slot="append">{{ item.unit }}</template>
|
|
|
</el-input>
|
|
|
@@ -57,7 +57,7 @@
|
|
|
<div class="rx ww40">
|
|
|
<div class="lable lable100 rx-cc">不合格数量</div>
|
|
|
<div class="content content_num rx-sc">
|
|
|
- <el-input size="mini" v-model="item.workReportInfo.notFormedNum" placeholder="请输入不合格数量"
|
|
|
+ <el-input size="mini" v-model.number="item.workReportInfo.notFormedNum" placeholder="请输入不合格数量"
|
|
|
@input="changeNum">
|
|
|
<template slot="append">{{ item.unit }}</template>
|
|
|
</el-input>
|
|
|
@@ -152,34 +152,35 @@ export default {
|
|
|
|
|
|
watch: {
|
|
|
item: {
|
|
|
+ immediate: true,
|
|
|
deep: true,
|
|
|
handler(newVal) {
|
|
|
- console.log('jhsaighajighsag',newVal)
|
|
|
- if (newVal.semiProductList.length) {
|
|
|
- let formedNum = 0;
|
|
|
- let noFormingNum = 0;
|
|
|
- let formedWeight = 0
|
|
|
- let notFormedWeight = 0
|
|
|
-
|
|
|
- newVal.semiProductList.forEach(v => {
|
|
|
- // 合格品数量
|
|
|
- if (v.extInfo.isQualified == 1) {
|
|
|
- formedNum += 1;
|
|
|
- formedWeight += (Number(v.extInfo.reportWeight)||0)
|
|
|
- } else {
|
|
|
- noFormingNum += 1;
|
|
|
- notFormedWeight += (Number(v.extInfo.reportWeight)||0)
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- newVal.workReportInfo.formedNum = formedNum;
|
|
|
- newVal.workReportInfo.notFormedNum = noFormingNum;
|
|
|
- newVal.workReportInfo.formedWeight = parseFloat(formedWeight.toFixed(2))
|
|
|
- // this.$set(this.item.workReportInfo,'formedWeight',formedWeight.toFixed(2))
|
|
|
- newVal.workReportInfo.notFormedWeight = parseFloat(notFormedWeight.toFixed(2))
|
|
|
- // this.$set(this.item.workReportInfo,'notFormedWeight',notFormedWeight.toFixed(2))
|
|
|
- this.$forceUpdate()
|
|
|
- }
|
|
|
+ // console.log('jhsaighajighsag',newVal)
|
|
|
+ // if (newVal.semiProductList.length) {
|
|
|
+ // let formedNum = 0;
|
|
|
+ // let noFormingNum = 0;
|
|
|
+ // let formedWeight = 0
|
|
|
+ // let notFormedWeight = 0
|
|
|
+
|
|
|
+ // newVal.semiProductList.forEach(v => {
|
|
|
+ // // 合格品数量
|
|
|
+ // if (v.extInfo.isQualified == 1) {
|
|
|
+ // formedNum += 1;
|
|
|
+ // formedWeight += (Number(v.extInfo.reportWeight)||0)
|
|
|
+ // } else {
|
|
|
+ // noFormingNum += 1;
|
|
|
+ // notFormedWeight += (Number(v.extInfo.reportWeight)||0)
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ // newVal.workReportInfo.formedNum = formedNum;
|
|
|
+ // newVal.workReportInfo.notFormedNum = noFormingNum;
|
|
|
+ // newVal.workReportInfo.formedWeight = parseFloat(formedWeight.toFixed(2))
|
|
|
+ // // this.$set(this.item.workReportInfo,'formedWeight',formedWeight.toFixed(2))
|
|
|
+ // newVal.workReportInfo.notFormedWeight = parseFloat(notFormedWeight.toFixed(2))
|
|
|
+ // // this.$set(this.item.workReportInfo,'notFormedWeight',notFormedWeight.toFixed(2))
|
|
|
+ // this.$forceUpdate()
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
},
|
|
|
@@ -290,16 +291,16 @@ export default {
|
|
|
|
|
|
singleQuery() {
|
|
|
console.log(this.item.workReportInfo);
|
|
|
-
|
|
|
if (!this.item.workReportInfo.formedNum) return this.$message.info("请输入合格品数")
|
|
|
- if (this.item.workReportInfo.notFormedNum == '' || this.item.workReportInfo.notFormedNum == null) return this.$message.info(
|
|
|
+
|
|
|
+ if (this.item.workReportInfo.notFormedNum === '' || this.item.workReportInfo.notFormedNum == null) return this.$message.info(
|
|
|
"请输入不合格品数"
|
|
|
)
|
|
|
|
|
|
|
|
|
const req = {
|
|
|
"formedNum": this.item.workReportInfo.formedNum,
|
|
|
- "notFormedNum": this.item.workReportInfo.notFormedNum,
|
|
|
+ "notFormedNum": this.item.workReportInfo.notFormedNum||0,
|
|
|
"taskId": this.item.workReportInfo.taskId,
|
|
|
"workOrderId": this.item.workReportInfo.workOrderId
|
|
|
};
|
|
|
@@ -342,44 +343,49 @@ export default {
|
|
|
},
|
|
|
|
|
|
blurNum() {
|
|
|
+ let total =this.item.workReportInfo.formedNum + this.item.workReportInfo.notFormedNum;
|
|
|
+ console.log('111222',total)
|
|
|
+ if(total > this.item.formingNum){
|
|
|
+ this.item.workReportInfo.formedNum=0
|
|
|
+ this.$message.warning('合格品数量加不合格数量不能大于要求生产数量');
|
|
|
+ }
|
|
|
+ // let total =
|
|
|
+ // Number(this.item.workReportInfo.formedNum) +
|
|
|
+ // Number(this.notFormedList[0].notFormedNum);
|
|
|
|
|
|
- let total =
|
|
|
- Number(this.item.workReportInfo.formedNum) +
|
|
|
- Number(this.notFormedList[0].notFormedNum);
|
|
|
+ // console.log(total, '9****');
|
|
|
|
|
|
- console.log(total, '9****');
|
|
|
+ // this.$emit('modeNum', total);
|
|
|
|
|
|
- this.$emit('modeNum', total);
|
|
|
|
|
|
+ // if (
|
|
|
+ // this.item.product[0] &&
|
|
|
+ // this.item.product[0].feedQuantity > 0 &&
|
|
|
+ // Number(this.item.workReportInfo.formedNum)
|
|
|
+ // ) {
|
|
|
+ // this.$set(
|
|
|
+ // this.notFormedList[0],
|
|
|
+ // 'notFormedNum',
|
|
|
+ // this.item.product[0].feedQuantity -
|
|
|
+ // Number(this.item.workReportInfo.formedNum)
|
|
|
+ // );
|
|
|
+ // this.notForme();
|
|
|
+ // }
|
|
|
|
|
|
- if (
|
|
|
- this.item.product[0] &&
|
|
|
- this.item.product[0].feedQuantity > 0 &&
|
|
|
- Number(this.item.workReportInfo.formedNum)
|
|
|
- ) {
|
|
|
- this.$set(
|
|
|
- this.notFormedList[0],
|
|
|
- 'notFormedNum',
|
|
|
- this.item.product[0].feedQuantity -
|
|
|
- Number(this.item.workReportInfo.formedNum)
|
|
|
- );
|
|
|
- this.notForme();
|
|
|
- }
|
|
|
+ // let weight =
|
|
|
+ // Number(this.item.workReportInfo.formedNum) *
|
|
|
+ // Number(this.item.singleWeight) *
|
|
|
+ // Number(this.item.weightMultiple);
|
|
|
|
|
|
- let weight =
|
|
|
- Number(this.item.workReportInfo.formedNum) *
|
|
|
- Number(this.item.singleWeight) *
|
|
|
- Number(this.item.weightMultiple);
|
|
|
+ // if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
|
|
|
+ // weight = parseFloat((weight / 1000).toFixed(2));
|
|
|
+ // } else {
|
|
|
+ // weight = parseFloat(weight.toFixed(2));
|
|
|
+ // }
|
|
|
|
|
|
- if (['G', 'g', '克'].includes(this.item.singleWeightUnit)) {
|
|
|
- weight = parseFloat((weight / 1000).toFixed(2));
|
|
|
- } else {
|
|
|
- weight = parseFloat(weight.toFixed(2));
|
|
|
- }
|
|
|
+ // console.log(this.item, 'weight');
|
|
|
|
|
|
- console.log(this.item, 'weight');
|
|
|
-
|
|
|
- this.$set(this.item.workReportInfo, 'formedWeight', weight);
|
|
|
+ // this.$set(this.item.workReportInfo, 'formedWeight', weight);
|
|
|
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
@@ -425,7 +431,13 @@ export default {
|
|
|
|
|
|
|
|
|
changeNum() {
|
|
|
- this.notForme();
|
|
|
+ let total =this.item.workReportInfo.formedNum + this.item.workReportInfo.notFormedNum;
|
|
|
+ console.log('no111222',total)
|
|
|
+ if(total > this.item.formingNum){
|
|
|
+ this.item.workReportInfo.notFormedNum=0
|
|
|
+ this.$message.warning('合格品数量加不合格数量不能大于要求生产数量');
|
|
|
+ }
|
|
|
+ // this.notForme();
|
|
|
// this.blurNum()
|
|
|
}
|
|
|
}
|