Browse Source

修改盘点

intex_online20250327
lijuncheng 2 weeks ago
parent
commit
6e4a02ffbc
  1. 2
      src/pages/count/coms/comCountDetailcards.vue
  2. 6
      src/pages/count/coms/comCountRecordCard.vue
  3. 305
      src/pages/count/job/countLightDetail.vue

2
src/pages/count/coms/comCountDetailcards.vue

@ -126,7 +126,7 @@
this.$emit('summCount', this.dataContent.countAllRecordList)
},
currentCount(){
this.$emit('currentCount', this.dataContent.recordList)
this.$emit('currentCount', this.dataContent,this.dataContent.recordList)
}
},

6
src/pages/count/coms/comCountRecordCard.vue

@ -7,7 +7,7 @@
<view class="" style="margin-left: 20rpx;">
<view class="" v-for="(item,index) in recordList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="scanOptions">
<uni-swipe-action-item @click="swipeClick($event,item,index)" :right-options="scanOptions">
<recommend-count :detail="item" :isShowFromLocation="false"
style='margin:1px 0px;color: #000; font-weight: bold;' :isShowRecommendQty="false">
</recommend-count>
@ -105,11 +105,11 @@
},
methods: {
swipeClick(e, item) {
swipeClick(e, item,index) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
this.remove(item,index)
}
},

305
src/pages/count/job/countLightDetail.vue

