Browse Source

修改记录提交数字精度

wms3.0_pda
lijuncheng 10 months ago
parent
commit
47b9e9617d
  1. 2
      common/record.js
  2. 1
      mycomponents/qty/balanceQtyEdit.vue
  3. 2
      pages/container/record/containerUnBindRecord.vue
  4. 3
      pages/deliver/coms/comDeliverRequestPopup.vue
  5. 5
      pages/deliver/record/deliverRecord.vue
  6. 2
      pages/inventoryMove/coms/comMoveRecord.vue
  7. 3
      pages/issue/coms/comIssueRequestPopup.vue
  8. 2
      pages/package/record/mergePackageRecord.vue
  9. 2
      pages/package/record/overPackageRecord.vue
  10. 2
      pages/productPutaway/record/productPutawayRecord.vue
  11. 15
      pages/productPutaway/request/putawayRequestCreate.vue
  12. 19
      pages/productReceipt/record/productReceiptRecord.vue
  13. 1
      pages/productionReceipt/record/productionReceiptRecord.vue
  14. 13
      pages/productionReturn/coms/comReturnRecord.vue
  15. 67
      pages/productionReturn/record/returnToHold.vue
  16. 21
      pages/productionReturn/record/returnToStore.vue
  17. 5
      pages/purchaseReturn/record/returnRecord.vue
  18. 8
      pages/purchaseReturn/request/returnRequestCreate.vue
  19. 2
      pages/putaway/record/putawayRecord.vue
  20. 2
      pages/repleinsh/record/repleinshRecord.vue
  21. 18
      pages/scrap/record/scrapRecord.vue
  22. 4
      pages/scrap/request/scrapRequestCreate.vue
  23. 2
      pages/transfer/record/deliverRecord.vue
  24. 2
      pages/transfer/record/receiptRecord.vue
  25. 11
      pages/unPlanned/coms/comReceiptRecord.vue
  26. 34
      pages/unPlanned/coms/comReceiptRequestPopup.vue
  27. 2
      pages/unPlanned/record/issueRecord.vue
  28. 20
      pages/unPlanned/record/receiptRecord.vue
  29. 15
      pages/unPlanned/request/issueRequestCreate.vue
  30. 16
      pages/unPlanned/request/receiptRequestCreate.vue

2
common/record.js

@ -34,7 +34,7 @@ export function createDetailInfo(balance, pack) {
detail.qty = new Decimal(detail.qty).toNumber(); detail.qty = new Decimal(detail.qty).toNumber();
detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber() detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber()
detail.stdPackUnit = pack.stdPackUnit detail.stdPackUnit = pack.stdPackUnit
detail.handleQty = new Decimal(detail.qty).toNumber() ; detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.package = pack; detail.package = pack;
return detail; return detail;

1
mycomponents/qty/balanceQtyEdit.vue

@ -141,6 +141,7 @@
openEditPopup(item, handleQty) { openEditPopup(item, handleQty) {
this.dataContent = item this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus this.inventoryStatus = this.dataContent.inventoryStatus
this.originalInventoryStatus =this.dataContent.inventoryStatus;
this.toInventoryStatus = this.dataContent.toInventoryStatus this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = handleQty this.allQty = handleQty
setTimeout(res => { setTimeout(res => {

2
pages/container/record/containerUnBindRecord.vue

@ -301,7 +301,7 @@
detail.itemCode = detail.itemCode; detail.itemCode = detail.itemCode;
detail.batch = detail.batch; detail.batch = detail.batch;
detail.inventoryStatus = detail.inventoryStatus; detail.inventoryStatus = detail.inventoryStatus;
detail.qty =detail.handleQty;
detail.package = null; detail.package = null;
subList.push(detail) subList.push(detail)
} }

3
pages/deliver/coms/comDeliverRequestPopup.vue

@ -42,7 +42,7 @@
<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="align-items: center;margin-left: 20rpx;">
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number" <input style="text-align: center;" class="qty_input" v-model="qty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" /> @confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom> <uom :uom="uom"></uom>
@ -162,6 +162,7 @@
this.itemCode = ""; this.itemCode = "";
this.uom = "" this.uom = ""
this.qty = 0 this.qty = 0
this.counQty =0;
this.itemCodeGetFocus(); this.itemCodeGetFocus();
} }

5
pages/deliver/record/deliverRecord.vue

@ -172,9 +172,8 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance.qty, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
if(labelQty)
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -380,7 +379,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)

2
pages/inventoryMove/coms/comMoveRecord.vue

@ -421,7 +421,7 @@
submitItem.package = null; submitItem.package = null;
submitItem.Records = null; submitItem.Records = null;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
subList.push(submitItem) subList.push(submitItem)
} }

