Browse Source

修改数据精度问题

wms3.0_pda
lijuncheng 10 months ago
parent
commit
1ac633ed43
  1. 6
      pages/container/record/containerBindRecord.vue
  2. 6
      pages/container/record/containerUnBindRecord.vue
  3. 21
      pages/count/job/countDetail.vue
  4. 30
      pages/count/record/countRecord.vue
  5. 82
      pages/deliver/coms/comScanDeliverPack.vue
  6. 30
      pages/deliver/job/deliverDetail.vue
  7. 8
      pages/deliver/request/deliverRequestCreate.vue
  8. 20
      pages/inspect/job/inspectFullDetail.vue
  9. 20
      pages/issue/coms/comScanIssuePack.vue
  10. 38
      pages/issue/job/issueDetail.vue
  11. 5
      pages/issue/js/issue.js
  12. 22
      pages/issue/record/issueRecord.vue
  13. 17
      pages/issue/request/issueRequestCreate.vue
  14. 20
      pages/package/record/splitPackageRecord.vue
  15. 6
      pages/productPutaway/request/putawayRequestCreate.vue
  16. 16
      pages/productReceipt/record/productReceiptRecord.vue
  17. 8
      pages/productionReturn/coms/comReturn.vue
  18. 63
      pages/productionReturn/coms/comScanReturnPack.vue
  19. 34
      pages/productionReturn/request/returnRequestCreate.vue
  20. 9
      pages/putaway/record/putawayRecord.vue
  21. 9
      pages/putaway/request/putawayRequestCreate.vue
  22. 6
      pages/query/container.vue
  23. 6
      pages/query/location.vue
  24. 6
      pages/query/location_copy.vue
  25. 6
      pages/repleinsh/coms/comScanReplishPack.vue
  26. 10
      pages/repleinsh/job/repleinshDetail.vue
  27. 47
      pages/repleinsh/record/repleinshRecord.vue
  28. 12
      pages/transfer/job/transferDetail.vue
  29. 6
      pages/unPlanned/record/receiptRecord.vue
  30. 53
      pages/unPlanned/request/receiptRequestCreate.vue

6
pages/container/record/containerBindRecord.vue

@ -57,6 +57,10 @@
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
@ -226,7 +230,7 @@
item.subList.push(newDetail); item.subList.push(newDetail);
items.push(item) items.push(item)
} else { } else {
item.qty += detail.qty item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); // let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail); item.subList.push(newDetail);
} }

6
pages/container/record/containerUnBindRecord.vue

@ -51,6 +51,10 @@
import { import {
goHome goHome
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getDirectoryItemArray getDirectoryItemArray
@ -171,7 +175,7 @@
item.subList.push(newDetail); item.subList.push(newDetail);
items.push(item) items.push(item)
} else { } else {
item.qty += detail.qty item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); // let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail); item.subList.push(newDetail);
} }

21
pages/count/job/countDetail.vue

@ -63,6 +63,9 @@
cancleTakeCountJob, cancleTakeCountJob,
countJobSubmit countJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
@ -72,7 +75,7 @@
import { import {
getCountStageName getCountStageName
} from '@/common/directory.js'; } from '@/common/directory.js';
import { calc } from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -203,8 +206,8 @@
item.subList.push(newDetail); item.subList.push(newDetail);
items.push(item) items.push(item)
} else { } else {
console.log("数量",item.qty) console.log("数量", item.qty)
item.qty = calc.add(item.qty,detail.qty) item.qty = calc.add(item.qty, detail.qty)
let newDetail = this.createDetailInfo(detail); // let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail); item.subList.push(newDetail);
} }
@ -253,7 +256,7 @@
item.handleQty = 0; item.handleQty = 0;
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined && detail.scaned) { if (detail != undefined && detail.scaned) {
item.handleQty = calc.add(item.handleQty,detail.qty) item.handleQty = calc.add(item.handleQty, detail.qty)
} }
} }
} }
@ -291,13 +294,13 @@
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
}, },
closeScanPopup() { closeScanPopup() {
if(this.$refs.scanPopup!=undefined){ if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
} }
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if(this.$refs.scanPopup!=undefined){ if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus(); this.$refs.scanPopup.packGetFocus();
} }
}, },
@ -381,7 +384,7 @@
"]不在列表中,是否添加到列表?", "]不在列表中,是否添加到列表?",
res => { res => {
if (res) { if (res) {
detail.qty += Number(detail.qty) detail.qty = calc.add(detail.qty,detail.qty)
let newDetail = this.createAddDetailInfo(result.balance, result.package); // let newDetail = this.createAddDetailInfo(result.balance, result.package); //
detail.subList.push(newDetail); detail.subList.push(newDetail);
this.updateData() this.updateData()
@ -430,7 +433,7 @@
fromLocationCode: balance.locationCode, fromLocationCode: balance.locationCode,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
creator:this.$store.state.user.id creator: this.$store.state.user.id
} }
return detail; return detail;
@ -543,7 +546,7 @@
subList.push(detail) subList.push(detail)
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;

30
pages/count/record/countRecord.vue

@ -34,7 +34,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="盘点库位" @getLocation='getLocation' <win-scan-location ref="scanFromLocationCode" title="盘点库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location> :locationTypeList="fromLocationTypeArray"></win-scan-location>
@ -50,11 +50,15 @@
getDataSource, getDataSource,
navigateBack navigateBack
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
@ -119,7 +123,7 @@
this.showErrorMessage(res.message) this.showErrorMessage(res.message)
} }
}); });
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -136,8 +140,7 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
mounted() { mounted() {},
},
methods: { methods: {
calcScanCount(closeScan) { calcScanCount(closeScan) {
let items = this.subList.filter(r => { let items = this.subList.filter(r => {
@ -156,7 +159,8 @@
item.handleQty = 0; item.handleQty = 0;
for (let detail of item.subList) { for (let detail of item.subList) {
if (item.scaned) { if (item.scaned) {
item.handleQty += Number(detail.qty)
item.handleQty = calc.add(item.handleQty,detail.qty)
} }
} }
} }
@ -195,7 +199,7 @@
balanceByLocation(this.fromLocationCode, res => { balanceByLocation(this.fromLocationCode, res => {
this.subList = res.data.list; this.subList = res.data.list;
this.detailSource = getDataSource(this.subList); this.detailSource = getDataSource(this.subList);
}); });
}, },
@ -218,13 +222,13 @@
}, },
closeScanPopup() { closeScanPopup() {
if(this.$refs.scanPopup!=undefined){ if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
} }
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if(this.$refs.scanPopup!=undefined){ if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus(); this.$refs.scanPopup.packGetFocus();
} }
}, },
@ -263,9 +267,7 @@
if (res) { if (res) {
this.$refs.CountQtyEdit.openEditPopup(this.itemEditInfo, this.$refs.CountQtyEdit.openEditPopup(this.itemEditInfo,
detail.subList); detail.subList);
} } else {
else
{
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} }
}) })
@ -303,7 +305,7 @@
return record; return record;
}, },
addExistItemCodeToList(detail, result) { addExistItemCodeToList(detail, result) {
detail.qty += detail.qty detail.qty = calc.add(detail.qty,detail.qty)
let newDetail = this.createAddDetailInfo(result.balance, result.package); // let newDetail = this.createAddDetailInfo(result.balance, result.package); //
detail.subList.push(newDetail); detail.subList.push(newDetail);
}, },

