Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp

# Conflicts:
#	pages/issue/job/issueDetail.vue
wms3.0_pda
niexiting 10 months ago
parent
commit
2d5ee0ecba
  1. 2
      common/detail.js
  2. 2
      common/record.js
  3. 6
      mycomponents/balance/handleBalance.vue
  4. 10
      mycomponents/balance/recommendBalance.vue
  5. 14
      mycomponents/detail/comDetailCard.vue
  6. 4
      mycomponents/item/itemCompareQty.vue
  7. 6
      mycomponents/package/packageDetailPopup.vue
  8. 13
      mycomponents/qty/compareQty.vue
  9. 8
      mycomponents/recommend/recommend.vue
  10. 8
      pages.json
  11. 7
      pages/container/record/containerBindRecord.vue
  12. 7
      pages/container/record/containerUnBindRecord.vue
  13. 20
      pages/count/job/countDetail.vue
  14. 20
      pages/count/record/countRecord.vue
  15. 45
      pages/customerReturn/record/returnRecord.vue
  16. 74
      pages/deliver/coms/comScanDeliverPack.vue
  17. 24
      pages/deliver/job/deliverDetail.vue
  18. 39
      pages/deliver/record/deliverRecord.vue
  19. 8
      pages/deliver/request/deliverRequestCreate.vue
  20. 5
      pages/index/index.vue
  21. 20
      pages/inspect/job/inspectDetail.vue
  22. 18
      pages/inspect/job/inspectFullDetail.vue
  23. 104
      pages/inventoryMove/coms/comMoveRecord.vue
  24. 14
      pages/inventoryMove/coms/comMoveRecordCard.vue
  25. 12
      pages/inventoryMove/coms/comMovebalance.vue
  26. 2
      pages/inventoryMove/record/oktoScrapRecord.vue
  27. 2
      pages/issue/coms/comIssueDetailCard.vue
  28. 35
      pages/issue/coms/comIssueRequestCreator.vue
  29. 22
      pages/issue/coms/comScanIssuePack.vue
  30. 5
      pages/issue/js/issue.js
  31. 9
      pages/issue/record/issueRecord.vue
  32. 13
      pages/issue/request/issueRequestCreate.vue
  33. 12
      pages/package/record/splitPackageRecord.vue
  34. 39
      pages/productPutaway/record/productPutawayRecord.vue
  35. 6
      pages/productPutaway/request/putawayRequestCreate.vue
  36. 14
      pages/productReceipt/coms/comProductDetailCard.vue
  37. 48
      pages/productReceipt/record/productReceiptRecord.vue
  38. 1
      pages/productionReceipt/record/productionReceiptRecord.vue
  39. 10
      pages/productionReturn/coms/comReturn.vue
  40. 18
      pages/productionReturn/coms/comReturnDetailCard.vue
  41. 35
      pages/productionReturn/coms/comReturnRequestCreator.vue
  42. 59
      pages/productionReturn/coms/comScanReturnPack.vue
  43. 47
      pages/productionReturn/record/returnToHold.vue
  44. 43
      pages/productionReturn/record/returnToStore.vue
  45. 32
      pages/productionReturn/request/returnRequestCreate.vue
  46. 31
      pages/purchaseReturn/record/returnRecord.vue
  47. 4
      pages/purchaseReturn/request/returnRequestCreate.vue
  48. 40
      pages/putaway/record/putawayRecord.vue
  49. 16
      pages/putaway/request/putawayRequestCreate.vue
  50. 6
      pages/query/container.vue
  51. 6
      pages/query/location.vue
  52. 6
      pages/query/location_copy.vue
  53. 19
      pages/repleinsh/coms/comScanReplishPack.vue
  54. 95
      pages/repleinsh/job/repleinshDetail.vue
  55. 33
      pages/repleinsh/record/repleinshRecord.vue
  56. 41
      pages/scrap/record/scrapRecord.vue
  57. 38
      pages/transfer/coms/comTransferRecord.vue
  58. 12
      pages/transfer/job/transferDetail.vue
  59. 445
      pages/transfer/record/deliverRecord.vue
  60. 423
      pages/transfer/record/receiptRecord.vue
  61. 39
      pages/unPlanned/record/issueRecord.vue
  62. 38
      pages/unPlanned/record/receiptRecord.vue
  63. 41
      pages/unPlanned/request/receiptRequestCreate.vue

2
common/detail.js

@ -59,7 +59,7 @@ export function calcHandleQty(detailSource) {
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 += Number(detail.handleQty) item.handleQty = calc.add(item.handleQty,detail.handleQty)
} }
} }
} }

2
common/record.js