3
pages/issue/coms/comIssueRequestPopup.vue

@ -163,7 +163,8 @@
} else { } else {
this.itemCode = ""; this.itemCode = "";
this.uom = "" this.uom = ""
this.qty = 0 this.qty = 0;
this.count = 0;
this.itemCodeGetFocus(); this.itemCodeGetFocus();
} }

2
pages/package/record/mergePackageRecord.vue

@ -271,7 +271,7 @@
detail.fromInventoryStatus = detail.inventoryStatus; detail.fromInventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = detail.inventoryStatus; detail.toInventoryStatus = detail.inventoryStatus;
detail.fromQty = detail.qty detail.fromQty = detail.handleQty
detail.fromPackingNumber = detail.packingNumber; detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = this.toPackingNumber; detail.toPackingNumber = this.toPackingNumber;

2
pages/package/record/overPackageRecord.vue

@ -262,7 +262,7 @@
subItem.itemDesc2 = detail.package.itemDesc2; subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = detail.inventoryStatus; subItem.fromInventoryStatus = detail.inventoryStatus;
subItem.fromQty = detail.qty subItem.fromQty = detail.handleQty
subItem.fromPackingNumber = detail.packingNumber; subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch; subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode; subItem.fromLocationCode = detail.locationCode;

2
pages/productPutaway/record/productPutawayRecord.vue

@ -335,7 +335,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)
} }

15
pages/productPutaway/request/putawayRequestCreate.vue

@ -53,6 +53,7 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
deepCopyData,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -210,14 +211,7 @@
}, },
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { calcHandleQty(this.detailSource)
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty,detail.qty)
}
}
}
this.$forceUpdate(); this.$forceUpdate();
}, },
@ -283,7 +277,7 @@
productPutawayRequestSubmit(params).then(res => { productPutawayRequestSubmit(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 + "]")
} }
@ -305,8 +299,7 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {}; var subItem = deepCopyData(detail)
Object.assign(subItem, detail)
subItem.fromLocationCode = detail.locationCode; subItem.fromLocationCode = detail.locationCode;
subItem.qty = detail.handleQty; subItem.qty = detail.handleQty;
subItem.package = null; subItem.package = null;

19
pages/productReceipt/record/productReceiptRecord.vue

@ -65,6 +65,8 @@
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
@ -186,8 +188,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty), qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
@ -195,11 +197,10 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = 0; detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -211,10 +212,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
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.handleQty = calc.add(item.handleQty,detail.handleQty)
} }
} }
} }
@ -331,7 +332,7 @@
submitItem.productionlineCode = this.productionLineCode; submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode; submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

1
pages/productionReceipt/record/productionReceiptRecord.vue

@ -316,6 +316,7 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.fromLocationCode = '';
this.toLocationCode =""
}) })
}, },

13
pages/productionReturn/coms/comReturnRecord.vue

@ -5,8 +5,7 @@
<template v-slot:title> <template v-slot:title>
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions"> <uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" <item-qty :dataContent="dataContent" :showItemQty="false" :isShowBalance="true"></item-qty>
:isShowBalance="true"></item-qty>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -17,7 +16,7 @@
<uni-swipe-action-item @click="swipeClick($event,item,index)" <uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true" <balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true"
:isShowFromLocation="true" :isShowToLocation="isShowToLocation"></balance> :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package" <!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false"> :isShowLocation="false">
</production-label> --> </production-label> -->
@ -86,6 +85,10 @@
isShowToLocation: { isShowToLocation: {
type: Boolean, type: Boolean,
default: true default: true
},
isShowFromLocation: {
type: Boolean,
default: true
} }
}, },
watch: { watch: {
@ -147,7 +150,7 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.recommendQtyEdit.openRecordEditPopup(item.qty); this.$refs.recommendQtyEdit.openRecordEditPopup(item.handleQty);
// this.$refs.recommendQtyEdit.openEditPopup(item.qty); // this.$refs.recommendQtyEdit.openEditPopup(item.qty);
}, },
@ -165,7 +168,7 @@
}); });
}, },
confirm(qty) { confirm(qty) {
this.editItem.qty = qty; this.editItem.handleQty = qty;
this.$emit('updateData') this.$emit('updateData')
} }
} }