82
pages/deliver/coms/comScanDeliverPack.vue

@ -45,8 +45,8 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" :headerType="headerType" <win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
:isShowHistory="false"> :headerType="headerType" :isShowHistory="false">
</win-com-scan> </win-com-scan>
<view style="width: 100%;"> <view style="width: 100%;">
@ -102,6 +102,11 @@
getDetailOption, getDetailOption,
getDetailEditRemoveOption getDetailEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
import {
calc
} from '@/common/calc.js';
import { import {
getWorkShopLineStation getWorkShopLineStation
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -128,7 +133,7 @@
type: String, type: String,
default: "HPQ,HMQ" default: "HPQ,HMQ"
}, },
}, },
data() { data() {
@ -150,9 +155,9 @@
positionInfo: "请选择位置", positionInfo: "请选择位置",
positionList: [], positionList: [],
defaultValueList: [], defaultValueList: [],
label:{}, label: {},
fromInventoryStatuses :"", fromInventoryStatuses: "",
packageInfo:{} packageInfo: {}
} }
}, },
created() { created() {
@ -185,14 +190,14 @@
let that = this; let that = this;
that.fromLocationList = []; that.fromLocationList = [];
if (that.dataContent != null) { if (that.dataContent != null) {
that.fromInventoryStatuses =this.jobContent.outInventoryStatuses that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0]; that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList(); that.fromLocationList = that.getFromLocationList();
} }
}, },
showBalanceSelect(items,packageInfo) { showBalanceSelect(items, packageInfo) {
this.packageInfo = packageInfo; this.packageInfo = packageInfo;
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
@ -250,38 +255,39 @@
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, balanceRes => { getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
if (balanceRes.success) { balanceRes => {
if (balanceRes.data.list.length == 0) { if (balanceRes.success) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', if (balanceRes.data.list.length == 0) {
res => { this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
this.packGetFocus(); res => {
}) this.packGetFocus();
} else if (balanceRes.data.list.length == 1) { })
let balance = balanceRes.data.list[0]; } else if (balanceRes.data.list.length == 1) {
this.afterGetBalance(result.label, balance,packageInfo); let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.label = result.label;
this.showBalanceSelect(balanceRes.data.list, packageInfo);
}
} else { } else {
this.label =result.label; this.showErrorMessage(balanceRes.message.message);
this.showBalanceSelect(balanceRes.data.list,packageInfo);
} }
} else { uni.hideLoading();
this.showErrorMessage(balanceRes.message.message); });
}
uni.hideLoading();
});
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack)
uni.hideLoading(); uni.hideLoading();
} }
}, },
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance,this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}, },
afterGetBalance(label, balance,packageInfo) {
afterGetBalance(label, balance, packageInfo) {
try { try {
let that = this; let that = this;
let itemCode = label.itemCode; let itemCode = label.itemCode;
@ -302,11 +308,11 @@
if (batch.Recommends.length > 0) { if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) { if (recommend != undefined) {
that.addRecord(batch, label, balance,packageInfo) that.addRecord(batch, label, balance, packageInfo)
} else { } else {
// //
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance,packageInfo); that.addRecord(batch, label, balance, packageInfo);
} else { } else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => { res => {
@ -316,7 +322,7 @@
} }
} }
} else { } else {
that.addRecord(batch, label, balance,packageInfo) that.addRecord(batch, label, balance, packageInfo)
} }
} else { } else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -371,14 +377,14 @@
return batch; return batch;
}, },
creatRecord(label, balance,packageInfo) { creatRecord(label, balance, packageInfo) {
balance.stdPackQty = packageInfo.stdPackQty balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit balance.stdPackUnit = packageInfo.stdPackUnit
let record = { let record = {
itemCode: label.itemCode, itemCode: label.itemCode,
packingNumber: label.packingNumber, packingNumber: label.packingNumber,
batch: label.batch, batch: label.batch,
qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
@ -391,13 +397,13 @@
calcBatchHandleQty(batch) { calcBatchHandleQty(batch) {
let handleQty = 0; let handleQty = 0;
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
}, },
addRecord(batch, label, balance,packageInfo) { addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance,packageInfo); let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);

30
pages/deliver/job/deliverDetail.vue

@ -2,9 +2,9 @@
<view class="page-wraper"> <view class="page-wraper">
<view class="page-header"> <view class="page-header">
<view class="header_job_top"> <view class="header_job_top">
<job-top :dataContent="jobContent" ></job-top> <job-top :dataContent="jobContent"></job-top>
</view> </view>
<view class="header_item" > <view class="header_item">
申请单号{{jobContent.requestNumber}} 申请单号{{jobContent.requestNumber}}
</view> </view>
<u-line color="#D8D8D8"></u-line> <u-line color="#D8D8D8"></u-line>
@ -22,7 +22,7 @@
<u-line /> <u-line />
</view> </view>
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class=""> <scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource">
@ -55,6 +55,10 @@
deliverJobSubmit deliverJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -80,7 +84,7 @@
import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue' import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
export default { export default {
name: 'issueDetail', name: 'issueDetail',
components: { components: {
@ -99,9 +103,9 @@
detailSource: [], // detailSource: [], //
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: [],
status:"", status: "",
received :false, received: false,
toLocationCode:"" toLocationCode: ""
}; };
}, },
@ -168,7 +172,7 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode =that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.resizeCollapse(); that.resizeCollapse();
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
@ -192,7 +196,7 @@
}); });
}, },
submit() { submit() {
uni.showLoading({ uni.showLoading({
@ -204,7 +208,7 @@
var itemCodes = [] var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item=>{ toLocationCode.Items.forEach(item => {
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
}) })
@ -235,7 +239,7 @@
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发货记录" + res.data) this.showCommitSuccessMessage("提交成功<br>生成发货记录" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg+"]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
@ -338,10 +342,10 @@
let handleQty = 0; let handleQty = 0;
if (batch != undefined) { if (batch != undefined) {
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
itemHandleQty += handleQty; itemHandleQty = calc.add(itemHandleQty,handleQty)
} }
}) })
} }

