|
|
@ -17,7 +17,7 @@ |
|
|
|
<view class="list_cell uni-flex uni-row space-between"> |
|
|
|
<view class="title">不合格数量</view> |
|
|
|
<view class="uni-flex uni-row u-col-center" style=""> |
|
|
|
<input class="qty_inspect_input" v-model="dataContent.failedQty" :focus="true" type="number" /> |
|
|
|
<input class="qty_inspect_input" v-model="dataContent.failedQty" :focus="true" type="number" @input="checkNum" :maxlength="maxlength" /> |
|
|
|
<uom :uom="dataContent.uom"></uom> |
|
|
|
</view> |
|
|
|
|
|
|
@ -25,7 +25,7 @@ |
|
|
|
<view class="list_cell uni-flex uni-row space-between"> |
|
|
|
<view class="title">报废数量</view> |
|
|
|
<view class="uni-flex uni-row u-col-center" style=""> |
|
|
|
<input class="qty_inspect_input" v-model="dataContent.crackQty" :focus="true" type="number" /> |
|
|
|
<input class="qty_inspect_input" v-model="dataContent.crackQty" :focus="true" type="number" @input="checkNum" :maxlength="maxlength" /> |
|
|
|
<uom :uom="dataContent.uom"></uom> |
|
|
|
</view> |
|
|
|
|
|
|
@ -68,9 +68,13 @@ |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
deepCopyData |
|
|
|
deepCopyData, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
calc, |
|
|
|
} from '@/common/calc.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
uploadFile, |
|
|
|
getFileList, |
|
|
@ -94,7 +98,8 @@ |
|
|
|
failedReasonArray: [], |
|
|
|
dataContent: {}, |
|
|
|
inspectResultArray: [], |
|
|
|
picInfoList: [] |
|
|
|
picInfoList: [], |
|
|
|
maxlength: 10 |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
@ -110,6 +115,20 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
checkNum(e) { |
|
|
|
let value = e.detail.value; |
|
|
|
let dot = value.indexOf('.'); //包含小数点 |
|
|
|
let reg = /^[0-9]+$/; //正整数 |
|
|
|
if (dot > -1) { |
|
|
|
this.maxlength = dot + 7; //长度是小数点后两位 |
|
|
|
if (value.length > dot + 7) { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (reg.test(value)) { //如果是正整数不包含小数点 |
|
|
|
this.maxlength = 10; |
|
|
|
} |
|
|
|
}, |
|
|
|
openEditPopup(item) { |
|
|
|
this.failedReasonArray = getInspectFailedReasonList(); |
|
|
|
this.inspectResultArray =getInspectResultList() |
|
|
@ -222,8 +241,8 @@ |
|
|
|
var failedQty = Number(this.dataContent.failedQty); |
|
|
|
var crackQty = Number(this.dataContent.crackQty); |
|
|
|
var qty = Number(this.dataContent.qty); |
|
|
|
if (crackQty + failedQty > qty) { |
|
|
|
var total = crackQty + failedQty; |
|
|
|
if (calc.add(crackQty,failedQty)> qty) { |
|
|
|
var total = calc.add(crackQty,failedQty) |
|
|
|
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" + |
|
|
|
qty + "]") |
|
|
|
return |
|
|
@ -242,7 +261,8 @@ |
|
|
|
|
|
|
|
this.dataContent.failedQty = failedQty; |
|
|
|
this.dataContent.crackQty = crackQty |
|
|
|
this.dataContent.goodQty = this.dataContent.handleQty - failedQty - crackQty |
|
|
|
var temp=calc.sub(this.dataContent.handleQty,failedQty); |
|
|
|
this.dataContent.goodQty =calc.sub(temp,failedQty,crackQty); |
|
|
|
this.afterSave() |
|
|
|
|
|
|
|
|
|
|
|