67
pages/productionReturn/record/returnToHold.vue

@ -67,6 +67,10 @@
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import {
Decimal
} from 'decimal.js'; //
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
@ -168,7 +172,7 @@
this.$refs.scanPopup.openScanPopup(isEditPosition); this.$refs.scanPopup.openScanPopup(isEditPosition);
}, },
async getScanResult(result, param) { async getScanResult(result, param) {
this.positionInfo = param.positionInfo; this.positionInfo = param.positionInfo;
this.workshopCode = param.workshopCode; this.workshopCode = param.workshopCode;
this.productionLineCode = param.productionLineCode; this.productionLineCode = param.productionLineCode;
@ -186,26 +190,26 @@
if (item == undefined) { if (item == undefined) {
var filters = [] var filters = []
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
action: "==", action: "==",
value: label.itemCode value: label.itemCode
}) })
filters.push({ filters.push({
column: "locationCode", column: "locationCode",
action: "==", action: "==",
value: this.rawLocationCode value: this.rawLocationCode
}) })
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
} }
var isCheckItemCode = await getBalanceByFilter(params); var isCheckItemCode = await getBalanceByFilter(params);
if(isCheckItemCode.data==null||isCheckItemCode.data.list==0){ if (isCheckItemCode.data == null || isCheckItemCode.data.list == 0) {
this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" + this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" +
"库位[" + this.rawLocationCode + "]的信息") "库位[" + this.rawLocationCode + "]的信息")
return return
} }
@ -247,8 +251,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty), qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
@ -256,11 +260,10 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = 0; detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -273,10 +276,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
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.handleQty = calc.add(item.handleQty, detail.handleQty)
} }
} }
} }
@ -421,9 +424,11 @@
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var submitItem = deepCopyData(detail) var submitItem = deepCopyData(detail)
var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode, var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail
.itemCode,
detail.packingNumber, detail.fromLocationCode, detail.batch); detail.packingNumber, detail.fromLocationCode, detail.batch);
var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode, var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail
.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
submitItem.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
@ -448,7 +453,7 @@
submitItem.productionlineCode = this.productionLineCode; submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode; submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
subList.push(submitItem) subList.push(submitItem)
} }

21
pages/productionReturn/record/returnToStore.vue

@ -15,6 +15,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comReturnRecord :dataContent="item" :index="index" @removeItem="removeItem(index,item)" <comReturnRecord :dataContent="item" :index="index" @removeItem="removeItem(index,item)"
:isShowFromLocation="false"
@updateData="updateData" @removePack="removePack"> @updateData="updateData" @removePack="removePack">
</comReturnRecord> </comReturnRecord>
</view> </view>
@ -62,6 +63,8 @@
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
@ -215,6 +218,7 @@
newDetail.toWarehouseCode = toLocation.warehouseCode; newDetail.toWarehouseCode = toLocation.warehouseCode;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.calcHandleQty();
}) })
} else { } else {
@ -232,6 +236,7 @@
newDetail.fromLocationCode = this.rawLocationCode; newDetail.fromLocationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode; newDetail.toWarehouseCode = toLocation.warehouseCode;
item.subList.push(newDetail); item.subList.push(newDetail);
this.calcHandleQty();
}); });
} else { } else {
@ -240,7 +245,6 @@
} }
} }
} }
this.calcHandleQty();
}, },
createItemInfo(label, pack) { createItemInfo(label, pack) {
let item = { let item = {
@ -248,8 +252,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty), qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
@ -257,11 +261,10 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty =0; detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -274,10 +277,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
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.handleQty = calc.add(item.handleQty,detail.handleQty)
} }
} }
} }

5
pages/purchaseReturn/record/returnRecord.vue

@ -241,7 +241,6 @@
}); });
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
// //
// //
@ -254,7 +253,7 @@
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()
@ -290,7 +289,7 @@
submitItem.fromLocationCode = this.fromLocationCode; submitItem.fromLocationCode = this.fromLocationCode;
submitItem.toLocationCode = ''; //退 submitItem.toLocationCode = ''; //退
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }

8
pages/purchaseReturn/request/returnRequestCreate.vue

