Browse Source

修改计划外入库数量不对

wms3.0_pda
lijuncheng 10 months ago
parent
commit
f2b3494781
  1. 2
      mycomponents/scan/winScanItem.vue
  2. 26
      pages/issue/coms/comIssueRequestPopup.vue
  3. 198
      pages/productPutaway/coms/comProductRecord.vue
  4. 2
      pages/unPlanned/coms/comReceiptRecord.vue
  5. 10
      pages/unPlanned/record/receiptRecord.vue
  6. 57
      uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

2
mycomponents/scan/winScanItem.vue

@ -32,7 +32,7 @@
components: { components: {
winComScan winComScan
}, },
emits: ["getScanCode"], emits: ["getScanCode",'getScanResult'],
props: { props: {
title: { title: {
type: String, type: String,

26
pages/issue/coms/comIssueRequestPopup.vue

@ -41,10 +41,14 @@
<view class="uni-flex uni-row padding title u-col-center"> <view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text> <text>数量 </text>
<view class="uni-flex uni-row uni-center" <view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;"> style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
<input style="text-align: center;" class="qty_input" v-model="counQty" :focus="true" type="number"
@confirm="confirm()" @input="checkNum" :maxlength="maxlength" />
<!-- <uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'> :focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box> </uni-number-box> -->
<view class="std_pack" v-if="itemCode!='请扫描物料信息'"> <view class="std_pack" v-if="itemCode!='请扫描物料信息'">
<text> <text>
@ -123,6 +127,7 @@
isModifiedPosition: true, isModifiedPosition: true,
positionList: [], positionList: [],
stdQty: 0, // stdQty: 0, //
maxlength:10
} }
}, },
props: { props: {
@ -132,6 +137,21 @@
}, },
}, },
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;
}
this.change(value)
},
openRequestPopup(editPosition) { openRequestPopup(editPosition) {
if (this.positionList.length == 0) { if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => { getWorkShopLineStation().then(res => {

198
pages/productPutaway/coms/comProductRecord.vue

@ -1,198 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<!-- <balance :dataContent="item" :isShowStdPack="false" :isShowPack="true"
:isShowLocation="true"></balance> -->
<purchase-label :dataContent="item" :packageContent="item.package" :isShowStdPack="false">
</purchase-label>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm"></balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import record from '@/mycomponents/record/record.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
purchaseLabel,
balanceQtyEdit,
record,
comMessage
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
fromInventoryStatus: {
type: String,
default: ""
},
toInventoryStatus: {
type: String,
default: ""
},
isShowStatus: {
type: Boolean,
default: false
}
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('updateData')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
},
detail(item) {
this.showItem = item;
this.dataList = [{
title: "箱码",
content: item.packingNumber
},
{
title: "批次",
content: item.batch
},
{
title: "库位",
content: item.locationCode
},
{
title: "数量",
content: item.qty
},
{
title: "单位",
content: item.uom
}
]
this.$refs.winHint.openScanPopup()
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

2
pages/unPlanned/coms/comReceiptRecord.vue

@ -164,7 +164,7 @@
}); });
}, },
confirm(qty) { confirm(qty) {
this.editItem.qty = qty; this.editItem.label.qty = qty;
this.$emit('updateData') this.$emit('updateData')
} }
} }

10
pages/unPlanned/record/receiptRecord.vue

@ -123,8 +123,7 @@
}); });
}, },
onLoad(option) { onLoad(option) {},
},
methods: { methods: {
openScanPopup() { openScanPopup() {
@ -203,7 +202,7 @@
item.qty = 0; item.qty = 0;
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined) { if (detail != undefined) {
item.qty = calc.add(item.qty,detail.qty) item.qty = calc.add(item.qty, detail.label.qty)
} }
} }
} }
@ -315,7 +314,8 @@
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var submitItem = deepCopyData(detail) var submitItem = deepCopyData(detail)
var info = getPackingNumberAndBatchByList(this.managementList, detail.label.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.label
.itemCode,
detail.label.packingNumber, detail.toLocationCode, detail.label.batch); detail.label.packingNumber, detail.toLocationCode, detail.label.batch);
submitItem.itemCode = detail.package.itemCode; submitItem.itemCode = detail.package.itemCode;
@ -339,7 +339,7 @@
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.label.qty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

57
uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

@ -1,13 +1,14 @@
<template> <template>
<view class="uni-numbox"> <view class="uni-numbox">
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> <view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text> <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
:style="{color}">-</text>
</view> </view>
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number" <input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
:focus="focus" :focus="focus" v-model="inputValue" :style="{background, color}" @input="checkNum" :maxlength="maxlength" />
v-model="inputValue" :style="{background, color}" />
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> <view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text> <text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }"
:style="{color}">+</text>
</view> </view>
</view> </view>
</template> </template>
@ -27,7 +28,9 @@
* @event {Function} focus 输入框聚焦时触发的事件参数为 event 对象 * @event {Function} focus 输入框聚焦时触发的事件参数为 event 对象
* @event {Function} blur 输入框失焦时触发的事件参数为 event 对象 * @event {Function} blur 输入框失焦时触发的事件参数为 event 对象
*/ */
import {
Decimal
} from 'decimal.js'; //
export default { export default {
name: "UniNumberBox", name: "UniNumberBox",
emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'], emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],
@ -71,26 +74,55 @@
}, },
data() { data() {
return { return {
inputValue: 0 inputValue: 0,
maxlength: 10
}; };
}, },
watch: { watch: {
value(val) { value(val) {
this.inputValue = +val; this.inputValue = this.add(this.inputValue, val)
}, },
modelValue(val) { modelValue(val) {
this.inputValue = +val; this.inputValue = this.add(this.inputValue, val)
} }
}, },
created() { created() {
if (this.value === 1) { if (this.value === 1) {
this.inputValue = +this.modelValue; this.inputValue = this.add(this.inputValue, this.modelValue)
} }
if (this.modelValue === 1) { if (this.modelValue === 1) {
this.inputValue = +this.value; this.inputValue = this.add(this.inputValue, this.value)
} }
}, },
methods: { methods: {
add(num1, num2) {
return new Decimal(num1).add(new Decimal(num2))
},
sub(num1, num2) {
return new Decimal(num1).sub(new Decimal(num2))
},
mul(num1,num2) {
return new Decimal(num1).mul(new Decimal(num2))
},
div(num1,num2) {
return new Decimal(num1).div(new Decimal(num2))
},
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;
}
},
_calcValue(type) { _calcValue(type) {
if (this.disabled) { if (this.disabled) {
return; return;
@ -99,7 +131,7 @@
let value = this.inputValue * scale; let value = this.inputValue * scale;
let step = this.step * scale; let step = this.step * scale;
if (type === "minus") { if (type === "minus") {
value -= step; value = this.sub(value - step)
if (value < (this.min * scale)) { if (value < (this.min * scale)) {
return; return;
} }
@ -109,7 +141,8 @@
} }
if (type === "plus") { if (type === "plus") {
value += step; value = this.add(value, step)
if (value > (this.max * scale)) { if (value > (this.max * scale)) {
return; return;
} }

Loading…
Cancel
Save