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. 96
      pages/unPlanned/record/receiptRecord.vue
  6. 137
      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')
} }
} }

96
pages/unPlanned/record/receiptRecord.vue

@ -27,7 +27,7 @@
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation> :locationTypeList="tolocationTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
@ -37,7 +37,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'箱码'" headerType="HPQ,HMQ"></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'箱码'" headerType="HPQ,HMQ"></win-scan-pack>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
@ -66,8 +66,8 @@
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -102,10 +102,10 @@
detailSource: [], // detailSource: [], //
businessTypeCode: "UnplannedReceipt", businessTypeCode: "UnplannedReceipt",
reasonText: "", reasonText: "",
reasonCode:"", reasonCode: "",
reasonList: [], reasonList: [],
dataContent:{}, dataContent: {},
managementList:[] managementList: []
} }
}, },
@ -123,8 +123,7 @@
}); });
}, },
onLoad(option) { onLoad(option) {},
},
methods: { methods: {
openScanPopup() { openScanPopup() {
@ -188,7 +187,7 @@
// Object.assign(detail, label) // Object.assign(detail, label)
detail.qty = Number(label.qty) detail.qty = Number(label.qty)
detail.handleQty = 0, detail.handleQty = 0,
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
label.inventoryStatus = "OK"; label.inventoryStatus = "OK";
@ -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)
} }
} }
} }
@ -245,37 +244,37 @@
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
// //
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = []; this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams() var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => { getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
unPlannedReceiptRecordbSubmit(params).then(res => { unPlannedReceiptRecordbSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data) this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
}) } else {
}else { uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描") this.showErrorMessage("没有要提交的数据,请先扫描")
} }
@ -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,8 +339,8 @@
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)
} }
@ -364,13 +364,13 @@
this.clearData(); this.clearData();
}) })
}, },
clearData(){ clearData() {
this.reasonCode = "" this.reasonCode = ""
this.reasonText = ""; this.reasonText = "";
this.detailSource = []; this.detailSource = [];
this.managementList=[]; this.managementList = [];
this.dataContent ={} this.dataContent = {}
this.toLocationCode ="" this.toLocationCode = ""
} }

137
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,53 +141,54 @@
} }
if (type === "plus") { if (type === "plus") {
value += step; value = this.add(value, step)
if (value > (this.max * scale)) {
return;
}
if (value < (this.min * scale)) {
value = this.min * scale
}
}
this.inputValue = (value / scale).toFixed(String(scale).length - 1);
this.$emit("change", +this.inputValue);
// TODO vue2
this.$emit("input", +this.inputValue);
// TODO vue3
this.$emit("update:modelValue", +this.inputValue);
},
_getDecimalScale() {
let scale = 1; if (value > (this.max * scale)) {
//
if (~~this.step !== this.step) {
scale = Math.pow(10, String(this.step).split(".")[1].length);
}
return scale;
},
_onBlur(event) {
this.$emit('blur', event)
let value = event.detail.value;
if (!value) {
// this.inputValue = 0;
return; return;
} }
value = +value; if (value < (this.min * scale)) {
if (value > this.max) { value = this.min * scale
value = this.max;
} else if (value < this.min) {
value = this.min;
} }
const scale = this._getDecimalScale();
this.inputValue = value.toFixed(String(scale).length - 1);
this.$emit("change", +this.inputValue);
this.$emit("input", +this.inputValue);
},
_onFocus(event) {
this.$emit('focus', event)
} }
this.inputValue = (value / scale).toFixed(String(scale).length - 1);
this.$emit("change", +this.inputValue);
// TODO vue2
this.$emit("input", +this.inputValue);
// TODO vue3
this.$emit("update:modelValue", +this.inputValue);
},
_getDecimalScale() {
let scale = 1;
//
if (~~this.step !== this.step) {
scale = Math.pow(10, String(this.step).split(".")[1].length);
}
return scale;
},
_onBlur(event) {
this.$emit('blur', event)
let value = event.detail.value;
if (!value) {
// this.inputValue = 0;
return;
}
value = +value;
if (value > this.max) {
value = this.max;
} else if (value < this.min) {
value = this.min;
}
const scale = this._getDecimalScale();
this.inputValue = value.toFixed(String(scale).length - 1);
this.$emit("change", +this.inputValue);
this.$emit("input", +this.inputValue);
},
_onFocus(event) {
this.$emit('focus', event)
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save