Browse Source

修改数量为小数点后6位

wms3.0_pda
lijuncheng 10 months ago
parent
commit
cac690ddd2
  1. 21
      mycomponents/qty/CountQtyEdit.vue
  2. 19
      mycomponents/qty/balanceQtyEdit.vue
  3. 26
      mycomponents/qty/recommendQtyEdit.vue

21
mycomponents/qty/CountQtyEdit.vue

@ -38,7 +38,9 @@
<text>数量 : </text> <text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;"> <view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number" <input class="qty_input" v-model="allQty" :focus="true" type="number"
@mousedown="mousedown" /> @mousedown="mousedown"
@input="checkNum"
:maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom> <uom :uom="dataContent.uom"></uom>
</view> </view>
</view> </view>
@ -107,7 +109,8 @@
seconds: 0, seconds: 0,
timer: {}, timer: {},
showConfirmCountdown: false, showConfirmCountdown: false,
detaiList: [] detaiList: [],
maxlength: 10
} }
}, },
watch: { watch: {
@ -140,6 +143,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, detaiList) { openEditPopup(item, detaiList) {
this.dataContent = item this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus; this.inventoryStatus = this.dataContent.inventoryStatus;

19
mycomponents/qty/balanceQtyEdit.vue

@ -36,7 +36,7 @@
<text>数量 : </text> <text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;"> <view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number" <input class="qty_input" v-model="allQty" :focus="true" type="number"
@confirm="confirm()" /> @confirm="confirm()" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom> <uom :uom="dataContent.uom"></uom>
</view> </view>
</view> </view>
@ -94,7 +94,8 @@
inventoryStatus: "", inventoryStatus: "",
originalInventoryStatus: "", originalInventoryStatus: "",
dataContent: {}, dataContent: {},
handleQty: 0 handleQty: 0,
maxlength: 10
} }
}, },
watch: { watch: {
@ -123,6 +124,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, handleQty) { openEditPopup(item, handleQty) {
this.dataContent = item this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus this.inventoryStatus = this.dataContent.inventoryStatus

26
mycomponents/qty/recommendQtyEdit.vue

@ -31,12 +31,13 @@
</view> </view>
</view> </view>
<u-line /> <u-line />
<view class="uni-flex uni-row space-between padding title u-col-center"> <view class="uni-flex uni-row space-between padding title u-col-center">
<text>总数量 : </text> <text>总数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;"> <view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="false" type="number" <input class="qty_input" v-model="allQty" :focus="false" type="number"
@confirm="confirm()" /> @input="checkNum" @confirm="confirm()" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom> <uom :uom="dataContent.uom"></uom>
</view> </view>
</view> </view>
@ -69,7 +70,8 @@
allQty: 0, allQty: 0,
stdCount: 0, stdCount: 0,
labelQty: 0, labelQty: 0,
recommendQty: 0 recommendQty: 0,
maxlength: 10
} }
}, },
watch: { watch: {
@ -104,6 +106,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() { openEditPopup() {
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
@ -148,7 +164,8 @@
} else { } else {
if (this.recommendQty != 0) { if (this.recommendQty != 0) {
if (this.allQty > this.recommendQty) { if (this.allQty > this.recommendQty) {
if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty == "TRUE") { if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty ==
"TRUE") {
this.callback(); this.callback();
} else { } else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' + this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' +
@ -159,7 +176,8 @@
}) })
} }
} else if (this.allQty < this.recommendQty) { } else if (this.allQty < this.recommendQty) {
if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty == "TRUE") { if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty ==
"TRUE") {
this.callback(); this.callback();
} else { } else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' + this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' +

Loading…
Cancel
Save