From 29c71637f55f7c943b4f58cf84268e644dde83bc Mon Sep 17 00:00:00 2001
From: niexiting <85552560@qq.com>
Date: Wed, 6 Mar 2024 16:54:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=87=E8=B4=AD=E6=94=B6?=
=?UTF-8?q?=E8=B4=A7=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/detail.js | 155 ++++++++++--------
src/mycomponents/detail/detailList.vue | 146 +++++++++++++++++
.../coms/comReceiptDetailCard.vue | 56 ++++---
.../purchaseReceipt/job/receiptDetail.vue | 9 +-
src/static/config.js | 2 +-
5 files changed, 271 insertions(+), 97 deletions(-)
create mode 100644 src/mycomponents/detail/detailList.vue
diff --git a/src/common/detail.js b/src/common/detail.js
index d004df04..13a3a8b6 100644
--- a/src/common/detail.js
+++ b/src/common/detail.js
@@ -1,83 +1,100 @@
import {
- calc
- } from '@/common/calc'
+ calc
+} from '@/common/calc'
-import { Decimal } from 'decimal.js';//引入
- export function getDataSource(subList) {
- let items = [];
- subList.forEach(detail => {
- var item = items.find(r =>
- r.itemCode == detail.itemCode)
- if (item == undefined) {
- item = createItemInfo(detail);
- let newDetail = createDetailInfo(detail); //
- item.subList.push(newDetail);
- items.push(item)
- } else {
- item.qty = calc.add(item.qty, detail.qty)
- let newDetail = createDetailInfo(detail); //
- item.subList.push(newDetail);
- }
- })
- return items;
- }
+import {
+ Decimal
+} from 'decimal.js'; //引入
+export function getDataSource(dataList) {
+ let items = [];
- export function createItemInfo(detail) {
- let item = {
- itemCode: detail.itemCode,
- itemName: detail.itemName,
- stdPackQty: Number(detail.stdPackQty) || undefined,
- stdPackUnit: detail.stdPackUnit,
- qty: Number(detail.qty),
- handleQty: 0,
- uom: detail.uom,
- subList: []
+ let parentList = dataList.filter(r => r.parentPackingNumber == null || r
+ .parentPackingNumber == '');
+ let childList = dataList.filter(r => r.parentPackingNumber != '' && r.parentPackingNumber != null);
+
+ parentList.forEach(detail => {
+ var item = items.find(r =>
+ r.itemCode == detail.itemCode)
+ if (item == undefined) {
+ item = createItemInfo(detail);
+ let newDetail = createDetailInfo(detail); //
+ item.subList.push(newDetail);
+ items.push(item)
+ } else {
+ item.qty = calc.add(item.qty, detail.qty)
+ let newDetail = createDetailInfo(detail); //
+ item.subList.push(newDetail);
}
- return item;
- }
+ })
+
+ if (childList.length > 0) {
+ items.forEach(r =>
+ r.subList.forEach(s => {
+ s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber)
+ })
- export function createDetailInfo(data) {
- data.scaned = false;
- // data.record = {};
- let detail = data;
- return detail;
+ )
}
- //根据明细创建记录
- export function createRecordInfo(detail, balance) {
- var record = {}
- // let record = JSON.parse(JSON.stringify(detail));
- //克隆对象,深度克隆,防止双向绑定同一个变量
- Object.assign(record, detail)
- detail.scaned = true;
- detail.balance = balance;
- detail.recommendInventoryStatus = detail.inventoryStatus;
- detail.inventoryStatus = balance.inventoryStatus;
- record.qty = Number(balance.qty);
- return record;
+ return items;
+}
+
+export function createItemInfo(detail) {
+ let item = {
+ itemCode: detail.itemCode,
+ itemName: detail.itemName,
+ stdPackQty: Number(detail.stdPackQty) || undefined,
+ stdPackUnit: detail.stdPackUnit,
+ qty: Number(detail.qty),
+ handleQty: 0,
+ uom: detail.uom,
+ subList: []
}
+ return item;
+}
+
+export function createDetailInfo(data) {
+ data.scaned = false;
+ let detail = data;
+ detail.packList = [];
+ return detail;
+}
+
+//根据明细创建记录
+export function createRecordInfo(detail, balance) {
+ var record = {}
+ // let record = JSON.parse(JSON.stringify(detail));
+ //克隆对象,深度克隆,防止双向绑定同一个变量
+ Object.assign(record, detail)
+ detail.scaned = true;
+ detail.balance = balance;
+ detail.recommendInventoryStatus = detail.inventoryStatus;
+ detail.inventoryStatus = balance.inventoryStatus;
+ record.qty = Number(balance.qty);
+ return record;
+}
- //计算实际数量
- export function calcHandleQty(detailSource) {
- for (let item of detailSource) {
- item.handleQty = new Decimal(0).toNumber();
- item.qty = new Decimal(0).toNumber();
- for (let detail of item.subList) {
- if (detail != undefined && detail.scaned) {
- item.handleQty = calc.add(item.handleQty,detail.handleQty);
- item.qty = calc.add(item.qty,detail.qty);
- }
+//计算实际数量
+export function calcHandleQty(detailSource) {
+ for (let item of detailSource) {
+ item.handleQty = new Decimal(0).toNumber();
+ item.qty = new Decimal(0).toNumber();
+ for (let detail of item.subList) {
+ if (detail != undefined && detail.scaned) {
+ item.handleQty = calc.add(item.handleQty, detail.handleQty);
+ item.qty = calc.add(item.qty, detail.qty);
}
}
}
+}
- export function getScanCount(subList) {
- let items = subList.filter(r => {
- if (r.scaned) {
- return r;
- }
- })
- let scanCount = items != null ? items.length : 0;
- return scanCount;
- }
+export function getScanCount(subList) {
+ let items = subList.filter(r => {
+ if (r.scaned) {
+ return r;
+ }
+ })
+ let scanCount = items != null ? items.length : 0;
+ return scanCount;
+}
\ No newline at end of file
diff --git a/src/mycomponents/detail/detailList.vue b/src/mycomponents/detail/detailList.vue
new file mode 100644
index 00000000..b14fe545
--- /dev/null
+++ b/src/mycomponents/detail/detailList.vue
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
index 80ea9853..4a096893 100644
--- a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
+++ b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
@@ -1,24 +1,16 @@
-
+
-
+
-
-
-
-
-
-
-
-
+
-
+
@@ -34,7 +26,9 @@
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
-
+ import pack from '@/mycomponents/balance/pack.vue'
+ import detailList from '@/mycomponents/detail/detailList.vue'
+
import {
getDetailOption,
getPurchaseReceiptOption
@@ -47,7 +41,8 @@
recommendQtyEdit,
jobDetailPopup,
receiptDetailInfoPopup,
- winScanLocation
+ winScanLocation,
+ detailList
},
props: {
dataContent: {
@@ -62,8 +57,8 @@
type: Object,
default: {}
},
-
-
+
+
},
watch: {
@@ -77,7 +72,7 @@
}
},
- locatonItem:{},
+ locatonItem: {},
detailOptions: [],
scanOptions: []
}
@@ -88,17 +83,30 @@
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
- this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty,this.settingParam.allowModifyLocation)
+ this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
+ .allowModifyLocation)
}
+ this.resizeCollapse();
},
methods: {
+ resizeCollapse() {
+ this.$nextTick(r => {
+ this.$refs.collapse.forEach(r => {
+ r.childrens.forEach(i => {
+ i.init();
+ })
+ r.resize();
+ })
+ });
+ },
+
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
- } else if (e.content.text == "库位") {
+ } else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
@@ -106,15 +114,15 @@
},
edit(item) {
this.editItem = item;
- this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty,item.labelQty);
+ this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
showLocation(item) {
- this.locatonItem =item;
+ this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//扫描源库位
getLocation(location, code) {
- this.locatonItem.toLocationCode =code;
+ this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
@@ -142,4 +150,4 @@
+
\ No newline at end of file
diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue
index 052a0948..c83545cd 100644
--- a/src/pages/purchaseReceipt/job/receiptDetail.vue
+++ b/src/pages/purchaseReceipt/job/receiptDetail.vue
@@ -46,8 +46,9 @@
+
-
+
@@ -87,16 +88,17 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndCont from '@/mycomponents/scan/winScanPackAndCont.vue'
+ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue'
-
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPackAndCont,
+ winScanPack,
comReceiptDetailCard,
locationCompare,
jobTopAsn
@@ -201,7 +203,7 @@
that.subList[0].containerNumber = "CN-00000001";
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
- that.detailSource = getDataSource(that.subList)
+ that.detailSource = getDataSource( that.subList)
console.log(JSON.stringify(this.detailSource))
} else {
that.showMessage('列表数据为0');
@@ -217,6 +219,7 @@
getScanResult(result) {
try {
+
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
diff --git a/src/static/config.js b/src/static/config.js
index f0799c5f..ab11b5ae 100644
--- a/src/static/config.js
+++ b/src/static/config.js
@@ -1,7 +1,7 @@
let request_url = "http://192.168.0.211:12080/admin-api"
// let request_url = "http://dev.ccwin-in.com:25100/api/admin-api"
-let isDevelopment = true
+let isDevelopment = false
export default {
request_url,