Browse Source

增加盲盘时的校验

hella_online_20240829
Niext 2 months ago
parent
commit
577165bb0e
  1. 4
      src/pages/count/coms/comFuzzyCountJobCard.vue
  2. 168
      src/pages/count/job/fuzzyCountDetail.vue

4
src/pages/count/coms/comFuzzyCountJobCard.vue

@ -1,5 +1,9 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<view class="card_view">
<text class="card_packing_code ">盘点计划</text>
<text class="card_content ">{{dataContent.planNumber}}</text>
</view>
<view v-if="dataContent.countRange!=undefined" class=""> <view v-if="dataContent.countRange!=undefined" class="">
<view v-for="(range, index) in dataContent.countRange" :key="index"> <view v-for="(range, index) in dataContent.countRange" :key="index">
<view class="card_view"> <view class="card_view">

168
src/pages/count/job/fuzzyCountDetail.vue

@ -3,18 +3,27 @@
<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 class="card_view">
<text class="card_packing_code ">盘点计划</text>
<text class="card_content ">{{jobContent.planNumber}}</text>
</view>
<view v-for="(range, index) in dataContent.countRange" :key="index">
<view class="card_view">
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text>
<text class="card_content ">{{range.value}}</text>
</view>
</view>
</view> </view>
</view> </view>
<view class="page-main" style="height: 500px;"> <view class="page-main" >
<view class=""> <view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)" :right-options="editRemoveOption">
:right-options="editRemoveOption"> <!-- {{editRemoveOption}} -->
{{editRemoveOption}}
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<package-and-item-card :dataContent="item"></package-and-item-card> <package-and-item-card :dataContent="item"></package-and-item-card>
@ -56,13 +65,10 @@
cancleTakeCountJob, cancleTakeCountJob,
countJobSubmit countJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import { import {
Decimal getCountScopeType
} from 'decimal.js'; // } from '@/common/directory.js';
import { import {
getEditRemoveOption getEditRemoveOption
@ -73,9 +79,6 @@
navigateBack, navigateBack,
getPackingNumberAndBatch getPackingNumberAndBatch
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getCountStageName
} from '@/common/directory.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -132,7 +135,7 @@
} }
} }
this.showFromLocationPopup(); this.showFromLocationPopup();
this.editRemoveOption=getEditRemoveOption(); this.editRemoveOption = getEditRemoveOption();
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -202,6 +205,41 @@
}, },
getLocation(location, code) { getLocation(location, code) {
let countRange = this.jobContent.countRange;
let range = countRange.find(r => r.type == "LOCATION_CODE");
if (range != undefined) {
if (!rang.value.includes(location.code)) {
this.showErrorMessage("库位代码【" + location.code + "】,不在盘点库位范围【" + rangeValue + "】内")
return;
}
} else {
range = countRange.find(r => r.type == "LOCATIONGROUP_CODE");
if (range != undefined) {
if (!rang.value.includes(location.locationGroupCode)) {
this.showErrorMessage("库位组代码【" + location.locationGroupCode + "】,不在盘点库位组范围【" + rangeValue +
"】内")
return;
}
} else {
range = countRange.find(r => r.type == "AREA_CODE");
if (range != undefined) {
if (!rang.value.includes(location.areaCode)) {
this.showErrorMessage("库区代码【" + location.areaCode + "】,不在盘点库区范围【" + rangeValue + "】内")
return;
}
} else {
range = countRange.find(r => r.type == "WAREHOUSE_CODE");
if (range != undefined) {
if (!rang.value.includes(location.warehouseCode)) {
this.showErrorMessage("仓库代码【" + location.warehouseCode + "】,不在盘点仓库范围【" + rangeValue +
"】内")
return;
}
}
}
}
}
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
@ -246,8 +284,22 @@
// //
getScanResult(result) { getScanResult(result) {
let that = this; let that = this;
let item = this.createDetailInfo(result.package); let package = result.package;
this.detailSource.push(item) let detail = this.detailSource.find(r => r.itemCode == package.itemCode && r.packingNumber == package
.packingNumber && r.batch == package.batch && r.inventoryStatus == "OK");
if (detail == undefined) {
detail = this.createDetailInfo(package);
this.detailSource.push(detail)
} else {
let index = detail.index;
list.unshift(list.splice(index, 1)[0]); //
//
this.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => {
if (res) {
this.edit(detail);
}
});
}
}, },
// //
@ -277,57 +329,43 @@
return detail; return detail;
}, },
swipeClick(e, item) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
// //
editCountResult(item, subItem) { edit(item) {
let that = this; let that = this;
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + this.currentEditItem = item;
"】已经完成盘点,是否要编辑盘点结果?", this.$refs.countQtyEdit.openEditPopup(item);
res => {
if (res) {
this.currentEditItem = subItem;
this.$refs.countQtyEdit.openEditPopup(subItem,
item.subList);
// this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem,
// item.subList);
} else {
this.scanPopupGetFocus();
}
})
}, },
editConfirm(qty, inventoryStatus, mode) {
editClose() { let that = this;
//
if (mode == 'edit') {
this.currentEditItem.countQty = qty;
this.currentEditItem.qty = qty;
this.currentEditItem.inventoryStatus = inventoryStatus;
}
this.scanPopupGetFocus(); this.scanPopupGetFocus();
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
}, },
edit(detail) { editClose() {
this.$emit("editItem", detail) this.scanPopupGetFocus();
}, },
detail(item) {
this.showItem = item;
this.$refs.detailInfoPopup.openPopup(item);
},
remove(item, index) { remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", this.showQuestionMessage("是否要移除扫描信息?", res => {
res => { if (res) {
if (res) { this.dataContent.subList.splice(index, 1)
// this.dataContent.subList.splice(index, 1) }
item.scaned = false; });
item.handleQty = 0;
this.$emit('removePack')
}
});
}, },
commit() { commit() {
@ -363,7 +401,6 @@
return this.jobContent; return this.jobContent;
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) { if (res) {
@ -371,6 +408,7 @@
} }
}); });
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
@ -383,6 +421,12 @@
this.$refs.comMessage.showScanMessage(message); this.$refs.comMessage.showScanMessage(message);
}, },
showQuestionMessage(message, callback) {
this.$refs.comMessage.showQuestionMessage(message, res => {
callback(res);
});
},
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
@ -403,13 +447,11 @@
navigateBack(1); navigateBack(1);
}) })
}, },
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == "TRUE" ? "明盘" : "盲盘"
}
getCountScopeName(value) {
let item = getCountScopeType(value);
return item.label;
},
} }
} }
@ -450,4 +492,4 @@
background: #e0e0e0; background: #e0e0e0;
} }
</style> </style>

Loading…
Cancel
Save