@ -45,6 +45,7 @@
goHome, goHome,
updateTitle, updateTitle,
navigateBack, navigateBack,
deepCopyData,
getCurrDateOneMonthsTimes getCurrDateOneMonthsTimes
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -209,7 +210,6 @@
commit() { commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -240,11 +240,13 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var submitItem = deepCopyData(detail)
if(supplierCode==""){ if(supplierCode==""){
supplierCode = detail.package.supplierCode supplierCode = detail.package.supplierCode
} }
detail.fromLocationCode = detail.locationCode submitItem.fromLocationCode = detail.locationCode
subList.push(detail) submitItem.qty =detail.handleQty;
subList.push(submitItem)
} }
}) })
}) })

2
pages/putaway/record/putawayRecord.vue

@ -386,7 +386,7 @@
// detail.toInventoryStatus = detail.inventoryStatus // detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode // detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty ;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }

2
pages/repleinsh/record/repleinshRecord.vue

@ -72,8 +72,6 @@
import { import {
getBusinessType, getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';

18
pages/scrap/record/scrapRecord.vue

@ -18,7 +18,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" :isShowFromLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
:isShowToLocation="false" :isShowToLocation="false"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
@ -176,20 +176,6 @@
}, },
createItemInfo(balance, pack) {
let item = {
itemCode: balance.itemCode,
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: Number(balance.qty),
handleQty: 0,
uom: pack.uom,
subList: []
}
return item;
},
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
@ -297,7 +283,7 @@
submitItem.toLocationCode = ""; submitItem.toLocationCode = "";
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)
} }

4
pages/scrap/request/scrapRequestCreate.vue

@ -17,7 +17,9 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" :isShowFromLocation="true"
:isShowToLocation="false"
@removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>

2
pages/transfer/record/deliverRecord.vue

@ -334,7 +334,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

2
pages/transfer/record/receiptRecord.vue

@ -316,7 +316,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

11
pages/unPlanned/coms/comReceiptRecord.vue

@ -5,7 +5,7 @@
<template v-slot:title> <template v-slot:title>
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions"> <uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" <item-qty :dataContent="dataContent" :showItemQty="false"
:isShowBalance="true"></item-qty> :isShowBalance="true"></item-qty>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -16,9 +16,8 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)" <uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<purchase-label :dataContent="item.label" :packageContent="item.package" <balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true"
:isShowLocation="false"> :isShowFromLocation="false" :isShowToLocation="false"></balance>
</purchase-label>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<!-- <u-line color="#D8D8D8"></u-line> --> <!-- <u-line color="#D8D8D8"></u-line> -->
@ -147,7 +146,7 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.qtyEdit.openRecordEditPopup(item.label.qty); this.$refs.qtyEdit.openRecordEditPopup(item.handleQty);
}, },
detail(packageInfo) { detail(packageInfo) {
@ -164,7 +163,7 @@
}); });
}, },
confirm(qty) { confirm(qty) {
this.editItem.label.qty = qty; this.editItem.handleQty = qty;
this.$emit('updateData') this.$emit('updateData')
} }
} }

34
pages/unPlanned/coms/comReceiptRequestPopup.vue