@ -28,8 +28,10 @@ export function createDetailInfo(data, pack) {
let detail = {}; let detail = {};
Object.assign(detail, data) Object.assign(detail, data)
detail.balanceQty = Number(detail.qty) detail.balanceQty = Number(detail.qty)
detail.qty = Number(detail.qty);
detail.stdPackQty = Number(pack.stdPackQty) detail.stdPackQty = Number(pack.stdPackQty)
detail.stdPackUnit = pack.stdPackUnit detail.stdPackUnit = pack.stdPackUnit
detail.handleQty =0;
detail.package = pack; detail.package = pack;
return detail; return detail;

6
mycomponents/balance/handleBalance.vue

@ -1,12 +1,12 @@
<template> <template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="space_between"> <view class="space_between" >
<view > <view style="word-break: break-all;width: 60%;">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
<view > <view style="word-break: break-all;">
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail" <recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
:isShowStdPack="false"></recommend-qty> :isShowStdPack="false"></recommend-qty>

10
mycomponents/balance/recommendBalance.vue

@ -1,17 +1,17 @@
<template> <template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #fff;">
<view class="uni-flex uni-row space-between center "> <view class="uni-flex uni-row space-between center ">
<view class="uni-flex uni-row center "> <view class="uni-flex uni-row " style="width: 60%;margin-left: 30rpx;" >
<view style=" width: 20px;color: #32C1E8;"> <view style=" width: 25rpx;color: #32C1E8;">
推荐 推荐
</view> </view>
<view > <view style="word-break: break-all">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location> <location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view> </view>
</view> </view>
<view > <view style="word-break: break-all">
<recommend-qty v-if="detail.Records==null || detail.Records.length==0" :dataContent="detail" <recommend-qty v-if="detail.Records==null || detail.Records.length==0" :dataContent="detail"
:isShowStdPack="false" :isShowStatus="false"></recommend-qty> :isShowStdPack="false" :isShowStatus="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number( detail.qty)" <compare-qty v-else :dataContent="detail" :recommendQty="Number( detail.qty)"

14
mycomponents/detail/comDetailCard.vue

@ -73,7 +73,19 @@
}, },
}, },
watch: { watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
}, },
data() { data() {

4
mycomponents/item/itemCompareQty.vue

@ -1,9 +1,9 @@
<template> <template>
<view class="uni-flex uni-row space-between uni-inline-item" style="background-color:#fff;"> <view class="uni-flex uni-row space-between uni-inline-item" style="background-color:#fff;">
<view> <view style="word-break: break-all;width: 50%;">
<item :dataContent="dataContent"></item> <item :dataContent="dataContent"></item>
</view> </view>
<view> <view style="word-break: break-all;width: 50%;display: flex;justify-content:flex-end;margin-right: 10rpx;">
<recommend-qty v-if="handleQty==0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack ="isShowStdPack"></recommend-qty> <recommend-qty v-if="handleQty==0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack ="isShowStdPack"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(handleQty)" :isShowStatus="false" :handleQty="Number(handleQty)" :isShowStatus="false"

6
mycomponents/package/packageDetailPopup.vue

@ -61,13 +61,13 @@
this.dataList.length = 0; this.dataList.length = 0;
this.dataList.push(...[{ this.dataList.push(...[{
item_title: '包装号', item_title: '包装号',
text_wrap: this.dataContent.number content: this.dataContent.number
}, { }, {
item_title: '物料代码', item_title: '物料代码',
text_wrap: this.dataContent.itemCode content: this.dataContent.itemCode
}, { }, {
item_title: '物品名称', item_title: '物品名称',
text_wrap: this.dataContent.itemName content: this.dataContent.itemName
}, { }, {
item_title: '物品描述1', item_title: '物品描述1',
content: this.dataContent.itemDesc1 content: this.dataContent.itemDesc1

13
mycomponents/qty/compareQty.vue

@ -3,7 +3,7 @@
<view class="uni-flex uni-row "> <view class="uni-flex uni-row ">
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status> <status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="uni-flex uni-row center"> <view class="uni-flex uni-row center">
<view v-if ="Number(handleQty)>0"> <view v-if ="Number(handleQty)!=0">
<view v-if="Number(recommendQty)>Number(handleQty)" class="text_greater"> <view v-if="Number(recommendQty)>Number(handleQty)" class="text_greater">
{{Number(handleQty)}} {{Number(handleQty)}}
</view> </view>
@ -15,13 +15,13 @@
</view> </view>
</view> </view>
<view v-if="Number(handleQty)>0 " class="std_split">/</view> <view v-if="Number(handleQty)!=0" class="std_split">/</view>
<view v-if="isShowRecommendQty" class="text_recommend center"> <view v-if="isShowRecommendQty" class="text_recommend center">
{{Number(recommendQty)}} {{Number(recommendQty)}}
</view> </view>
</view> </view>
<uom v-show="Number(handleQty)>0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom"></uom> <uom v-show="Number(handleQty)!=0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom"></uom>
</view> </view>
<view> <view>
<std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty>
@ -80,7 +80,12 @@
} }
}, },
watch: { watch: {
handleQty: {
handler(newName, oldName) {
},
immediate: true,
deep: true
}
}, },
methods: { methods: {

8
mycomponents/recommend/recommend.vue

@ -2,7 +2,7 @@
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff; border-bottom: 1upx solid #EEEEEE;"> <view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff; border-bottom: 1upx solid #EEEEEE;">
<view class="uni-flex uni-row space-between" style="align-items: center"> <view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉--> <!-- uni-inline-item 暂时拿掉-->
<view> <view style="word-break: break-all;width: 50%;">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch> <batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode"> <location v-if="isShowFromLocation" title="来源库位" :locationCode="detail.fromLocationCode">
@ -11,15 +11,17 @@
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="detail.toLocationCode"> <to-location v-if="isShowToLocation" title="目标库位" :locationCode="detail.toLocationCode">
</to-location> </to-location>
</view> </view>
<view> <view style="word-break: break-all;">
<!-- ||detail.handleQty==0 可能会有扫描到0的情况--> <!-- ||detail.handleQty==0 可能会有扫描到0的情况-->
<recommend-qty v-if="detail.handleQty==null || detail.handleQty==undefined" :dataContent="detail" <recommend-qty v-if="detail.handleQty==null || detail.handleQty==undefined" :dataContent="detail"
:isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty> :isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number(detail.qty)" <compare-qty v-else :dataContent="detail" :recommendQty="Number(detail.qty)"
:handleQty="Number(detail.handleQty)" :isShowStdPack="false"> :handleQty="Number(detail.handleQty)" :isShowStdPack="false">
</compare-qty> </compare-qty>
<view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text> <text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text> <text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</view> </view>

8
pages.json

@ -299,7 +299,7 @@
{ {
"path": "pages/putaway/record/putawayRecord", "path": "pages/putaway/record/putawayRecord",
"style": { "style": {
"navigationBarTitleText": "原料上架", "navigationBarTitleText": "原料上架记录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -466,7 +466,7 @@
{ {
"path": "pages/issue/record/issueRecord", "path": "pages/issue/record/issueRecord",
"style": { "style": {
"navigationBarTitleText": "直接发料", "navigationBarTitleText": "直接发料记录",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"titleNView": { "titleNView": {
"autoBackButton": "true" "autoBackButton": "true"
@ -561,14 +561,14 @@
{ {
"path": "pages/productionReturn/record/returnToStore", "path": "pages/productionReturn/record/returnToStore",
"style": { "style": {
"navigationBarTitleText": "合格退料", "navigationBarTitleText": "合格退料记录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "pages/productionReturn/record/returnToHold", "path": "pages/productionReturn/record/returnToHold",
"style": { "style": {
"navigationBarTitleText": "隔离退料", "navigationBarTitleText": "隔离退料记录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },

7
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);
} }
@ -260,6 +264,7 @@
data.scaned = false; data.scaned = false;
data.packingNumber = data.contentNumber data.packingNumber = data.contentNumber
data.qty = Number(data.qty) data.qty = Number(data.qty)
data.handleQty = 0;
let detail = data; let detail = data;
return detail; return detail;
}, },

7
pages/container/record/containerUnBindRecord.vue

@ -52,6 +52,10 @@
goHome goHome
} 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';
@ -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);
} }
@ -205,6 +209,7 @@
data.scaned = false; data.scaned = false;
data.packingNumber = data.contentNumber data.packingNumber = data.contentNumber
data.qty = Number(data.qty) data.qty = Number(data.qty)
data.handleQty =0;
let detail = data; let detail = data;
return detail; return detail;
}, },

20
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);
} }
@ -230,6 +233,7 @@
data.scaned = false; data.scaned = false;
let detail = data; let detail = data;
detail.balanceQty = 0 detail.balanceQty = 0
detail.handleQty = 0;
detail.inventoryStatus = detail.inventoryStatus detail.inventoryStatus = detail.inventoryStatus
detail.fromLocationCode = this.fromLocationCode detail.fromLocationCode = this.fromLocationCode
return detail; return detail;
@ -252,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)
} }
} }
} }
@ -290,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();
} }
}, },
@ -380,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()
@ -429,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;