8
pages/deliver/request/deliverRequestCreate.vue

@ -28,6 +28,10 @@
deliverRequestSubmit, deliverRequestSubmit,
issueRecordSubmit issueRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
@ -123,7 +127,7 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty = calc.add(result[0].qty,item.qty)
} }
} }
@ -136,7 +140,7 @@
caclcQty() { caclcQty() {
var totalQty = 0; var totalQty = 0;
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
totalQty += res.qty totalQty = calc.add(totalQty,res.qty)
}) })
this.detailSource.totalQty = totalQty; this.detailSource.totalQty = totalQty;
}, },

20
pages/inspect/job/inspectFullDetail.vue

@ -59,6 +59,10 @@
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
calc
} from '@/common/calc.js';
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
@ -254,8 +258,8 @@
for (let item of this.detailSource) { for (let item of this.detailSource) {
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined && detail.scaned) { if (detail != undefined && detail.scaned) {
failedQty += Number(detail.failedQty) failedQty= calc.add(failedQty,detail.failedQty)
crackQty += Number(detail.crackQty) crackQty= calc.add(crackQty,detail.crackQty)
} }
} }
} }
@ -325,8 +329,9 @@
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if(this.jobContent.allowModifyInventoryStatus=="TRUE"){ if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续检验?', res => { ']不一致,是否继续检验?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
@ -337,13 +342,14 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} }
}); });
}else { } else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => { ']不一致,不允许转移!', res => {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}); });
} }
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;

20
pages/issue/coms/comScanIssuePack.vue

