Browse Source

全检数量编辑修改精度

wms3.0_pda
lijuncheng 10 months ago
parent
commit
db3f850b7b
  1. 34
      pages/inspect/coms/inspectEdit.vue

34
pages/inspect/coms/inspectEdit.vue

@ -17,7 +17,7 @@
<view class="list_cell uni-flex uni-row space-between"> <view class="list_cell uni-flex uni-row space-between">
<view class="title">不合格数量</view> <view class="title">不合格数量</view>
<view class="uni-flex uni-row u-col-center" style=""> <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> <uom :uom="dataContent.uom"></uom>
</view> </view>
@ -25,7 +25,7 @@
<view class="list_cell uni-flex uni-row space-between"> <view class="list_cell uni-flex uni-row space-between">
<view class="title">报废数量</view> <view class="title">报废数量</view>
<view class="uni-flex uni-row u-col-center" style=""> <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> <uom :uom="dataContent.uom"></uom>
</view> </view>
@ -68,9 +68,13 @@
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
deepCopyData deepCopyData,
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc,
} from '@/common/calc.js';
import { import {
uploadFile, uploadFile,
getFileList, getFileList,
@ -94,7 +98,8 @@
failedReasonArray: [], failedReasonArray: [],
dataContent: {}, dataContent: {},
inspectResultArray: [], inspectResultArray: [],
picInfoList: [] picInfoList: [],
maxlength: 10
} }
}, },
props: { props: {
@ -110,6 +115,20 @@
}, },
methods: { 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) { openEditPopup(item) {
this.failedReasonArray = getInspectFailedReasonList(); this.failedReasonArray = getInspectFailedReasonList();
this.inspectResultArray =getInspectResultList() this.inspectResultArray =getInspectResultList()
@ -222,8 +241,8 @@
var failedQty = Number(this.dataContent.failedQty); var failedQty = Number(this.dataContent.failedQty);
var crackQty = Number(this.dataContent.crackQty); var crackQty = Number(this.dataContent.crackQty);
var qty = Number(this.dataContent.qty); var qty = Number(this.dataContent.qty);
if (crackQty + failedQty > qty) { if (calc.add(crackQty,failedQty)> qty) {
var total = crackQty + failedQty; var total = calc.add(crackQty,failedQty)
this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" + this.showMessage("不合格数[" + failedQty + "]+报废数量[" + crackQty + "]等于[" + total + "]大于收货数量[" +
qty + "]") qty + "]")
return return
@ -242,7 +261,8 @@
this.dataContent.failedQty = failedQty; this.dataContent.failedQty = failedQty;
this.dataContent.crackQty = crackQty 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() this.afterSave()

Loading…
Cancel
Save