20
pages/count/record/countRecord.vue

@ -51,6 +51,10 @@
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';
@ -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)
} }
} }
} }
@ -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);
}, },

45
pages/customerReturn/record/returnRecord.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='getLocation' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main"> <view class="page-main">
@ -56,7 +56,8 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -323,27 +324,32 @@
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode; var submitItem = deepCopyData(detail)
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.itemCode = detail.itemCode;
detail.toInventoryStatus = detail.inventoryStatus; submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
detail.fromPackingNumber = info.packingNumber; submitItem.inventoryStatus = detail.inventoryStatus;
detail.toPackingNumber = info.packingNumber; submitItem.toInventoryStatus = detail.inventoryStatus;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromPackingNumber = info.packingNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toPackingNumber = info.packingNumber;
detail.fromBatch = info.batch; submitItem.fromContainerNumber = detail.containerNumber;
detail.toBatch = info.batch; submitItem.toContainerNumber = detail.containerNumber
detail.fromLocationCode = detail.locationCode; submitItem.fromBatch = info.batch;
detail.toLocationCode = detail.toLocationCode; submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(submitItem)
subList.push(detail)
} }
}) })
}) })
@ -388,6 +394,11 @@
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
this.toLocationCode = code; this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

74
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';
@ -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,25 +255,26 @@
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)
@ -277,11 +283,11 @@
}, },
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);

24
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>
@ -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,
@ -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');
@ -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)
} }
}) })
} }

39
pages/deliver/record/deliverRecord.vue

@ -60,7 +60,8 @@
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -121,7 +122,7 @@
}, },
onLoad(option) { onLoad(option) {
var typeCode = "DeliverRecord" var typeCode = "Deliver"
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
@ -359,32 +360,36 @@
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode; var submitItem = deepCopyData(detail)
detail.itemName = detail.package.itemName; submitItem.itemCode = detail.itemCode;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemName = detail.package.itemName;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber; submitItem.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch; submitItem.fromBatch = info.batch;
detail.toBatch = info.batch; submitItem.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
subList.push(detail) submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(submitItem)
} }
}) })
}) })
this.dataContent.subList = subList; this.dataContent.subList = subList;
this.dataContent.creator = creator; this.dataContent.creator = creator;
this.dataContent.customerCode =this.customerCode; this.dataContent.customerCode = this.customerCode;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode; this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode; this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent; return this.dataContent;

8
pages/deliver/request/deliverRequestCreate.vue

@ -29,6 +29,10 @@
issueRecordSubmit issueRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -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;
}, },

5
pages/index/index.vue

@ -193,6 +193,8 @@
}) })
this.$forceUpdate() this.$forceUpdate()
}).catch(res=>{
console.log("获取消息失败",res)
}); });
}, },
@ -326,7 +328,8 @@
if (res.data.length > 0) { if (res.data.length > 0) {
uni.setStorageSync("dictionary", res.data) uni.setStorageSync("dictionary", res.data)
} }
}).catch(res=>{
console.log("获取字典失败",res)
}) })
}, },

20
pages/inspect/job/inspectDetail.vue

@ -466,17 +466,19 @@
detail.toInventoryStatus = "NOK" detail.toInventoryStatus = "NOK"
} }
} }
} else {
detail.sampleQty = detail.qty;
detail.failedQty = 0;
detail.crackQty = 0;
detail.notPassedQty = 0;
detail.goodQty = detail.qty;
detail.inspectUser = this.$store.state.user.id
detail.toInventoryStatus = "OK"
} }
// else {
// detail.sampleQty = detail.qty;
// detail.failedQty = 0;
// detail.crackQty = 0;
// detail.notPassedQty = 0;
// detail.handleQty = 0;
// detail.goodQty = detail.qty;
// detail.inspectUser = this.$store.state.user.id
// detail.toInventoryStatus = "OK"
// }
list.push(detail) list.push(detail)
}) })
}) })

18
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,8 +342,9 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} }
}); });
}else { } else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => { ']不一致,不允许转移!', res => {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}); });

104
pages/inventoryMove/coms/comMoveRecord.vue