@ -45,8 +45,8 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" headerType ="HPQ,HMQ" <win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
:isShowHistory="false"> headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan> </win-com-scan>
<view style="width: 100%;"> <view style="width: 100%;">
@ -106,6 +106,10 @@
getWorkShopLineStation getWorkShopLineStation
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -325,9 +329,9 @@
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发料明细,是否要继续发料?', res => { '】的发料明细,是否要继续发料?', res => {
if (res) { if (res) {
let batch = that.createBatchInfo(label, balance,packageInfo); let batch = that.createBatchInfo(label, balance, packageInfo);
//details //details
if(fromLocation.Batchs.length>0){ if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail; batch.detail = fromLocation.Batchs[0].detail;
} }
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
@ -356,7 +360,7 @@
} }
}, },
createBatchInfo(data, balance,packageInfo) { createBatchInfo(data, balance, packageInfo) {
let batch = { let batch = {
batch: data.batch, batch: data.batch,
qty: 0, qty: 0,
@ -364,7 +368,7 @@
handleQty: Number(data.qty), handleQty: Number(data.qty),
Records: [] Records: []
} }
let record = this.creatRecord(data, balance,packageInfo); let record = this.creatRecord(data, balance, packageInfo);
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
return batch; return batch;
@ -374,7 +378,7 @@
balance.stdPackQty = packageInfo.stdPackQty balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit balance.stdPackUnit = packageInfo.stdPackUnit
let record = { let record = {
scaned:true, scaned: true,
itemCode: label.itemCode, itemCode: label.itemCode,
packingNumber: label.packingNumber, packingNumber: label.packingNumber,
batch: label.batch, batch: label.batch,
@ -391,7 +395,7 @@
calcBatchHandleQty(batch) { calcBatchHandleQty(batch) {
let handleQty = 0; let handleQty = 0;
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;

38
pages/issue/job/issueDetail.vue

@ -10,9 +10,11 @@
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource">
<work-station :workshopCode="jobContent.workShopCode" :productionLineCode="toLocation.productionLineCode" <work-station :workshopCode="jobContent.workShopCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode"></work-station> :productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station>
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'> <com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</com-issue-detail-card> </com-issue-detail-card>
</view> </view>
@ -42,6 +44,10 @@
issueJobSubmit issueJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -285,19 +291,19 @@
item.Locations.forEach(fromLocation => { item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => { fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail; let subItem = batch.detail;
if(subItem!=undefined){ if (subItem != undefined) {
if (batch.Records.length > 0) { if (batch.Records.length > 0) {
subItem.recordList = []; subItem.recordList = [];
batch.Records.forEach(r => { batch.Records.forEach(r => {
let record = {}; let record = {};
record.handleQty = r.qty; record.handleQty = r.qty;
record.fromPackingNumber = r record.fromPackingNumber = r
.packingNumber; .packingNumber;
record.fromBatch = r.batch; record.fromBatch = r.batch;
record.fromContainerNumber = r record.fromContainerNumber = r
.ContainerNumber; .ContainerNumber;
record.toContainerNumber = r record.toContainerNumber = r
.ContainerNumber; .ContainerNumber;
record.toInventoryStatus = r record.toInventoryStatus = r
@ -305,19 +311,21 @@
record.toLocationCode = subItem record.toLocationCode = subItem
.toLocationCode; .toLocationCode;
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
//使 //使
if (this.jobContent.useOnTheWayLocation == if (this.jobContent
.useOnTheWayLocation ==
'TRUE') { 'TRUE') {
record.toPackingNumber = r record.toPackingNumber = r
.packingNumber; .packingNumber;
record.toBatch = r.batch; record.toBatch = r.batch;
} else { } else {
var info = getPackingNumberAndBatch( var info =
this.managementList, r getPackingNumberAndBatch(
.itemCode, this.managementList, r
r.packingNumber, r .itemCode,
.batch); r.packingNumber, r
.batch);
record.toPackingNumber = info record.toPackingNumber = info
.packingNumber; .packingNumber;
record.toBatch = info.batch; record.toBatch = info.batch;
@ -379,10 +387,10 @@
let handleQty = 0; let handleQty = 0;
if (batch != undefined) { if (batch != undefined) {
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
itemHandleQty += handleQty; itemHandleQty = calc.add(itemHandleQty,handleQty)
} }
}) })
} }

5
pages/issue/js/issue.js

@ -1,3 +1,6 @@
import {
calc
} from '@/common/calc.js';
export function getDataSource(list, subList) { export function getDataSource(list, subList) {
for (var i = 0; i < subList.length; i++) { for (var i = 0; i < subList.length; i++) {
let detail = subList[i]; let detail = subList[i];
@ -25,7 +28,7 @@ export function createDetailInfo(location, detail) {
item = createItemInfo(detail); item = createItemInfo(detail);
location.Items.push(item) location.Items.push(item)
} else { } else {
item.qty += detail.qty item.qty = calc.add(item.qty,detail.qty)
//在零件下查找库位 //在零件下查找库位
let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode); let location = item.Locations.find(r => r.fromLocationCode == detail.fromLocationCode);
if (location == undefined) { if (location == undefined) {

22
pages/issue/record/issueRecord.vue

@ -341,17 +341,17 @@
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// issueRecordSubmit(params).then(res => { issueRecordSubmit(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)
// }) })
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

17
pages/issue/request/issueRequestCreate.vue

@ -5,7 +5,7 @@
</view> </view>
<view v-else class="page-wraper"> <view v-else class="page-wraper">
<view class="page-main"> <view class="page-main">
<comIssueRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe ="false"> <comIssueRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe="false">
</comIssueRequestCreator> </comIssueRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button> <button class="btn_add" @click="goScan(false)">+去添加</button>
</view> </view>
@ -31,6 +31,10 @@
issueRequestSubmit, issueRequestSubmit,
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -95,11 +99,11 @@
productionLineName: item.productionLineName, productionLineName: item.productionLineName,
workStationCode: item.workStationCode, workStationCode: item.workStationCode,
workStationName: item.workStationName, // workStationName: item.workStationName, //
toLocationCode:item.rawLocationCode, toLocationCode: item.rawLocationCode,
totalQty: 0, totalQty: 0,
subList: [] subList: []
} }
var subItem = { var subItem = {
productionLineCode: item.productionLineCode, productionLineCode: item.productionLineCode,
workStationCode: item.workStationCode, workStationCode: item.workStationCode,
@ -131,18 +135,17 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty = calc.add(result[0].qty,item.qty)
} }
} }
this.caclcQty(); this.caclcQty();
}, },
caclcQty() { caclcQty() {
var totalQty = 0; var totalQty = 0;
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
totalQty += res.qty totalQty = calc.add(totalQty,res.qty)
}) })
this.detailSource.totalQty = totalQty; this.detailSource.totalQty = totalQty;
}, },

20
pages/package/record/splitPackageRecord.vue

@ -48,6 +48,10 @@
splitPackageRecordSubmit splitPackageRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
@ -180,9 +184,9 @@
var sumQty = 0; var sumQty = 0;
item.subList[0].Records.forEach(function(item1, index) { item.subList[0].Records.forEach(function(item1, index) {
sumQty += item1.qty; sumQty = calc.add(sumQty,item1.qty)
}); });
if ((Number(qty) + sumQty) > item.subList[0].qty) { if (calc.add(qty,sumQty)> item.subList[0].qty) {
this.showErrorMessage("扫描数量总和【" + (Number(qty) + sumQty) + "】(当前输入数量【" + qty + "】+已添加数量【" + this.showErrorMessage("扫描数量总和【" + (Number(qty) + sumQty) + "】(当前输入数量【" + qty + "】+已添加数量【" +
sumQty + sumQty +
"】)已超过拆包箱码的数量【" + Number(item.subList[0].qty) + "】!"); "】)已超过拆包箱码的数量【" + Number(item.subList[0].qty) + "】!");
@ -200,7 +204,7 @@
if (detail.Records.length > 0) { if (detail.Records.length > 0) {
detail.Records.forEach(r => { detail.Records.forEach(r => {
hQty += Number(r.qty) hQty = calc.add(hQty,r.qty)
}) })
} }
detail.handleQty = hQty; detail.handleQty = hQty;
@ -292,21 +296,21 @@
subItem.itemName = detail.package.itemName; subItem.itemName = detail.package.itemName;
subItem.itemDesc1 = detail.package.itemDesc1; subItem.itemDesc1 = detail.package.itemDesc1;
subItem.itemDesc2 = detail.package.itemDesc2; subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = subItem.inventoryStatus; subItem.fromInventoryStatus = subItem.inventoryStatus;
subItem.toInventoryStatus = subItem.inventoryStatus; subItem.toInventoryStatus = subItem.inventoryStatus;
subItem.fromQty = subItem.qty subItem.fromQty = subItem.qty
subItem.toQty = record.qty subItem.toQty = record.qty
subItem.fromPackingNumber = subItem.packingNumber; subItem.fromPackingNumber = subItem.packingNumber;
subItem.toPackingNumber = record.packingNumber; subItem.toPackingNumber = record.packingNumber;
subItem.fromBatch = subItem.batch; subItem.fromBatch = subItem.batch;
subItem.toBatch = record.batch; subItem.toBatch = record.batch;
subItem.fromLocationCode = subItem.fromLocationCode; subItem.fromLocationCode = subItem.fromLocationCode;
subItem.package = "" subItem.package = ""
subItem.Records="" subItem.Records = ""
subList.push(subItem) subList.push(subItem)
} }

6
pages/productPutaway/request/putawayRequestCreate.vue

@ -61,6 +61,10 @@
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
@ -210,7 +214,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 += Number(detail.qty) item.qty = calc.add(item.qty,detail.qty)
} }
} }
} }

16
pages/productReceipt/record/productReceiptRecord.vue

@ -61,6 +61,10 @@
deepCopyData deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
@ -210,7 +214,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 += Number(detail.qty) item.qty = calc.add(item.qty,detail.qty)
} }
} }
} }
@ -326,10 +330,10 @@
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 != 0 ? detail.handleQty : detail.qty;
submitItem.package =""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }
}) })
@ -392,7 +396,7 @@
this.clearData(); this.clearData();
}) })
}, },
clearData(){ clearData() {
this.subList = []; this.subList = [];
this.detailSource = []; this.detailSource = [];
this.toLocationCode = ''; this.toLocationCode = '';

8
pages/productionReturn/coms/comReturn.vue

@ -57,6 +57,10 @@
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
@ -237,7 +241,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 += Number(detail.qty) item.qty = calc.add(item.qty, detail.qty)
} }
} }
} }
@ -431,7 +435,7 @@
this.clearData(); this.clearData();
}) })
}, },
clearData(){ clearData() {
this.subList = []; this.subList = [];
this.detailSource = []; this.detailSource = [];
this.toLocationCode = ''; this.toLocationCode = '';

63
pages/productionReturn/coms/comScanReturnPack.vue

@ -7,7 +7,7 @@
扫描箱码 扫描箱码
<text class="fr" @click="closeScanPopup()">关闭</text> <text class="fr" @click="closeScanPopup()">关闭</text>
</view> </view>
<!-- <view class="uni-flex uni-row" style="align-items: center; <!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
@ -106,6 +106,10 @@
getWorkShopLineStation getWorkShopLineStation
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -145,7 +149,7 @@
positionInfo: "请选择位置", positionInfo: "请选择位置",
positionList: [], positionList: [],
defaultValueList: [], defaultValueList: [],
fromInventoryStatuses :"", fromInventoryStatuses: "",
} }
}, },
created() { created() {
@ -157,8 +161,8 @@
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailEditRemoveOption();
}, },
methods: { methods: {
openScanPopup(content, jobcontent) { openScanPopup(content, jobcontent) {
this.issueRecord = []; this.issueRecord = [];
this.dataContent = content; this.dataContent = content;
@ -243,24 +247,25 @@
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, balanceRes => { getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
if (balanceRes.success) { balanceRes => {
if (balanceRes.data.list.length == 0) { if (balanceRes.success) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录', if (balanceRes.data.list.length == 0) {
res => { this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
this.packGetFocus(); res => {
}) this.packGetFocus();
} else if (balanceRes.data.list.length == 1) { })
let balance = balanceRes.data.list[0]; } else if (balanceRes.data.list.length == 1) {
this.afterGetBalance(result.label, balance,packageInfo); let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.showBalanceSelect(balanceRes.data.list);
}
} else { } else {
this.showBalanceSelect(balanceRes.data.list); this.showErrorMessage(balanceRes.message.message);
} }
} else { uni.hideLoading();
this.showErrorMessage(balanceRes.message.message); });
}
uni.hideLoading();
});
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack)
@ -271,7 +276,7 @@
this.afterGetBalance(this.label, balance); this.afterGetBalance(this.label, balance);
}, },
afterGetBalance(label, balance,packageInfo) { afterGetBalance(label, balance, packageInfo) {
try { try {
let that = this; let that = this;
let itemCode = label.itemCode; let itemCode = label.itemCode;
@ -292,11 +297,11 @@
if (batch.Recommends.length > 0) { if (batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) { if (recommend != undefined) {
that.addRecord(batch, label, balance,packageInfo) that.addRecord(batch, label, balance, packageInfo)
} else { } else {
// //
if (this.jobContent.allowModifyPackingNumber == 'TRUE') { if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance,packageInfo); that.addRecord(batch, label, balance, packageInfo);
} else { } else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细', that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => { res => {
@ -306,7 +311,7 @@
} }
} }
} else { } else {
that.addRecord(batch, label, balance,packageInfo) that.addRecord(batch, label, balance, packageInfo)
} }
} else { } else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
@ -361,14 +366,14 @@
return batch; return batch;
}, },
creatRecord(label, balance,packageInfo) { creatRecord(label, balance, packageInfo) {
balance.stdPackQty = packageInfo.stdPackQty balance.stdPackQty = packageInfo.stdPackQty
balance.stdPackUnit = packageInfo.stdPackUnit balance.stdPackUnit = packageInfo.stdPackUnit
let record = { let record = {
itemCode: label.itemCode, itemCode: label.itemCode,
packingNumber: label.packingNumber, packingNumber: label.packingNumber,
batch: label.batch, batch: label.batch,
qty: Number(label.qty)>Number(balance.qty)?Number(balance.qty):Number(label.qty), qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
@ -381,13 +386,13 @@
calcBatchHandleQty(batch) { calcBatchHandleQty(batch) {
let handleQty = 0; let handleQty = 0;
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
}, },
addRecord(batch, label, balance,packageInfo) { addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance,packageInfo); let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record); batch.Records.push(record);
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);

34
pages/productionReturn/request/returnRequestCreate.vue

@ -5,7 +5,7 @@
</view> </view>
<view v-else class="page-wraper"> <view v-else class="page-wraper">
<view class="page-main"> <view class="page-main">
<comReturnRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe ="false"> <comReturnRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe="false">
</comReturnRequestCreator> </comReturnRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button> <button class="btn_add" @click="goScan(false)">+去添加</button>
</view> </view>
@ -31,6 +31,10 @@
productionReturnRequestCreate, productionReturnRequestCreate,
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -70,7 +74,7 @@
} }
}, },
mounted() { mounted() {
this.goScan(true) this.goScan(true)
}, },
@ -100,7 +104,7 @@
productionLineName: item.productionLineName, productionLineName: item.productionLineName,
workStationCode: item.workStationCode, workStationCode: item.workStationCode,
workStationName: item.workStationName, // workStationName: item.workStationName, //
fromLocationCode:item.rawLocationCode, fromLocationCode: item.rawLocationCode,
status: "1", status: "1",
totalQty: 0, totalQty: 0,
subList: [] subList: []
@ -110,9 +114,9 @@
workStationCode: item.workStationCode, workStationCode: item.workStationCode,
itemCode: item.itemCode, itemCode: item.itemCode,
itemName: item.itemName, itemName: item.itemName,
inventoryStatus:"OK", inventoryStatus: "OK",
packingNumber:"", packingNumber: "",
fromLocationCode:item.rawLocationCode, fromLocationCode: item.rawLocationCode,
qty: item.qty, qty: item.qty,
uom: item.uom uom: item.uom
} }
@ -131,9 +135,9 @@
workStationCode: item.workStationCode, workStationCode: item.workStationCode,
itemCode: item.itemCode, itemCode: item.itemCode,
itemName: item.itemName, itemName: item.itemName,
inventoryStatus:"OK", inventoryStatus: "OK",
packingNumber:"", packingNumber: "",
fromLocationCode:item.rawLocationCode, fromLocationCode: item.rawLocationCode,
qty: item.qty, qty: item.qty,
uom: item.uom uom: item.uom
} }
@ -142,7 +146,7 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty = calc.add(result[0].qty,item.qty)
} }
} }
@ -152,21 +156,21 @@
caclcQty() { caclcQty() {
var totalQty = 0; var totalQty = 0;
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
totalQty += res.qty totalQty = calc.add(totalQty,res.qty)
}) })
this.detailSource.totalQty = totalQty; this.detailSource.totalQty = totalQty;
}, },
setParams() { setParams() {
//退 //退
if(this.fromType=="ReturnToStore"){ if (this.fromType == "ReturnToStore") {
this.detailSource.isOK = true this.detailSource.isOK = true
this.detailSource.dueTime = getCurrDateOneMonthsTimes() this.detailSource.dueTime = getCurrDateOneMonthsTimes()
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
res.batch ="000000" res.batch = "000000"
}) })
//退 //退
}else if(this.fromType=="ReturnToHold"){ } else if (this.fromType == "ReturnToHold") {
this.detailSource.isOK = false this.detailSource.isOK = false
this.detailSource.dueTime = getCurrDateOneMonthsTimes() this.detailSource.dueTime = getCurrDateOneMonthsTimes()
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {

9
pages/putaway/record/putawayRecord.vue

@ -62,6 +62,11 @@
getPackingNumberAndBatchByList, getPackingNumberAndBatchByList,
deepCopyData deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
@ -237,7 +242,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 += Number(detail.qty) item.qty = calc.add(item.qty,detail.qty)
} }
} }
} }
@ -381,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 != 0 ? detail.handleQty : detail.qty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }

