|
|
|
@ -428,7 +428,7 @@ |
|
|
|
<el-col :span="3"> |
|
|
|
<div class="info-item"> |
|
|
|
<label>送检数量</label> |
|
|
|
<el-input-number :controls="false" :step="0" v-model="detailData.rollCount" size="small" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number :controls="false" :step="0" v-model="detailData.rollCount" @change="rollCountChange" size="small" style="width: 100%"></el-input-number> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3"> |
|
|
|
@ -441,7 +441,7 @@ |
|
|
|
<div class="info-item"> |
|
|
|
<label>合格数量</label> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-if="detailData.submitFlag === 'Y'" v-model="detailData.passQty" disabled size="small" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-else v-model="detailData.passQty" size="small" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number :controls="false" :step="0" min="0" v-else v-model="detailData.passQty" @change="passQtyChange" size="small" style="width: 100%"></el-input-number> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3"> |
|
|
|
@ -1220,6 +1220,11 @@ |
|
|
|
this.detailData.unqualifiedQty = num2 |
|
|
|
} |
|
|
|
}, |
|
|
|
'detailData.rollCount' () { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.enforcePassQtyNotExceedRollCount() |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
@ -2445,6 +2450,37 @@ |
|
|
|
} |
|
|
|
qcPrint(this.IQCSelections) |
|
|
|
}, |
|
|
|
rollCountChange () { |
|
|
|
const rollQty = Number(this.detailData.rollQty) |
|
|
|
const rollCount = this.detailData.rollCount |
|
|
|
if (rollCount != null) { |
|
|
|
const rc = Number(rollCount) |
|
|
|
if (!isNaN(rollQty) && !isNaN(rc) && rc > rollQty) { |
|
|
|
this.$set(this.detailData, 'rollCount', 0) |
|
|
|
this.$message.warning('送检数量不能大于到货数量!') |
|
|
|
} |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.enforcePassQtyNotExceedRollCount() |
|
|
|
}) |
|
|
|
}, |
|
|
|
passQtyChange () { |
|
|
|
this.enforcePassQtyNotExceedRollCount() |
|
|
|
}, |
|
|
|
enforcePassQtyNotExceedRollCount () { |
|
|
|
if (this.detailData.submitFlag === 'Y') return |
|
|
|
const passQty = this.detailData.passQty |
|
|
|
if (passQty == null) return |
|
|
|
const rollCount = this.detailData.rollCount |
|
|
|
const rc = Number(rollCount) |
|
|
|
const pq = Number(passQty) |
|
|
|
if (isNaN(pq)) return |
|
|
|
if (isNaN(rc)) return |
|
|
|
if (pq > rc) { |
|
|
|
this.$set(this.detailData, 'passQty', 0) |
|
|
|
this.$message.warning('合格数量不能大于送检数量!') |
|
|
|
} |
|
|
|
}, |
|
|
|
noBatchQualifiedQtyChange(){ |
|
|
|
if (this.detailData.noBatchQualifiedQty > this.detailData.rollQty) { |
|
|
|
// 恢复原值 |
|
|
|
|