@ -23,7 +23,7 @@
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocation' <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocation'
:locationTypeList="toLocationTypeArray" :isShowEdit="allowEditStatus"></requiredLocation> :locationTypeList="tolocationTypeList" :isShowEdit="isShowEditLocation"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -63,7 +63,8 @@
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -124,6 +125,7 @@
dataContent: {}, dataContent: {},
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
isShowEditLocation:false
} }
}, },
@ -139,29 +141,11 @@
} }
}); });
this.initData(); this.initData();
this.getLocationInfo();
}, },
onLoad() { onLoad() {
if (this.toLocationCode != '') {
getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
var available = result.available;
if (available == "TRUE") {
this.toLocationInfo = res.data.list[0];
} else {
this.showErrorMessage("扫描库位[" + this.code + "]不可用")
}
} else {
this.showErrorMessage('库位[' + this.toLocationCode + ']不存在')
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
}, },
methods: { methods: {
@ -170,10 +154,12 @@
this.title = "库存转移记录"; this.title = "库存转移记录";
this.toInventoryStatus = "" this.toInventoryStatus = ""
this.toLocationCode = "" this.toLocationCode = ""
this.isShowEditLocation =true;
} else if (this.businessTypeCode == "HoldToOk") { } else if (this.businessTypeCode == "HoldToOk") {
this.title = "隔离转合格记录"; this.title = "隔离转合格记录";
this.toInventoryStatus = "OK" this.toInventoryStatus = "OK"
this.toLocationCode = "OK" this.toLocationCode = ""
this.isShowEditLocation =true;
} else if (this.businessTypeCode == "HoldToScrap") { } else if (this.businessTypeCode == "HoldToScrap") {
this.title = "隔离转报废记录"; this.title = "隔离转报废记录";
this.toInventoryStatus = "SCRAP" this.toInventoryStatus = "SCRAP"
@ -182,10 +168,10 @@
this.title = "合格转隔离记录"; this.title = "合格转隔离记录";
this.toInventoryStatus = "HOLD" this.toInventoryStatus = "HOLD"
this.toLocationCode = "HOLD" this.toLocationCode = "HOLD"
} else if (this.businessTypeCode == "OktoScrap") { } else if (this.businessTypeCode == "OkToScrap") {
this.title = "合格转报废记录"; this.title = "合格转报废记录";
this.toInventoryStatus = "SCRAP" this.toInventoryStatus = "SCRAP"
this.toLocationCode = "HOLD" this.toLocationCode = "SCRAP"
} else if (this.businessTypeCode == "ScrapToHold") { } else if (this.businessTypeCode == "ScrapToHold") {
this.title = "报废转隔离记录"; this.title = "报废转隔离记录";
this.toInventoryStatus = "HOLD" this.toInventoryStatus = "HOLD"
@ -195,6 +181,29 @@
title: this.title title: this.title
}) })
}, },
getLocationInfo(){
if (this.toLocationCode != "") {
getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
var available = result.available;
if (available == "TRUE") {
this.toLocationInfo = res.data.list[0];
} else {
this.showErrorMessage("扫描库位[" + this.code + "]不可用")
}
} else {
this.showErrorMessage('库位[' + this.toLocationCode + ']不存在')
}
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
}
},
openScanPopup() { openScanPopup() {
if (this.fromLocationCode == "") { if (this.fromLocationCode == "") {
this.showFromLocationPopup(); this.showFromLocationPopup();
@ -230,14 +239,15 @@
// newDetail.inventoryStatus = balance.inventoryStatus; // newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus;
newDetail.toLocationCode = this.toLocationCode; newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch && r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus && r.toInventoryStatus == balance.inventoryStatus &&
r.scaned == true) { r.scaned == true) {
return r; return r;
} }
@ -248,6 +258,7 @@
// newDetail.inventoryStatus = balance.inventoryStatus; // newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus;
newDetail.toLocationCode = this.toLocationCode; newDetail.toLocationCode = this.toLocationCode;
newDetail.fromLocationCode = result.fromLocationCode
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
this.showErrorMessage(balance.packingNumber + "已经在列表中") this.showErrorMessage(balance.packingNumber + "已经在列表中")
@ -326,7 +337,7 @@
inventoryMoveRecordSubmit(params).then(res => { inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "记录<br>" + this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "<br>" +
res.data) res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
@ -386,32 +397,33 @@
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
var subItem = {}; var submitItem = deepCopyData(detail)
Object.assign(subItem, detail) submitItem.itemCode = detail.itemCode;
subItem.itemCode = detail.itemCode; submitItem.itemName = detail.package.itemName;
subItem.itemName = detail.package.itemName; submitItem.itemDesc1 = detail.package.itemDesc1;
subItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc2 = detail.package.itemDesc2;
subItem.itemDesc2 = detail.package.itemDesc2;
submitItem.fromInventoryStatus = detail.inventoryStatus;
submitItem.toInventoryStatus = detail.toInventoryStatus;
subItem.fromInventoryStatus = detail.inventoryStatus; submitItem.fromPackingNumber = info.packingNumber;
subItem.toInventoryStatus = detail.toInventoryStatus; submitItem.toPackingNumber = info.packingNumber;
subItem.fromPackingNumber = info.packingNumber; submitItem.fromContainerNumber = detail.containerNumber;
subItem.toPackingNumber = info.packingNumber; submitItem.toContainerNumber = detail.containerNumber
subItem.fromContainerNumber = detail.containerNumber; submitItem.fromBatch = info.batch;
subItem.toContainerNumber = detail.containerNumber submitItem.toBatch = info.batch;
subItem.fromBatch = info.batch; submitItem.fromLocationCode = detail.fromLocationCode;
subItem.toBatch = info.batch; submitItem.toLocationCode = detail.toLocationCode;
subItem.fromLocationCode = detail.locationCode; submitItem.package = null;
subItem.toLocationCode = detail.toLocationCode; submitItem.Records = null;
subItem.package = null; submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
subItem.Records = null;
subList.push(subItem) subList.push(submitItem)
} }
}) })
}) })

14
pages/inventoryMove/coms/comMoveRecordCard.vue

@ -86,7 +86,19 @@
}, },
watch: { watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
}, },
data() { data() {

12
pages/inventoryMove/coms/comMovebalance.vue

@ -6,14 +6,14 @@
<pack v-if="isShowPack && dataContent.packingNumber!=''" :packingCode="dataContent.packingNumber"> <pack v-if="isShowPack && dataContent.packingNumber!=''" :packingCode="dataContent.packingNumber">
</pack> </pack>
<batch v-if="isShowBatch" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch" :batch="dataContent.batch"></batch>
<location v-if="isShowLocation" :locationCode="dataContent.locationCode"></location> <location v-if="isShowLocation" title="来源库位" :locationCode="dataContent.fromLocationCode"></location>
</view> </view>
<view> <view>
<qty :isShowStatus="false" <!-- <qty :isShowStatus="false"
v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent" :dataContent="dataContent"
:isShowStdPack="isShowStdPack"></qty> :isShowStdPack="isShowStdPack"></qty> -->
<compare-qty v-else :dataContent="dataContent" :recommendQty="dataContent.qty" <compare-qty :dataContent="dataContent" :recommendQty="dataContent.qty"
:handleQty="dataContent.record.qty" :isShowStdPack="isShowStdPack"> :handleQty="dataContent.handleQty" :isShowStdPack="isShowStdPack">
</compare-qty> </compare-qty>
<move-status :fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus" :showToInventoryStatus="allowEditStatus"> <move-status :fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus" :showToInventoryStatus="allowEditStatus">
</move-status> </move-status>

2
pages/inventoryMove/record/oktoScrapRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMoveRecord businessTypeCode='OktoScrap' > </comMoveRecord> <comMoveRecord businessTypeCode='OkToScrap' > </comMoveRecord>
</view> </view>
</template> </template>

2
pages/issue/coms/comIssueDetailCard.vue

@ -21,7 +21,7 @@
</location> </location>
</view> </view>
<view v-for="(batch,index) in loacation.Batchs"> <view v-for="(batch,index) in loacation.Batchs">
<recommend-balance style='margin-left: 20px;' :detail="batch" :isShowLocation="false" <recommend-balance style='margin-left: 0rpx;' :detail="batch" :isShowLocation="false"
:isShowPack="batch.packingNumber!=null && batch.packingNumber!=''"> :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance> </recommend-balance>
<view class="uni-flex uni-row " v-if='batch.Records.length>0'> <view class="uni-flex uni-row " v-if='batch.Records.length>0'>

35
pages/issue/coms/comIssueRequestCreator.vue

@ -8,7 +8,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index"> <view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="detailOptions"> <uni-swipe-action-item @click="swipeClick($event,item,index)" :right-options="options">
<item-qty :dataContent="item" :isShowStdPack="false"> <item-qty :dataContent="item" :isShowStdPack="false">
</item-qty> </item-qty>
<u-line /> <u-line />
@ -76,13 +76,6 @@
}, },
}, },
watch: { watch: {
dataContent: {
handler(newval, oldval) {
this.requestItem = this.dataContent.subList[0];
},
immediate: true,
deep: true
}
}, },
data() { data() {
@ -94,9 +87,9 @@
} }
}, },
requestItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [] scanOptions: [],
options:[]
} }
}, },
@ -105,26 +98,27 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
} }
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailRemoveOption();
// if (this.dataContent.allowModifyQty == 1) { // if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption(); // this.scanOptions = getDetailEditRemoveOption();
// } else { // } else {
// this.scanOptions = getDetailRemoveOption(); // this.scanOptions = getDetailRemoveOption();
// } // }
} }
if(!this.isSwipe){ this.options =this.scanOptions
this.detailOptions=[] // if(!this.isSwipe){
} // this.detailOptions=[]
// }
}, },
methods: { methods: {
swipeClick(e, item) { swipeClick(e, item,index) {
if (e.content.text == "详情") { if (e.content.text == "详情") {
this.detail(item) this.detail(item)
} else if (e.content.text == "编辑") { } else if (e.content.text == "编辑") {
this.edit(item) this.edit(item)
} else if (e.content.text == "移除") { } else if (e.content.text == "移除") {
this.remove(item) this.remove(item,index)
} }
}, },
edit(item) { edit(item) {
@ -138,17 +132,12 @@
// // this.showItem = item; // // this.showItem = item;
// // this.$refs.jobDetailPopup.openPopup(item) // // this.$refs.jobDetailPopup.openPopup(item)
}, },
remove(item) { remove(item,index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?", this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => { res => {
if (res) { if (res) {
item.scaned = false this.dataContent.subList.splice(index, 1)
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.$forceUpdate() this.$forceUpdate()
this.$emit('remove', item)
} }
}); });
}, },