@ -169,6 +169,27 @@
computed() {},
methods: {
filterList(originalList) {
var resultList = []
for (var i = 0; i < originalList.length; i++) {
let flag = -1
for (var j = 0; j < resultList.length; j++) {
if (resultList[j].find(item => item.inventoryStatus == originalList[i]['inventoryStatus'])) {
flag = j
break
}
}
if (flag == -1) {
resultList.push([originalList[i]])
} else {
resultList[j].push(originalList[i])
}
}
return resultList;
},
getManageMode(value) {
var manageMode = ""
if (value == 'BY_BATCH') {
@ -209,6 +230,220 @@
},
refreshData(returnData) {
if (returnData.recordList.length == 0) {
if (this.manageMode == "BY_BATCH") {
var mainItem = this.dataList.find(r =>
r.itemCode == returnData.itemCode &&
r.batch == returnData.batch &&
r.inventoryStatus == returnData.inventoryStatus)
if (mainItem) {
mainItem.recordList = []
} else if (this.manageMode == "BY_QUANTITY") {
var mainItem = this.dataList.find(r =>
r.itemCode == returnData.itemCode &&
r.inventoryStatus == returnData.inventoryStatus)
if (mainItem) {
mainItem.recordList = []
}
}
}
} else {
var filterList = this.filterList(returnData.recordList)
var addList = []
filterList.forEach(main => {
main.forEach(subItem => {
if (this.manageMode == "BY_BATCH") {
var mainItem = this.dataList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.inventoryStatus == subItem.inventoryStatus)
subItem.toPackingNumber = ""
if (mainItem) {
mainItem.scaned = true;
//record
if (this.currentEditItem.itemCode == mainItem.itemCode &&
this.currentEditItem.batch == mainItem.batch &&
this.currentEditItem.inventoryStatus == mainItem.inventoryStatus) {
mainItem.recordList = []
mainItem.recordList = main
} else {
//
var tempRecord = mainItem.recordList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.packingNumber == subItem.packingNumber &&
r.inventoryStatus == subItem.inventoryStatus)
if (tempRecord) {
tempRecord.handleQty = subItem.handleQty
} else {
mainItem.recordList.push(subItem)
}
}
} else {
var detail = this.createBackAddDetailInfo(subItem)
if (!detail.recordList) {
detail.recordList = []
}
var recordItem = {
scaned: true,
isNewJobDetail: "true",
itemCode: subItem.itemCode,
itemName: subItem.itemName,
itemDesc1: subItem.itemDesc1,
itemDesc2: subItem.itemDesc2,
packingNumber: subItem.packingNumber,
toPackingNumber: subItem.toPackingNumber,
toBatch: subItem.toBatch,
batch: subItem.batch,
inventoryStatus: subItem.inventoryStatus,
qty: subItem.qty,
handleQty: subItem.handleQty,
uom: subItem.uom,
packUnit: subItem.packUnit,
packQty: subItem.packQty,
balanceQty: subItem.balanceQty,
locationCode: subItem.locationCode
}
detail.recordList.push(recordItem)
var mainItem = addList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.inventoryStatus == subItem.inventoryStatus)
if (mainItem) {
if (this.currentEditItem.itemCode == mainItem.itemCode &&
this.currentEditItem.batch == mainItem.batch &&
this.currentEditItem.inventoryStatus == mainItem
.inventoryStatus) {
mainItem.recordList = []
mainItem.recordList = main
} else {
var tempRecord = mainItem.recordList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.packingNumber == subItem.packingNumber &&
r.inventoryStatus == subItem.inventoryStatus)
if (tempRecord) {
tempRecord.handleQty = subItem.handleQty
} else {
mainItem.recordList.push(subItem)
}
}
} else {
//
addList.push(detail)
}
}
} else if (this.manageMode == "BY_QUANTITY") {
var mainItem = this.dataList.find(r =>
r.itemCode == subItem.itemCode &&
r.inventoryStatus == subItem.inventoryStatus)
subItem.toPackingNumber = ""
subItem.toBatch = ""
//
if (mainItem) {
mainItem.scaned = true;
//record
if (this.currentEditItem.itemCode == mainItem.itemCode &&
this.currentEditItem.inventoryStatus == mainItem.inventoryStatus) {
mainItem.recordList = []
mainItem.recordList = main
} else {
var tempRecord = mainItem.recordList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.packingNumber == subItem.packingNumber &&
r.inventoryStatus == subItem.inventoryStatus)
if (tempRecord) {
tempRecord.handleQty = subItem.handleQty
} else {
mainItem.recordList.push(subItem)
}
}
} else {
//
var detail = this.createBackAddDetailInfo(subItem)
detail.batch=""
if (!detail.recordList) {
detail.recordList = []
}
var recordItem = {
scaned: true,
isNewJobDetail: "true",
itemCode: subItem.itemCode,
itemName: subItem.itemName,
itemDesc1: subItem.itemDesc1,
itemDesc2: subItem.itemDesc2,
packingNumber: subItem.packingNumber,
toPackingNumber: subItem.toPackingNumber,
toBatch: subItem.toBatch,
batch: subItem.batch,
inventoryStatus: subItem.inventoryStatus,
qty: subItem.qty,
handleQty: subItem.handleQty,
uom: subItem.uom,
packUnit: subItem.packUnit,
packQty: subItem.packQty,
balanceQty: subItem.balanceQty,
locationCode: subItem.locationCode
}
detail.recordList.push(recordItem)
var mainItem = addList.find(r =>
r.itemCode == subItem.itemCode &&
r.inventoryStatus == subItem.inventoryStatus)
//
if (mainItem) {
//,
if (this.currentEditItem.itemCode == mainItem.itemCode &&
this.currentEditItem.inventoryStatus == mainItem
.inventoryStatus) {
mainItem.recordList = []
mainItem.recordList = main
} else {
var tempRecord = mainItem.recordList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.packingNumber == subItem.packingNumber &&
r.inventoryStatus == subItem.inventoryStatus)
if (tempRecord) {
tempRecord.handleQty = subItem.handleQty
} else {
mainItem.recordList.push(subItem)
}
}
} else {
//
addList.push(detail)
}
}
}
})
})
if (addList.length > 0) {
this.dataList = this.dataList.concat(addList)
}
}
this.updateList(false);
},
refreshData2222(returnData) {
//
//
if (returnData.recordList.length == 0) {
@ -238,12 +473,25 @@
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.inventoryStatus == subItem.inventoryStatus)
subItem.toPackingNumber=""
subItem.toPackingNumber = ""
//
if (mainItem) {
mainItem.scaned = true;
mainItem.recordList = []
mainItem.recordList.push(subItem)
if (mainItem.recordList && mainItem.recordList.length > 0) {
mainItem.scaned = true;
var tempRecord = mainItem.recordList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.inventoryStatus == subItem.inventoryStatus)
if (tempRecord) {
tempRecord.handleQty = subItem.handleQty
} else {
mainItem.recordList.push(subItem)
}
} else {
mainItem.recordList = []
mainItem.recordList.push(subItem)
}
} else {
//
var detail = this.createBackAddDetailInfo(subItem)
@ -278,13 +526,25 @@
var mainItem = this.dataList.find(r =>
r.itemCode == subItem.itemCode &&
r.inventoryStatus == subItem.inventoryStatus)
subItem.toPackingNumber=""
subItem.toBatch=""
subItem.toPackingNumber = ""
subItem.toBatch = ""
//
if (mainItem) {
mainItem.scaned = true;
mainItem.recordList = []
mainItem.recordList.push(subItem)
if (mainItem.recordList && mainItem.recordList.length > 0) {
mainItem.scaned = true;
var tempRecord = mainItem.recordList.find(r =>
r.itemCode == subItem.itemCode &&
r.batch == subItem.batch &&
r.inventoryStatus == subItem.inventoryStatus)
if (tempRecord) {
tempRecord.handleQty = subItem.handleQty
} else {
mainItem.recordList.push(subItem)
}
} else {
mainItem.recordList = []
mainItem.recordList.push(subItem)
}
} else {
//
var detail = this.createBackAddDetailInfo(subItem)
@ -344,7 +604,21 @@
}
},
currentCount(recordList) {
currentCount(currentItem, recordList) {
if (!recordList) {
this.showMessage("请先扫描箱码")
return
}
if (this.manageMode == 'BY_BATCH') {
this.currentEditItem = this.dataList.find(r => r.itemCode == currentItem.itemCode &&
r.batch == currentItem.batch &&
r.inventoryStatus == currentItem.inventoryStatus)
} else {
this.currentEditItem = this.dataList.find(r => r.itemCode == currentItem.itemCode &&
r.inventoryStatus == currentItem.inventoryStatus)
}
if (recordList) {
uni.navigateTo({
url: `/pages/count/job/countRecord?data=${encodeURIComponent(JSON.stringify(recordList))}`
@ -431,8 +705,8 @@
r.locationCode == scanItem.locationCode &&
r.batch == scanItem.batch &&
r.inventoryStatus == scanItem.inventoryStatus)
//
scanItem.toPackingNumber = ""
//
scanItem.toPackingNumber = ""
//,recordList
if (mainItem) {
if (!mainItem.recordList) {
@ -446,7 +720,7 @@
res.batch == scanItem.batch &&
res.inventoryStatus == scanItem.inventoryStatus
)
//
if (subItem) {
@ -487,8 +761,8 @@
r.itemCode == scanItem.itemCode &&
r.locationCode == scanItem.locationCode &&
r.inventoryStatus == scanItem.inventoryStatus)
scanItem.toBatch = ""
scanItem.toPackingNumber = ""
scanItem.toBatch = ""
scanItem.toPackingNumber = ""
//,recordList
if (item) {
if (!item.recordList) {
@ -513,6 +787,7 @@
} else {
//,
var detail = this.createAddDetailInfo(scanItem)
detail.batch=""
if (!detail.recordList) {
detail.recordList = []

Loading…
Cancel
Save