Browse Source

扫描后将扫描信息置顶

hella_online_20240829
niexiting 3 months ago
parent
commit
d3d6259971
  1. 10
      .env.development
  2. 18
      src/common/detail.js
  3. 4
      src/manifest.json
  4. 71
      src/pages/purchaseReceipt/job/receiptDetail.vue

10
.env.development

@ -1,11 +1,11 @@
#VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
#VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api # 租户配置
# 租户配置 VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=true VITE_isDevelopment=true
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

18
src/common/detail.js

@ -34,8 +34,9 @@ export function getTreeDataSource(dataList) {
items.forEach(r => items.forEach(r =>
r.subList.forEach(s => { r.subList.forEach(s => {
s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber) s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber)
s.packList.forEach(pac=>{ s.packList.forEach(pac => {
pac.scaned=false; pac.scaned = false;
pac.scanDate = new Date();
}) })
}) })
) )
@ -61,7 +62,7 @@ export function getDataSource(subList) {
} }
}) })
return items; return items;
} }
export function createItemInfo(detail) { export function createItemInfo(detail) {
let item = { let item = {
@ -79,6 +80,7 @@ export function createItemInfo(detail) {
export function createDetailInfo(data) { export function createDetailInfo(data) {
data.scaned = false; data.scaned = false;
data.scanDate = new Date();
let detail = data; let detail = data;
detail.packList = []; detail.packList = [];
return detail; return detail;
@ -104,8 +106,8 @@ export function calcHandleQty(detailSource) {
item.handleQty = new Decimal(0).toNumber(); item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber(); item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined ) { if (detail != undefined) {
if(detail.scaned){ if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty); item.handleQty = calc.add(item.handleQty, detail.handleQty);
} }
item.qty = calc.add(item.qty, detail.qty); item.qty = calc.add(item.qty, detail.qty);
@ -120,10 +122,10 @@ export function calcTreeHandleQty(detailSource) {
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined && detail.scaned) { if (detail != undefined && detail.scaned) {
if(detail.packList.length>0){ if (detail.packList.length > 0) {
detail.handleQty = new Decimal(0).toNumber(); detail.handleQty = new Decimal(0).toNumber();
for (let pack of detail.packList){ for (let pack of detail.packList) {
if(pack!=undefined&&pack.scaned){ if (pack != undefined && pack.scaned) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty); detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
} }
} }

4
src/manifest.json

@ -2,8 +2,8 @@
"name" : "wms", "name" : "wms",
"appid" : "__UNI__C9CF4BF", "appid" : "__UNI__C9CF4BF",
"description" : "", "description" : "",
"versionName" : "1.0.28", "versionName" : "1.0.37",
"versionCode" : 28, "versionCode" : 37,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

71
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -78,7 +78,7 @@
goHome, goHome,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
compareAsc, compareDesc,
navigateBack, navigateBack,
getSwitchInfoByCode getSwitchInfoByCode
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -282,18 +282,19 @@
} else { } else {
itemDetail.forEach(item => { itemDetail.forEach(item => {
item.scaned = true; item.scaned = true;
itemDetail.scaneDate = new Date(); itemDetail.scanDate = new Date();
item.handleQty = item.qty; item.handleQty = item.qty;
item.toLocationCode = this.toLocationCode; item.toLocationCode = this.toLocationCode;
}) })
this.detailSource[0].subList.sort(compareAsc('scaneDate')); //
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan() this.continueScan()
this.$forceUpdate() this.$forceUpdate()
} }
} }
} else if (result.label.labelType == "PurchaseLabel") { } else if (result.label.labelType == "PurchaseLabel") {
var packingNumber = result.label.packingNumber; var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch; var batch = result.label.batch;
var qty = result.label.qty; var qty = result.label.qty;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
@ -304,51 +305,35 @@
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch ==
batch); batch);
if (itemDetail == undefined) { if (itemDetail == undefined) {
var isExit; itemDetail = detail.subList.find(r => r.packingNumber == parentpackingNumber && r.batch ==
let subItem; batch);
let index = -1;
for (subItem of detail.subList) {
var item;
for (var i = 0; i < subItem.packList.length; i++) {
let pack = subItem.packList[i];
index = i;
if (pack.packingNumber == packingNumber &&
pack.batch == batch) {
item = pack;
isExit = pack;
break;
}
}
// for (let pack of subItem.packList) {
// if (pack.packingNumber == packingNumber &&
// pack.batch == batch) {
// item = pack;
// isExit = pack;
// break;
// }
// }
// if (item != undefined) {
// subItem.scaned = true
// subItem.handleQty = 0;
// item = undefined
// }
}
if (isExit == undefined) { if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else { } else {
if (isExit.scaned) { var pack = itemDetail.packList.find(p => p.packingNumber == packingNumber &&
p.batch == batch)
if (pack == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if (pack.scaned) {
pack.scanDate = new Date();
this.showMessage("箱码【" + packingNumber + "】已经扫描"); this.showMessage("箱码【" + packingNumber + "】已经扫描");
} else { } else {
isExit.scaned = true pack.scaned = true
isExit.handleQty = Number(result.label.qty); pack.scanDate = new Date();
isExit.toLocationCode = this.toLocationCode; pack.handleQty = Number(result.label.qty);
isExit.labelQty = Number(result.label.qty); pack.toLocationCode = this.toLocationCode;
pack.labelQty = Number(result.label.qty);
} }
} }
calcTreeHandleQty(this.detailSource); calcTreeHandleQty(this.detailSource);
itemDetail.packList.sort(compareDesc('scanDate')); //
this.$forceUpdate() this.$forceUpdate()
}
} else { } else {
//,
var scanedLength = 0; var scanedLength = 0;
itemDetail.packList.forEach(res => { itemDetail.packList.forEach(res => {
if (res.scaned) { if (res.scaned) {
@ -357,23 +342,23 @@
}) })
if (itemDetail.scaned && scanedLength == itemDetail if (itemDetail.scaned && scanedLength == itemDetail
.packList.length) { .packList.length) {
isExit.scanDate = new Date();
this.showMessage("箱码【" + packingNumber + "】已经扫描") this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.scaneDate = new Date(); itemDetail.scanDate = new Date();
this.detailSource[0].subList.sort(compareAsc('scaneDate')); //
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode; itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty); itemDetail.labelQty = Number(result.label.qty);
itemDetail.packList.forEach(pac => { itemDetail.packList.forEach(pac => {
pac.scaned = true pac.scaned = true
itemDetail.scaneDate = new Date(); pac.scanDate = new Date();
pac.handleQty = Number(pac.qty); pac.handleQty = Number(pac.qty);
pac.toLocationCode = this.toLocationCode; pac.toLocationCode = this.toLocationCode;
}) })
calcTreeHandleQty(this.detailSource); calcTreeHandleQty(this.detailSource);
var test = this.detailSource this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan() this.continueScan()
this.$forceUpdate() this.$forceUpdate()
} }

Loading…
Cancel
Save