@ -48,10 +48,13 @@
<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="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;' <input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
:focus="numberFocus" @blur='numberFocus = false'> @confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
</uni-number-box>
<uom :uom="uom"></uom> <uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view> </view>
</view> </view>
@ -65,7 +68,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<win-scan-item ref="itemPopup" title='物料代码' @getScanCode='getItemCode'> <win-scan-item ref="itemPopup" title='物料代码' @getScanResult='getItemCode'>
</win-scan-item> </win-scan-item>
<winScanLocation ref="locationPopup" title="库位代码" @getLocation='getLocationCode'></winScanLocation> <winScanLocation ref="locationPopup" title="库位代码" @getLocation='getLocationCode'></winScanLocation>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -82,6 +85,7 @@
checkDirectoryItemExist checkDirectoryItemExist
} from '@/common/directory.js'; } from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue' import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@ -90,6 +94,7 @@
export default { export default {
components: { components: {
uom, uom,
stdPackQty,
balanceStatus, balanceStatus,
comMessage, comMessage,
winScanItem, winScanItem,
@ -112,6 +117,8 @@
toLocationCode: '请扫描库位信息', toLocationCode: '请扫描库位信息',
isCheckLocationCode: false, isCheckLocationCode: false,
editPosition: true, editPosition: true,
maxlength:10,
stdPackInfo:undefined
} }
}, },
props: { props: {
@ -121,12 +128,28 @@
}, },
}, },
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) {
this.editPosition = editPosition; this.editPosition = editPosition;
if (!editPosition) { if (!editPosition) {
this.itemCode = ""; this.itemCode = "";
this.uom = "" this.uom = ""
this.qty = 0 this.qty = 0
this.count = 0;
this.itemCodeGetFocus(); this.itemCodeGetFocus();
} }
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
@ -231,13 +254,14 @@
this.closeRequestPopup(); this.closeRequestPopup();
}, },
getItemCode(code) { getItemCode(code, scanResult) {
if (code == "") { if (code == "") {
this.showErrorMessage('物料号不能为空') this.showErrorMessage('物料号不能为空')
return; return;
} }
this.itemCode = ""; this.itemCode = "";
this.checkItemCode(code) this.checkItemCode(code)
this.stdPackInfo = scanResult.package;
}, },
getLocationCode(location, code) { getLocationCode(location, code) {
this.toLocationCode = code; this.toLocationCode = code;

2
pages/unPlanned/record/issueRecord.vue

@ -255,7 +255,7 @@
submitItem.toLocationCode = ""; submitItem.toLocationCode = "";
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)

20
pages/unPlanned/record/receiptRecord.vue

@ -68,6 +68,8 @@
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -173,8 +175,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: label.qty, qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: label.uom, uom: label.uom,
subList: [] subList: []
} }
@ -182,12 +184,12 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
detail.scaned = true; detail.scaned = true;
// Object.assign(detail, label) // Object.assign(detail, label)
detail.qty = Number(label.qty) detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = 0, detail.handleQty = new Decimal(label.qty).toNumber();
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";
@ -199,10 +201,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
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.label.qty) item.handleQty = calc.add(item.handleQty, detail.handleQty)
} }
} }
} }
@ -339,7 +341,7 @@
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.label.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

15
pages/unPlanned/request/issueRequestCreate.vue

@ -18,7 +18,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" <record-com-detail-card :dataContent="item" :index="index"
@removeItem="removeItem(index,item)" @updateData="updateData" :isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" :isShowFromLocation="true" :isShowToLocation="false"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -78,6 +78,7 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
deepCopyData,
getCurrDateTimes, getCurrDateTimes,
getCurrDateOneMonthsTimes, getCurrDateOneMonthsTimes,
navigateBack navigateBack
@ -255,16 +256,18 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.fromLocationCode = detail.locationCode; var submitItem = deepCopyData(detail)
detail.reason = this.reasonCode; submitItem.fromLocationCode = detail.locationCode;
detail.containerNumber =""; submitItem.reason = this.reasonCode;
subList.push(detail) submitItem.containerNumber ="";
submitItem.qty = detail.handleQty;
subList.push(submitItem)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.status = 1; this.dataContent.status = "1";
this.dataContent.requestTime = getCurrDateTimes(); this.dataContent.requestTime = getCurrDateTimes();
this.dataContent.dueTime = getCurrDateOneMonthsTimes(); this.dataContent.dueTime = getCurrDateOneMonthsTimes();

16
pages/unPlanned/request/receiptRequestCreate.vue

@ -58,6 +58,7 @@
getISODateTime, getISODateTime,
navigateBack, navigateBack,
getBatch, getBatch,
deepCopyData,
getCurrDateTimes, getCurrDateTimes,
getCurrDateOneMonthsTimes getCurrDateOneMonthsTimes
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -186,16 +187,17 @@
setRequestParams() { setRequestParams() {
var subList = [] var subList = []
this.detailSource.subList.forEach(detail => { this.detailSource.subList.forEach(detail => {
detail.toLocationCode = this.detailSource.toLocationCode; var submitItem = deepCopyData(detail)
detail.reason = this.reasonCode; submitItem.toLocationCode = this.detailSource.toLocationCode;
detail.containerNumber = ""; submitItem.reason = this.reasonCode;
detail.batch = getBatch(); submitItem.containerNumber = "";
detail.inventoryStatus = "OK"; submitItem.batch = getBatch();
submitItem.inventoryStatus = "OK";
console.log("", getBatch()) console.log("", getBatch())
subList.push(detail) subList.push(submitItem)
}) })
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.status = 1; this.dataContent.status = "1";
this.dataContent.requestTime = getCurrDateTimes(); this.dataContent.requestTime = getCurrDateTimes();
this.dataContent.dueTime = getCurrDateOneMonthsTimes(); this.dataContent.dueTime = getCurrDateOneMonthsTimes();

Loading…
Cancel
Save