22
pages/issue/coms/comScanIssuePack.vue

@ -46,7 +46,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" <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';
@ -321,11 +325,15 @@
) )
} }
} else { } else {
if (this.jobContent.AllowModifyBatch == null) { if (this.jobContent.allowModifyBatch == "TRUE") {
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
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
} }
}) })
@ -352,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,
@ -360,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;
@ -370,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,
@ -387,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;

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) {

9
pages/issue/record/issueRecord.vue

@ -58,6 +58,9 @@
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import { import {
getManagementPrecisions getManagementPrecisions
@ -209,7 +212,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;
}, },
@ -241,10 +244,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)
} }
}) })
} }

13
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,7 +99,7 @@
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: []
} }
@ -131,8 +135,7 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty = calc.add(result[0].qty,item.qty)
} }
} }
this.caclcQty(); this.caclcQty();
@ -142,7 +145,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;
}, },

12
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;
@ -306,7 +310,7 @@
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)
} }

39
pages/productPutaway/record/productPutawayRecord.vue

@ -46,7 +46,8 @@
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getPrecisionStrategyList getPrecisionStrategyList
@ -312,28 +313,31 @@
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)
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber; submitItem.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch; submitItem.fromBatch = info.batch;
detail.toBatch = info.batch; submitItem.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
subList.push(detail) submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(submitItem)
} }
}) })
}) })
@ -377,6 +381,11 @@
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
this.toLocationCode = code; this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = this.toLocationCode
})
})
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

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)
} }
} }
} }

14
pages/productReceipt/coms/comProductDetailCard.vue

@ -69,7 +69,19 @@
}, },
watch: { watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
}, },
data() { data() {

48
pages/productReceipt/record/productReceiptRecord.vue

@ -57,9 +57,14 @@
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
goHome, goHome,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
@ -194,6 +199,7 @@
Object.assign(detail, label) Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = Number(label.qty);
detail.handleQty = 0;
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -208,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)
} }
} }
} }
@ -300,31 +306,35 @@
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)
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = detail.inventoryStatus; submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toPackingNumber = info.packingNumber; submitItem.toContainerNumber = detail.containerNumber
detail.fromContainerNumber = detail.containerNumber; submitItem.fromBatch = info.batch;
detail.toContainerNumber = detail.containerNumber submitItem.toBatch = info.batch;
detail.fromBatch = info.batch; submitItem.fromLocationCode = detail.locationCode;
detail.toBatch = info.batch; submitItem.toLocationCode = detail.toLocationCode;
detail.fromLocationCode = detail.locationCode; submitItem.productionlineCode = this.productionLineCode;
detail.toLocationCode = detail.toLocationCode; submitItem.workStationCode = this.workStationCode;
detail.productionlineCode = this.productionLineCode; submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
detail.workStationCode = this.workStationCode; submitItem.package = "";
subList.push(detail) subList.push(submitItem)
} }
}) })
}) })
@ -386,7 +396,7 @@
this.clearData(); this.clearData();
}) })
}, },
clearData(){ clearData() {
this.subList = []; this.subList = [];
this.detailSource = []; this.detailSource = [];
this.toLocationCode = ''; this.toLocationCode = '';

1
pages/productionReceipt/record/productionReceiptRecord.vue

@ -47,6 +47,7 @@
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {

10
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';
@ -226,7 +230,7 @@
detail.inventoryStatus = this.businessTypeCode == 'ReturnToStore' ? "OK" : "HOLD" detail.inventoryStatus = this.businessTypeCode == 'ReturnToStore' ? "OK" : "HOLD"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
detail.handleQty = 0;
detail.package = pack; detail.package = pack;
detail.label = label; detail.label = label;
return detail; return detail;
@ -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 = '';

18
pages/productionReturn/coms/comReturnDetailCard.vue

@ -62,14 +62,26 @@
default: {} default: {}
}, },
locationTypeList: { locationTypeList: {
type: Object, type: Array,
default: {} default: []
}, },
}, },
watch: { watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
}, },
data() { data() {

35
pages/productionReturn/coms/comReturnRequestCreator.vue

@ -5,7 +5,7 @@
</comReturnRequestInfo> </comReturnRequestInfo>
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index"> <view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="detailOptions"> <uni-swipe-action-item @click="swipeClick($event,item,index)" :right-options="options">
<item-qty :dataContent="item" :isShowStdPack="false"> <item-qty :dataContent="item" :isShowStdPack="false">
</item-qty> </item-qty>
<!-- <view v-if="item.batch!=''" style="margin-left: 10rpx;"> <!-- <view v-if="item.batch!=''" style="margin-left: 10rpx;">
@ -36,7 +36,7 @@
import { import {
getDetailOption, getDetailOption,
getDetailEditRemoveOption, getDetailEditRemoveOption,
getDetailRemoveOption getDetailRemoveOption,
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
@ -79,7 +79,6 @@
}, },
watch: { watch: {
dataContent(newVal) { dataContent(newVal) {
this.requestItem = newVal.subList[0];
}, },
}, },
@ -92,9 +91,9 @@
} }
}, },
requestItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [] scanOptions: [],
options:[]
} }
}, },
@ -103,26 +102,30 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
} }
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailRemoveOption();
// if (this.dataContent.allowModifyQty == 1) { // if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption(); // this.scanOptions = getDetailEditRemoveOption();
// } else { // } else {
// this.scanOptions = getDetailRemoveOption(); // this.scanOptions = getDetailRemoveOption();
// } // }
} }
if(!this.isSwipe){
this.detailOptions=[] this.options =this.scanOptions
} // if(!this.isSwipe){
// this.options=[]
// }else {
// this.options =this.scanOptions
// }
}, },
methods: { methods: {
swipeClick(e, item) { swipeClick(e, item,index) {
if (e.content.text == "详情") { if (e.content.text == "详情") {
this.detail(item) this.detail(item)
} else if (e.content.text == "编辑") { } else if (e.content.text == "编辑") {
this.edit(item) this.edit(item)
} else if (e.content.text == "移除") { } else if (e.content.text == "移除") {
this.remove(item) this.remove(item,index)
} }
}, },
edit(item) { edit(item) {
@ -136,17 +139,13 @@
// // this.showItem = item; // // this.showItem = item;
// // this.$refs.jobDetailPopup.openPopup(item) // // this.$refs.jobDetailPopup.openPopup(item)
}, },
remove(item) { remove(item,index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?", this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => { res => {
if (res) { if (res) {
item.scaned = false this.dataContent.subList.splice(index, 1)
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.$forceUpdate() this.$forceUpdate()
this.$emit('remove', item) // this.$emit('remove', item)
} }
}); });
}, },