9
pages/putaway/request/putawayRequestCreate.vue

@ -68,6 +68,11 @@
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
@ -217,7 +222,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 += Number(detail.qty) item.qty = calc.add(item.qty,detail.qty)
} }
} }
} }
@ -310,7 +315,7 @@
if (detail.scaned) { if (detail.scaned) {
var subItem = deepCopyData(detail); var subItem = deepCopyData(detail);
subItem.fromLocationCode = detail.locationCode; subItem.fromLocationCode = detail.locationCode;
subItem.qty = detail.handleQty!=0? detail.handleQty:detail.qty; subItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
subItem.package = null; subItem.package = null;
subList.push(subItem) subList.push(subItem)
} }

6
pages/query/container.vue

@ -46,6 +46,10 @@
maxPageSize, maxPageSize,
goHome goHome
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import locationInfo from '@/mycomponents/location/locationInfo.vue' import locationInfo from '@/mycomponents/location/locationInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -217,7 +221,7 @@
data.list.push(item) data.list.push(item)
resultlist.push(data) resultlist.push(data)
} else { } else {
temp.qty += Number(res.qty) temp.qty = calc.add(temp.qty,res.qty)
var item = { var item = {
packingNumber: res.packingNumber, packingNumber: res.packingNumber,
batch: res.batch, batch: res.batch,

6
pages/query/location.vue

@ -43,6 +43,10 @@
maxPageSize, maxPageSize,
goHome goHome
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import locationInfo from '@/mycomponents/location/locationInfo.vue' import locationInfo from '@/mycomponents/location/locationInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -192,7 +196,7 @@
data.list.push(item) data.list.push(item)
resultlist.push(data) resultlist.push(data)
} else { } else {
temp.qty += Number(res.qty) temp.qty = calc.add(temp.qty,res.qty)
var item = { var item = {
packingNumber: res.packingNumber, packingNumber: res.packingNumber,
batch: res.batch, batch: res.batch,

6
pages/query/location_copy.vue

@ -61,6 +61,10 @@
getBalanceByLocationcodeGroup getBalanceByLocationcodeGroup
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
maxPageSize, maxPageSize,
goHome goHome
@ -214,7 +218,7 @@
data.list.push(item) data.list.push(item)
resultlist.push(data) resultlist.push(data)
} else { } else {
temp.qty += Number(res.qty) temp.qty = calc.add(temp.qty,res.qty)
var item = { var item = {
packingNumber: res.packingNumber, packingNumber: res.packingNumber,
batch: res.batch, batch: res.batch,

6
pages/repleinsh/coms/comScanReplishPack.vue

@ -105,6 +105,10 @@
import { import {
getWorkShopLineStation getWorkShopLineStation
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
@ -386,7 +390,7 @@
calcBatchHandleQty(batch) { calcBatchHandleQty(batch) {
let handleQty = 0; let handleQty = 0;
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
}, },

10
pages/repleinsh/job/repleinshDetail.vue

@ -62,6 +62,10 @@
import { import {
getDataSource getDataSource
} from '@/pages/issue/js/issue.js'; } from '@/pages/issue/js/issue.js';
import {
calc
} from '@/common/calc.js';
import { import {
getManagementPrecisions getManagementPrecisions
@ -358,10 +362,10 @@
let handleQty = 0; let handleQty = 0;
if (batch != undefined) { if (batch != undefined) {
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty,res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
itemHandleQty += handleQty; itemHandleQty = calc.add(itemHandleQty,handleQty)
} }
}) })
} }
@ -449,7 +453,7 @@
fromLocation.Batchs.forEach(batch => { fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail; let subItem = batch.detail;
if (batch.Records.length > 0) { if (batch.Records.length > 0) {
scanCount += batch.Records.length scanCount = calc.add(scanCount,batch.Records.length)
} }
}) })
}) })

