Browse Source

修改计划外入库数量不对

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

2
mycomponents/scan/winScanItem.vue

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

28
pages/issue/coms/comIssueRequestPopup.vue

@ -37,14 +37,18 @@
</view>
</view>
<u-line />
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;">
<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'>
</uni-number-box>
</uni-number-box> -->
<view class="std_pack" v-if="itemCode!='请扫描物料信息'">
<text>
@ -123,6 +127,7 @@
isModifiedPosition: true,
positionList: [],
stdQty: 0, //
maxlength:10
}
},
props: {
@ -132,6 +137,21 @@
},
},
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) {
if (this.positionList.length == 0) {
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) {
this.editItem.qty = qty;
this.editItem.label.qty = qty;
this.$emit('updateData')
}
}

140
pages/unPlanned/record/receiptRecord.vue

@ -22,12 +22,12 @@
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
@ -37,7 +37,7 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</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>
</view>
</template>
@ -55,7 +55,7 @@
import {
unPlannedReceiptRecordbSubmit
} from '@/api/request2.js';
import {
getDirectoryItemArray,
getUnPlannedReceiptReasonList
@ -64,17 +64,17 @@
import {
getBusinessType,
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
calc
} from '@/common/calc.js';
import {
goHome,
updateTitle,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
@ -102,10 +102,10 @@
detailSource: [], //
businessTypeCode: "UnplannedReceipt",
reasonText: "",
reasonCode:"",
reasonCode: "",
reasonList: [],
dataContent:{},
managementList:[]
dataContent: {},
managementList: []
}
},
@ -123,8 +123,7 @@
});
},
onLoad(option) {
},
onLoad(option) {},
methods: {
openScanPopup() {
@ -188,7 +187,7 @@
// Object.assign(detail, label)
detail.qty = Number(label.qty)
detail.handleQty = 0,
detail.inventoryStatus = "OK"
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
label.inventoryStatus = "OK";
@ -203,7 +202,7 @@
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty,detail.qty)
item.qty = calc.add(item.qty, detail.label.qty)
}
}
}
@ -242,44 +241,44 @@
this.showErrorMessage("请选择入库原因")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
unPlannedReceiptRecordbSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
}else {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
unPlannedReceiptRecordbSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
@ -301,47 +300,48 @@
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
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);
submitItem.itemCode = detail.package.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
// detail.fromContainerNumber = detail.containerNumber;
// detail.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = "";
submitItem.toLocationCode = detail.toLocationCode;
submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
submitItem.qty = detail.label.qty;
submitItem.package = "";
subList.push(submitItem)
}
})
@ -364,16 +364,16 @@
this.clearData();
})
},
clearData(){
clearData() {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.managementList=[];
this.dataContent ={}
this.toLocationCode =""
this.managementList = [];
this.dataContent = {}
this.toLocationCode = ""
}
}
}
</script>

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

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

Loading…
Cancel
Save