59
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() {
@ -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);

47
pages/productionReturn/record/returnToHold.vue

@ -58,9 +58,14 @@
import { import {
goHome, goHome,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} 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';
@ -229,6 +234,7 @@
Object.assign(detail, label) Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = Number(label.qty);
detail.handleQty = 0;
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -244,7 +250,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)
} }
} }
} }
@ -388,34 +394,37 @@
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)
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);
detail.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = detail.inventoryStatus; submitItem.fromPackingNumber = fromInfo.packingNumber;
submitItem.toPackingNumber = toInfo.packingNumber;
detail.fromPackingNumber = fromInfo.packingNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toPackingNumber = toInfo.packingNumber; submitItem.toContainerNumber = detail.containerNumber
detail.fromContainerNumber = detail.containerNumber; submitItem.fromBatch = fromInfo.batch;
detail.toContainerNumber = detail.containerNumber submitItem.toBatch = toInfo.batch;
detail.fromBatch = fromInfo.batch; submitItem.fromLocationCode = detail.fromLocationCode;
detail.toBatch = toInfo.batch; submitItem.toLocationCode = detail.toLocationCode;
detail.fromLocationCode = detail.fromLocationCode; submitItem.productionlineCode = this.productionLineCode;
detail.toLocationCode = detail.toLocationCode; submitItem.workStationCode = this.workStationCode;
detail.productionlineCode = this.productionLineCode; submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
detail.workStationCode = this.workStationCode;
subList.push(detail) subList.push(submitItem)
} }
}) })
}) })
@ -428,8 +437,6 @@
showMessage(message) { showMessage(message) {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {

43
pages/productionReturn/record/returnToStore.vue

@ -50,12 +50,17 @@
import { import {
goHome, goHome,
getPackingNumberAndBatchByList, getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
calc
} from '@/common/calc.js';
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
@ -230,6 +235,7 @@
Object.assign(detail, label) Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = Number(label.qty);
detail.handleQty =0;
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -245,7 +251,8 @@
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)
} }
} }
} }
@ -417,34 +424,36 @@
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)
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);
detail.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = fromInfo.packingNumber; submitItem.fromPackingNumber = fromInfo.packingNumber;
detail.toPackingNumber = toInfo.packingNumber; submitItem.toPackingNumber = toInfo.packingNumber;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = fromInfo.batch; submitItem.fromBatch = fromInfo.batch;
detail.toBatch = toInfo.batch; submitItem.toBatch = toInfo.batch;
detail.fromLocationCode = detail.fromLocationCode; submitItem.fromLocationCode = detail.fromLocationCode;
detail.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
detail.productionlineCode = this.productionLineCode; submitItem.productionlineCode = this.productionLineCode;
detail.workStationCode = this.workStationCode; submitItem.workStationCode = this.workStationCode;
subList.push(detail) submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
subList.push(submitItem)
} }
}) })
}) })

32
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,
@ -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 => {

31
pages/purchaseReturn/record/returnRecord.vue

@ -54,7 +54,8 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
navigateBack navigateBack,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -273,28 +274,30 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.itemCode = detail.itemCode; var submitItem = deepCopyData(detail)
detail.inventoryStatus = detail.inventoryStatus; submitItem.itemCode = detail.itemCode;
submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = detail.packingNumber; submitItem.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber;; submitItem.toPackingNumber = detail.packingNumber;;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch; submitItem.fromBatch = detail.batch;
detail.toBatch = detail.batch; submitItem.toBatch = detail.batch;
detail.fromLocationCode = this.fromLocationCode; submitItem.fromLocationCode = this.fromLocationCode;
detail.toLocationCode = ''; //退 submitItem.toLocationCode = ''; //退
detail.package = null; submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
subList.push(detail) submitItem.package = "";
subList.push(submitItem)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.creator = creator;
// this.dataContent.jobNumber = ''; // this.dataContent.jobNumber = '';
return this.dataContent; return this.dataContent;
}, },

4
pages/purchaseReturn/request/returnRequestCreate.vue

@ -219,9 +219,9 @@
purchaseReturnRequestCreate(params).then(res => { purchaseReturnRequestCreate(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<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()

40
pages/putaway/record/putawayRecord.vue

@ -59,8 +59,14 @@
goHome, goHome,
updateTitle, updateTitle,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray getDirectoryItemArray
@ -236,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)
} }
} }
} }
@ -311,7 +317,7 @@
putawayRecordSubmit(params).then(res => { putawayRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购上架记录" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成原料上架记录<br>" + res.data, )
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
@ -359,30 +365,30 @@
}, },
setRecordParams() { setRecordParams() {
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
var creator = this.$store.state.user.id
var subList = [] var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.toPackingNumber = info.packingNumber; var submitItem = deepCopyData(detail)
detail.toBatch = info.batch; submitItem.toPackingNumber = info.packingNumber;
detail.toContainerNumber = detail.containerNumber; submitItem.toBatch = info.batch;
submitItem.toContainerNumber = detail.containerNumber;
detail.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
detail.fromBatch = info.batch; submitItem.fromBatch = info.batch;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
// detail.toInventoryStatus = detail.inventoryStatus // detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode // detail.toLocationCode = detail.toLocationCode
detail.package = null; submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
subList.push(detail) submitItem.package = "";
subList.push(submitItem)
} }
}) })
}) })
@ -390,6 +396,8 @@
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode; this.dataContent.toWarehouseCode = subList[0].toWarehouseCode;
} }
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
return this.dataContent; return this.dataContent;
}, },