47
pages/repleinsh/record/repleinshRecord.vue

@ -48,6 +48,10 @@
getBalanceByBatchOffShelf getBalanceByBatchOffShelf
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -73,6 +77,10 @@
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import { import {
getDataSource getDataSource
} from '@/pages/issue/js/issue.js'; } from '@/pages/issue/js/issue.js';
@ -233,7 +241,7 @@
caclcQty() { caclcQty() {
var totalQty = 0; var totalQty = 0;
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
totalQty += res.qty totalQty = calc.add(totalQty, res.qty)
}) })
this.detailSource.totalQty = totalQty; this.detailSource.totalQty = totalQty;
}, },
@ -265,10 +273,10 @@
let handleQty = 0; let handleQty = 0;
if (batch != undefined) { if (batch != undefined) {
batch.Records.forEach(res => { batch.Records.forEach(res => {
handleQty += Number(res.qty) handleQty = calc.add(handleQty, res.qty)
}) })
batch.handleQty = handleQty; batch.handleQty = handleQty;
itemHandleQty += handleQty; itemHandleQty = calc.add(itemHandleQty, handleQty)
} }
}) })
} }
@ -290,7 +298,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 += Number(detail.qty) item.qty = calc.add(item.qty,detail.qty)
} }
} }
} }
@ -323,7 +331,7 @@
}, },
closeScanPopup() { closeScanPopup() {
if(this.$refs.scanPopup!=undefined){ if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
} }
}, },
@ -388,36 +396,37 @@
fromLocation.Batchs.forEach(batch => { fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail; let subItem = batch.detail;
subItem.recordList = []; subItem.recordList = [];
if (batch.Records.length > 0) { if (batch.Records.length > 0) {
batch.Records.forEach(r => { batch.Records.forEach(r => {
let record = {}; let record = {};
record.handleQty = r.qty; record.handleQty = r.qty;
record.fromPackingNumber = r record.fromPackingNumber = r
.packingNumber; .packingNumber;
record.fromBatch = r.batch; record.fromBatch = r.batch;
record.fromContainerNumber = r record.fromContainerNumber = r
.ContainerNumber; .ContainerNumber;
record.toContainerNumber = r record.toContainerNumber = r
.ContainerNumber; .ContainerNumber;
record.toInventoryStatus = r record.toInventoryStatus = r
.inventoryStatus; .inventoryStatus;
record.toLocationCode = subItem record.toLocationCode = subItem
.toLocationCode; .toLocationCode;
record.fromLocationCode = fromLocation.fromLocationCode record.fromLocationCode = fromLocation
.fromLocationCode
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
//使 //使
var info = getPackingNumberAndBatch( var info = getPackingNumberAndBatch(
this.managementList, r this.managementList, r
.itemCode, .itemCode,
r.packingNumber, r r.packingNumber, r
.batch); .batch);
record.toPackingNumber = info record.toPackingNumber = info
.packingNumber; .packingNumber;
record.toBatch = info.batch; record.toBatch = info.batch;
subItem.recordList.push(record); subItem.recordList.push(record);
}) })
subList.push(subItem); subList.push(subItem);
@ -426,7 +435,7 @@
}) })
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.createTime = createTime; this.dataContent.createTime = createTime;
this.dataContent.creator = creator; this.dataContent.creator = creator;

