From 6b71c5ec1f97f36d5b179d7fff28485a42951ea1 Mon Sep 17 00:00:00 2001
From: zhangdi <15053473693@163.com>
Date: Fri, 9 Jan 2026 10:12:41 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=87=BA=E5=BA=93=E5=92=8C?=
=?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=87=BA=E5=BA=93=E9=97=AE=E9=A2=98=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/batchSelectionDialog.vue | 10 +--
src/views/firstOrder/components/inDialog.vue | 5 +-
src/views/firstOrder/components/outDialog.vue | 87 ++++++++++---------
src/views/firstOrder/outbound.vue | 18 ++--
4 files changed, 66 insertions(+), 54 deletions(-)
diff --git a/src/views/firstOrder/components/batchSelectionDialog.vue b/src/views/firstOrder/components/batchSelectionDialog.vue
index f04bb33..1ba1185 100644
--- a/src/views/firstOrder/components/batchSelectionDialog.vue
+++ b/src/views/firstOrder/components/batchSelectionDialog.vue
@@ -10,23 +10,19 @@
@selection-change="(val) => handleSelectionChange(val, props.row)" border>
-
-
-
-
@@ -96,6 +92,11 @@ export default {
// 监听嵌套表格的勾选事件
handleSelectionChange(selection, parentRow) {
console.log('666666', selection, parentRow)
+ if(selection.length>(parentRow.applicationQuantity-parentRow.outboundQuantity)){
+ this.$message.error('勾选数量不能大于申请数量')
+ return
+
+ }
// 为勾选的数据补充父行关联信息
const selectionWithParent = selection.map(item => ({
...item,
@@ -112,7 +113,6 @@ export default {
);
// 添加当前勾选的新数据
this.selectedRows.push(...selectionWithParent);
- console.log('777777', selection, parentRow, this.selectedRows)
// 实时传递给父组件(可选,也可以点击确认后传递)
},
diff --git a/src/views/firstOrder/components/inDialog.vue b/src/views/firstOrder/components/inDialog.vue
index ebf4013..9e5c3d9 100644
--- a/src/views/firstOrder/components/inDialog.vue
+++ b/src/views/firstOrder/components/inDialog.vue
@@ -652,9 +652,8 @@ export default {
this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.inTableData.find(
- (item) => item.materialCode === stat.materialCode
+ (item) => item.materialCode === stat.materialCode && item.type === stat.type
);
- console.log("detail", detail,stat);
return {
...stat,
theInboundQuantity: detail.theInboundQuantity, //本次入库数量
@@ -670,7 +669,7 @@ export default {
this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.singleData.find(
- (item) => item.materialId === stat.materialId
+ (item) => item.materialId === stat.materialId&& item.type === stat.type
);
return {
...stat,
diff --git a/src/views/firstOrder/components/outDialog.vue b/src/views/firstOrder/components/outDialog.vue
index fa85953..c851f94 100644
--- a/src/views/firstOrder/components/outDialog.vue
+++ b/src/views/firstOrder/components/outDialog.vue
@@ -148,7 +148,7 @@
}}
-
+
-
-
-
-
+ -->
+
-
+
{{ scope.row.theOutboundQuantity || 0 }}
-
+
{{ scope.row.totalQuantity || 0 }}
@@ -563,8 +554,8 @@ export default {
if (
columnIndex === 0 ||
columnIndex === 1 ||
- columnIndex === 6 ||
- columnIndex === 7
+ columnIndex === 5 ||
+ columnIndex === 6
) {
const key = `${row.materialCode}-${row.materialName}`;
const rows = this.sizeForm.inTableData.filter(
@@ -594,25 +585,41 @@ export default {
},
getStatistics() {
getStatistics(this.sizeForm.inTableData).then((res) => {
- this.statisticsList = res.data.result
+ this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.inTableData.find(
(item) => item.materialCode === stat.materialCode
- )
- console.log("detail", detail, stat)
+ );
+ console.log("detail", detail, stat);
+ //
+ if (
+ this.sizeForm.options == 1 &&
+ this.inBatchForm.optionType == "NY"
+ ) {
+ const detailList = this.sizeForm.inTableData.filter(
+ (item) =>
+ item.materialCode === stat.materialCode &&
+ item.materialName === stat.materialName
+ );
+ console.log("detailList", detailList);
+ detail.theOutboundQuantity = detailList.reduce((acc, cur) => acc + cur.num, 0);
+ }
+
return {
...stat,
theOutboundQuantity: detail.theOutboundQuantity, //本次出库数量
unitPrice: detail.unitPrice,
totalQuantity: stat.num - detail.theOutboundQuantity,
department: detail.department, // 部门ID
- departmentName: detail.departmentName || this.getDepartmentName(detail.department),
- }
- })
- })
+ departmentName:
+ detail.departmentName ||
+ this.getDepartmentName(detail.department),
+ };
+ });
+ });
},
- changeDepartment(){
- this.getStatistics()
+ changeDepartment() {
+ this.getStatistics();
},
batchclose() {
this.batchSelectionVisible = false;
@@ -684,18 +691,18 @@ export default {
if (row.theOutboundQuantity > maxAllowQuantity) {
this.$message.error(`本次出库数量不能大于${maxAllowQuantity}`);
row.theOutboundQuantity = maxAllowQuantity;
- return false
+ return false;
}
}
if (this.sizeForm.optionType === "NY") {
row.theOutboundQuantity = 1;
}
- this.getStatistics()
+ this.getStatistics();
},
//关闭新增弹窗
handleCloseDetail() {
this.outDialogVisible = false;
-
+
this.$emit("handleCloseDetail");
},
closeDialog() {
@@ -769,7 +776,6 @@ export default {
let res;
if (this.inBatchForm.optionType === "YH") {
res = await getDetailedList(requestParams);
-
} else if (this.inBatchForm.optionType === "NY") {
res = await batchList(requestParams);
}
@@ -804,8 +810,8 @@ export default {
this.dialogVisible = true;
console.log(1);
this.batchTableData = res.data.result;
- }else {
- this.getStatistics()
+ } else {
+ this.getStatistics();
}
// 强制更新视图
@@ -839,8 +845,8 @@ export default {
getDepartmentName(departmentId) {
const department = this.list.find(
(item) => item.departmentId === departmentId
- )
- return department ? department.department : ""
+ );
+ return department ? department.department : "";
},
//获取单条选择的物资名称列表
async getMaterialList() {
@@ -872,7 +878,7 @@ export default {
this.sizeForm.inTableData[index].materialName = row.materialName;
this.sizeForm.inTableData[index].type = row.type;
this.sizeForm.inTableData[index].unit = row.unit;
- this.getStatistics()
+ this.getStatistics();
},
// 提交
async submit(index) {
@@ -928,7 +934,10 @@ export default {
}
);
console.log(this.sizeForm, "111");
- this.sizeForm.inTableData = [];
+ // this.sizeForm.inTableData = [];
+ if (this.sizeForm.options === 1) {
+ this.sizeForm.optionType = this.inBatchForm.optionType;
+ }
try {
const res = await submitData(this.sizeForm);
console.log(this.sizeForm, "222");
@@ -1000,13 +1009,13 @@ export default {
// 选项选择
radioChange() {
this.sizeForm.inTableData = [];
- this.statisticsList = []
+ this.statisticsList = [];
this.sizeForm.optionType = "";
this.inBatchDialogVisible = false;
this.consumableVisible = false;
this.inBatchDialogVisible = false;
this.batchSelectionVisible = false;
- this.sizeForm.optionType = '';
+ this.sizeForm.optionType = "";
this.batchTableData = [];
if (this.sizeForm.options === 1) {
this.getQuarterList();
diff --git a/src/views/firstOrder/outbound.vue b/src/views/firstOrder/outbound.vue
index 5d1952f..d58078c 100644
--- a/src/views/firstOrder/outbound.vue
+++ b/src/views/firstOrder/outbound.vue
@@ -18,6 +18,10 @@
>
无
+
+ 发放单
+ 出库单
+
详情
编辑
@@ -104,13 +108,13 @@ export default {
headerAlign: "center",
align: "center",
},
- // {
- // label: "出库类型",
- // prop: "outType",
- // width: 140,
- // headerAlign: "center",
- // align: "center",
- // },
+ {
+ label: "出库类型",
+ prop: "outTypeInfo",
+ width: 140,
+ headerAlign: "center",
+ align: "center",
+ },
{
label: "出库日期",
prop: "outDate",