16
pages/putaway/request/putawayRequestCreate.vue

@ -52,7 +52,6 @@
<script> <script>
import { import {
putawayRequestSubmit, putawayRequestSubmit,
putawayRecordSubmit,
validateItemAndLocation, validateItemAndLocation,
getPutawayRecommendLocation getPutawayRecommendLocation
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -61,6 +60,7 @@
goHome, goHome,
updateTitle, updateTitle,
getCurrDateTime, getCurrDateTime,
deepCopyData,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -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)
} }
} }
} }
@ -286,7 +291,7 @@
putawayRequestSubmit(params).then(res => { putawayRequestSubmit(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 + "]")
} }
@ -308,10 +313,9 @@
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 != 0 ? detail.handleQty : detail.qty;
subItem.package = null; subItem.package = null;
subList.push(subItem) subList.push(subItem)
} }

6
pages/query/container.vue

@ -47,6 +47,10 @@
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'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.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

@ -44,6 +44,10 @@
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'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.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,

19
pages/repleinsh/coms/comScanReplishPack.vue

@ -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';
@ -317,11 +321,14 @@
) )
} }
} else { } else {
if (this.jobContent.AllowModifyBatch == null) { if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot + this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发料明细,是否要继续发料?', res => { '】的发料明细,是否要继续发料?', res => {
if (res) { if (res) {
let batch = that.createBatchInfo(label, balance); let batch = that.createBatchInfo(label, balance,packageInfo);
if(fromLocation.Batchs.length>0){
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
} }
}) })
@ -348,15 +355,15 @@
} }
}, },
createBatchInfo(data, balance) { createBatchInfo(data, balance,packageInfo) {
let batch = { let batch = {
batch: data.lot, batch: data.batch,
qty: 0, qty: 0,
uom: data.uom, uom: data.uom,
handleQty: Number(data.qty), handleQty: Number(data.qty),
Records: [] Records: []
} }
let record = this.creatRecord(data, balance); 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;
@ -383,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;
}, },

95
pages/repleinsh/job/repleinshDetail.vue

@ -63,6 +63,10 @@
getDataSource getDataSource
} from '@/pages/issue/js/issue.js'; } from '@/pages/issue/js/issue.js';
import {
calc
} from '@/common/calc.js';
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -252,7 +256,7 @@
}, },
setParams() { setParams() {
var subList = [] var commitSubList = []
var createTime = getCurrDateTime(); var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
@ -260,52 +264,57 @@
item.Locations.forEach(fromLocation => { item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => { fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail; let subItem = batch.detail;
subItem.recordList = [];
if (batch.Records.length > 0) { if (subItem != undefined) {
batch.Records.forEach(r => { if (batch.Records.length > 0) {
let record = {}; subItem.recordList = [];
record.handleQty = r.qty; batch.Records.forEach(r => {
let record = {};
record.fromPackingNumber = r record.handleQty = r.qty;
.packingNumber;
record.fromBatch = r.batch; record.fromPackingNumber = r
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = this
.toLocationCode;
record.supplierCode = r.supplierCode;
//使
if (this.jobContent.useOnTheWayLocation ==
'TRUE') {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info = getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber; .packingNumber;
record.toBatch = info.batch; record.fromBatch = r.batch;
} record.fromContainerNumber = r
subItem.recordList.push(record); .ContainerNumber;
})
subList.push(subItem); record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
record.toLocationCode = this
.toLocationCode;
record.supplierCode = r.supplierCode;
//使
if (this.jobContent
.useOnTheWayLocation ==
'TRUE') {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info =
getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
}
subItem.recordList.push(record);
})
commitSubList.push(subItem);
}
} }
}) })
}) })
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = commitSubList
this.jobContent.createTime = createTime; this.jobContent.createTime = createTime;
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
@ -353,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)
} }
}) })
} }
@ -444,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)
} }
}) })
}) })

33
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,
@ -233,7 +237,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 +269,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 +294,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 +327,7 @@
}, },
closeScanPopup() { closeScanPopup() {
if(this.$refs.scanPopup!=undefined){ if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
} }
}, },
@ -406,18 +410,19 @@
.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);

41
pages/scrap/record/scrapRecord.vue

@ -19,6 +19,7 @@
<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" :isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
:isShowToLocation="false"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -55,6 +56,7 @@
import { import {
goHome, goHome,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -274,30 +276,34 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.itemCode = detail.itemCode; var submitItem = deepCopyData(detail)
detail.itemName = detail.package.itemName; submitItem.itemCode = detail.itemCode;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemName = detail.package.itemName;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = detail.packingNumber; detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber; detail.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch; submitItem.fromBatch = detail.batch;
detail.toBatch = detail.batch; submitItem.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
detail.toLocationCode = ""; submitItem.toLocationCode = "";
detail.reason = this.reasonCode; submitItem.reason = this.reasonCode;
subList.push(detail) submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(submitItem)
} }
}) })
}) })
this.dataContent.subList =subList this.dataContent.subList =subList
this.dataContent.creator = creator; this.dataContent.creator = creator;
return this.dataContent; return this.dataContent;
@ -337,12 +343,13 @@
}) })
}, },
clearData(){ clearData(){
this.reasonCode = "" this.reasonCode = "";
this.fromLocationCode = "";
this.reasonText = ""; this.reasonText = "";
this.detailSource = []; this.detailSource = [];
this.subList =[]; this.subList = [];
this.managementList =[]; this.managementList = [];
this.dataContent ={} this.dataContent = {}
}, },
updateData() { updateData() {

38
pages/transfer/coms/comTransferRecord.vue

@ -51,6 +51,7 @@
import { import {
goHome, goHome,
deepCopyData,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -338,28 +339,32 @@
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)
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber; submitItem.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch; submitItem.fromBatch = info.batch;
detail.toBatch = info.batch; submitItem.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
subList.push(detail) submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(submitItem)
} }
}) })
}) })
@ -412,6 +417,11 @@
// return // return
// } // }
this.toLocationCode = code; this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

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,8 +225,10 @@
createDetailInfo(data) { createDetailInfo(data) {
data.scaned = false; data.scaned = false;
// data.record = {}; // data.record = {};
let detail = data; let detail = data;
return detail; detail.handleQty = 0,
return detail;
}, },
calcScanCount(closeScan) { calcScanCount(closeScan) {
@ -242,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)
} }
} }
} }