12
pages/transfer/job/transferDetail.vue

@ -49,6 +49,10 @@
import { import {
getBasicLocationByCode getBasicLocationByCode
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
getCurrDateTime, getCurrDateTime,
@ -196,7 +200,7 @@
item.subList.push(newDetail); item.subList.push(newDetail);
items.push(item) items.push(item)
} else { } else {
item.qty += detail.qty item.qty = calc.add(item.qty,detail.qty)
let newDetail = this.createDetailInfo(detail); // let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail); item.subList.push(newDetail);
} }
@ -221,10 +225,10 @@
createDetailInfo(data) { createDetailInfo(data) {
data.scaned = false; data.scaned = false;
// data.record = {}; // data.record = {};
let detail = data; let detail = data;
detail.handleQty = 0, detail.handleQty = 0,
return detail; return detail;
}, },
calcScanCount(closeScan) { calcScanCount(closeScan) {
@ -244,7 +248,7 @@
item.handleQty = 0; item.handleQty = 0;
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail.record != undefined) { if (detail.record != undefined) {
item.handleQty += Number(detail.record.qty) item.handleQty = calc.add(item.handleQty,detail.record.qty)
} }
} }
} }

6
pages/unPlanned/record/receiptRecord.vue

@ -64,6 +64,10 @@
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -199,7 +203,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 += Number(detail.qty) item.qty = calc.add(item.qty,detail.qty)
} }
} }
} }

53
pages/unPlanned/request/receiptRequestCreate.vue

@ -9,21 +9,22 @@
<view class="" style="margin-left: 20rpx; margin-top: 20rpx;margin-bottom:20rpx;font-size: 30rpx;"> <view class="" style="margin-left: 20rpx; margin-top: 20rpx;margin-bottom:20rpx;font-size: 30rpx;">
目标库位{{detailSource.toLocationCode}} 目标库位{{detailSource.toLocationCode}}
</view> </view>
<view class="flex u-col-center" style="width: 100%;background-color:#fff;margin-bottom: 20rpx;margin-top: 20rpx;"> <view class="flex u-col-center"
<view class="" style="margin-left: 20rpx; font-size: 30rpx;flex-shrink: 0;">入库原因</view> style="width: 100%;background-color:#fff;margin-bottom: 20rpx;margin-top: 20rpx;">
<view style="width: 100%"> <view class="" style="margin-left: 20rpx; font-size: 30rpx;flex-shrink: 0;">入库原因</view>
<view style="width: 100%">
<uni-data-picker style="background-color:#fff;margin-right: 20rpx;" class='uni-data-picker' <uni-data-picker style="background-color:#fff;margin-right: 20rpx;" class='uni-data-picker'
placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList" @change="reasonChange"> placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList" @change="reasonChange">
</uni-data-picker> </uni-data-picker>
</view> </view>
</view> </view>
</view> </view>
<u-line /> <u-line />
<view v-for="(item, index) in detailSource.subList" :key="index"> <view v-for="(item, index) in detailSource.subList" :key="index">
<item-qty :dataContent="item" :isShowStdPack="false"> <item-qty :dataContent="item" :isShowStdPack="false">
</item-qty> </item-qty>
<u-line /> <u-line />
</view> </view>
<button class="btn_add" @click="goScan(false)">+去添加</button> <button class="btn_add" @click="goScan(false)">+去添加</button>
</view> </view>
@ -46,6 +47,10 @@
unPlannedReceiptRequestCreate unPlannedReceiptRequestCreate
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -66,7 +71,7 @@
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue' import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import itemQty from '@/mycomponents/item/itemQty.vue' import itemQty from '@/mycomponents/item/itemQty.vue'
export default { export default {
name: '', name: '',
components: { components: {
@ -106,12 +111,12 @@
if (this.detailSource.subList.length == 0) { if (this.detailSource.subList.length == 0) {
this.detailSource = { this.detailSource = {
totalQty: 0, totalQty: 0,
toLocationCode:item.toLocationCode, toLocationCode: item.toLocationCode,
subList: [] subList: []
} }
var subItem = { var subItem = {
toLocationCode:item.toLocationCode, toLocationCode: item.toLocationCode,
itemCode: item.itemCode, itemCode: item.itemCode,
itemName: item.itemName, itemName: item.itemName,
qty: item.qty, qty: item.qty,
@ -138,18 +143,18 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty = calc.add(result[0].qty,item.qty)
} }
} }
this.caclcQty(); this.caclcQty();
}, },
caclcQty() { caclcQty() {
var totalQty = 0; var totalQty = 0;
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
totalQty += res.qty totalQty = calc.add(totalQty,res.qty)
}) })
this.detailSource.totalQty = totalQty; this.detailSource.totalQty = totalQty;
}, },
@ -177,23 +182,23 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
setRequestParams() { setRequestParams() {
var subList = [] var subList = []
this.detailSource.subList.forEach(detail => { this.detailSource.subList.forEach(detail => {
detail.toLocationCode = this.detailSource.toLocationCode; detail.toLocationCode = this.detailSource.toLocationCode;
detail.reason = this.reasonCode; detail.reason = this.reasonCode;
detail.containerNumber = ""; detail.containerNumber = "";
detail.batch = getBatch(); detail.batch = getBatch();
detail.inventoryStatus = "OK"; detail.inventoryStatus = "OK";
console.log("",getBatch()) console.log("", getBatch())
subList.push(detail) subList.push(detail)
}) })
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();
return this.dataContent; return this.dataContent;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

Loading…
Cancel
Save