445
pages/transfer/record/deliverRecord.vue

@ -1,29 +1,462 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comTransferRecord transferType="TransferDeliver"> </comTransferRecord> <view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="fromLocationCode==''"></com-blank-view>
</view>
<view class="page-wraper" v-if="fromLocationCode!=''">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :isShowLocation="true"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
</view> </view>
</template> </template>
<script> <script>
import comTransferRecord from '@/pages/transfer/coms/comTransferRecord.vue' import {
transferIssueRecordSubmit
} from '@/api/request2.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default { export default {
components: { components: {
comTransferRecord winScanButton,
winScanPack,
requiredLocation,
comBlankView,
winScanLocation,
comMessage,
winScanPackAndLocation,
recordComDetailCard
}, },
data() { data() {
return { return {
id: '',
subList: [], //subList
detailSource: [], //
locationTypeList: [],
fromLocationCode: "",
toLocationCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
managementList: [],
dataContent: {},
toWarehouseCode: ''
};
},
onLoad(option) {
var typeCode = "TransferDeliver"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} }
}, },
//
onBackPress(e) {},
onPullDownRefresh() {},
onLoad() {},
methods: { methods: {
getScanResult(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.inventoryStatus = "OK"
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
transferIssueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成调拨出库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var submitItem = deepCopyData(detail)
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
submitItem.package = "";
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toWarehouseCode = location.warehouseCode
// if (this.fromLocationCode == code) {
// uni.showToast({
// title: "[" + this.fromLocationCode + "][" + code + "]",
// duration: 2000
// })
// return
// }
this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
})
},
clearData() {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}
} }
} }
</script> </script>
<style> <style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
</style> </style>

423
pages/transfer/record/receiptRecord.vue

@ -1,29 +1,440 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comTransferRecord transferType="TransferReceipt"> </comTransferRecord> <view class="">
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :isShowFromLocation="false"
:isShowToLocation="false"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import comTransferRecord from '@/pages/transfer/coms/comTransferRecord.vue' import {
transferReceiptRecordSubmit
} from '@/api/request2.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default { export default {
components: { components: {
comTransferRecord winScanButton,
winScanPack,
requiredLocation,
comBlankView,
comMessage,
recordComDetailCard
}, },
data() { data() {
return { return {
id: '',
subList: [], //subList
detailSource: [], //
locationTypeList: [],
toLocationCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
managementList: [],
dataContent: {},
toWarehouseCode: ''
};
},
onLoad(option) {
var typeCode = "TransferReceipt"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} }
}, },
//
onBackPress(e) {},
onPullDownRefresh() {},
onLoad() {},
methods: { methods: {
getScanResult(result) {
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == label.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(label, pack);
let newDetail = createDetailInfo(label, pack); //
newDetail.inventoryStatus = "OK"
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == label.packingNumber &&
r.batch == label.batch) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(label, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
this.calcHandleQty();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
transferReceiptRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成调拨入库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var submitItem = deepCopyData(detail)
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
submitItem.package = "";
subList.push(submitItem)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
},
getToLocationCode(location, code) {
this.toWarehouseCode = location.warehouseCode
// if (this.fromLocationCode == code) {
// uni.showToast({
// title: "[" + this.fromLocationCode + "][" + code + "]",
// duration: 2000
// })
// return
// }
this.toLocationCode = code;
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
})
},
clearData() {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
},
updateData() {
this.calcHandleQty();
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}
} }
} }
</script> </script>
<style> <style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
</style> </style>

39
pages/unPlanned/record/issueRecord.vue

@ -71,7 +71,8 @@
import { import {
goHome, goHome,
updateTitle updateTitle,
deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
export default { export default {
@ -233,27 +234,31 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.itemCode = detail.itemCode; var submitItem = deepCopyData(detail)
detail.itemName = detail.package.itemName; submitItem.itemCode = detail.itemCode;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemName = detail.package.itemName;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = detail.packingNumber; submitItem.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber; submitItem.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch; submitItem.fromBatch = detail.batch;
detail.toBatch = detail.batch; submitItem.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
detail.toLocationCode = ""; submitItem.toLocationCode = "";
detail.reason = this.reasonCode; submitItem.reason = this.reasonCode;
subList.push(detail) submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(submitItem)
} }
}) })
}) })
@ -274,7 +279,7 @@
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
}) })
}, },
clearData(){ clearData(){

38
pages/unPlanned/record/receiptRecord.vue

@ -64,9 +64,14 @@
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
deepCopyData,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -182,6 +187,7 @@
detail.scaned = true; detail.scaned = true;
// Object.assign(detail, label) // Object.assign(detail, label)
detail.qty = Number(label.qty) detail.qty = Number(label.qty)
detail.handleQty = 0,
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -197,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)
} }
} }
} }
@ -308,31 +314,35 @@
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)
var info = getPackingNumberAndBatchByList(this.managementList, detail.label.itemCode, var info = getPackingNumberAndBatchByList(this.managementList, detail.label.itemCode,
detail.label.packingNumber, detail.toLocationCode, detail.label.batch); detail.label.packingNumber, detail.toLocationCode, detail.label.batch);
detail.itemCode = detail.package.itemCode; submitItem.itemCode = detail.package.itemCode;
detail.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber; submitItem.toPackingNumber = info.packingNumber;
// detail.fromContainerNumber = detail.containerNumber; // detail.fromContainerNumber = detail.containerNumber;
// detail.toContainerNumber = detail.containerNumber // detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch; submitItem.fromBatch = info.batch;
detail.toBatch = info.batch; submitItem.toBatch = info.batch;
submitItem.fromLocationCode = "";
submitItem.toLocationCode = detail.toLocationCode;
detail.fromLocationCode = ""; submitItem.reason = this.reasonCode;
detail.toLocationCode = detail.toLocationCode;
detail.reason = this.reasonCode; submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.package ="";
subList.push(detail) subList.push(submitItem)
} }
}) })
}) })

41
pages/unPlanned/request/receiptRequestCreate.vue

@ -9,9 +9,10 @@
<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>
@ -21,9 +22,9 @@
<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,
@ -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,7 +143,7 @@
} else { } else {
// //
result[0].qty += item.qty result[0].qty = calc.add(result[0].qty,item.qty)
} }
} }
@ -149,7 +154,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;
}, },
@ -181,14 +186,14 @@
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();

Loading…
Cancel
Save