From 07f9f8657d057a38792c3822acc9b08d83478967 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 07 五月 2026 14:23:10 +0800
Subject: [PATCH] 合并代码
---
src/views/inventoryManagement/dispatchLog/Record.vue | 94 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 87 insertions(+), 7 deletions(-)
diff --git a/src/views/inventoryManagement/dispatchLog/Record.vue b/src/views/inventoryManagement/dispatchLog/Record.vue
index 53bb3c3..6060cf5 100644
--- a/src/views/inventoryManagement/dispatchLog/Record.vue
+++ b/src/views/inventoryManagement/dispatchLog/Record.vue
@@ -1,6 +1,6 @@
<template>
- <div class="app-container">
- <div class="search_form">
+ <div>
+ <div class="search_form" style="margin-bottom: 10px;">
<div>
<span class="search_title ml10">鍑哄簱鏃ユ湡锛�</span>
<el-date-picker
@@ -27,6 +27,7 @@
>
</div>
<div>
+ <el-button type="primary" @click="handleBatchApprove">瀹℃壒</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
<el-button type="primary" plain @click="handlePrint">鎵撳嵃</el-button>
@@ -67,6 +68,11 @@
show-overflow-tooltip
/>
<el-table-column
+ label="鎵瑰彿"
+ prop="batchNo"
+ show-overflow-tooltip
+ />
+ <el-table-column
label="鍗曚綅"
prop="unit"
show-overflow-tooltip
@@ -88,6 +94,11 @@
{{ getRecordType(scope.row.recordType) }}
</template>
</el-table-column>
+ <el-table-column label="瀹℃壒鐘舵��" prop="approvalStatus" show-overflow-tooltip>
+ <template #default="scope">
+ {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+ </template>
+ </el-table-column>
</el-table>
<pagination
v-show="total > 0"
@@ -109,7 +120,8 @@
import { getCurrentDate } from "@/utils/index.js";
import {
getStockOutPage,
- delStockOut,
+ delPendingStockOut,
+ batchApproveStockOutRecords,
} from "@/api/inventoryManagement/stockOut.js";
import {
findAllQualifiedStockOutRecordTypeOptions, findAllUnQualifiedStockOutRecordTypeOptions,
@@ -133,6 +145,10 @@
type: String,
required: true,
default: '0'
+ },
+ topParentProductId: {
+ type: [String, Number],
+ default: undefined
}
})
@@ -163,7 +179,7 @@
};
const getList = () => {
tableLoading.value = true;
- getStockOutPage({ ...searchForm.value, ...page, type: props.type })
+ getStockOutPage({ ...searchForm.value, ...page, type: props.type, topParentProductId: props.topParentProductId })
.then((res) => {
tableLoading.value = false;
tableData.value = res.data.records;
@@ -180,6 +196,25 @@
const getRecordType = (recordType) => {
return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
}
+
+const approvalStatusLabelMap = {
+ 0: "寰呭鎵�",
+ 1: "閫氳繃",
+ 2: "椹冲洖",
+ pending: "寰呭鎵�",
+ approved: "閫氳繃",
+ rejected: "椹冲洖",
+ PENDING: "寰呭鎵�",
+ APPROVED: "閫氳繃",
+ REJECTED: "椹冲洖",
+};
+
+const getApprovalStatusLabel = (status) => {
+ if (status === null || status === undefined || status === "") {
+ return "寰呭鎵�";
+ }
+ return approvalStatusLabelMap[status] || "寰呭鎵�";
+};
// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
const fetchStockRecordTypeOptions = () => {
@@ -203,6 +238,44 @@
console.log("selection", selectedRows.value);
};
const expandedRowKeys = ref([]);
+
+const handleBatchApprove = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ const ids = selectedRows.value.map((item) => item.id);
+ ElMessageBox.confirm("璇烽�夋嫨瀹℃壒缁撴灉", "瀹℃壒", {
+ confirmButtonText: "閫氳繃",
+ cancelButtonText: "椹冲洖",
+ type: "warning",
+ distinguishCancelAndClose: true,
+ })
+ .then(() => {
+ batchApproveStockOutRecords({ ids, approvalStatus: 1 })
+ .then(() => {
+ proxy.$modal.msgSuccess("瀹℃壒閫氳繃鎴愬姛");
+ getList();
+ })
+ .catch(() => {
+ proxy.$modal.msgError("瀹℃壒閫氳繃澶辫触");
+ });
+ })
+ .catch((action) => {
+ if (action === "cancel") {
+ batchApproveStockOutRecords({ ids, approvalStatus: 2 })
+ .then(() => {
+ proxy.$modal.msgSuccess("瀹℃壒椹冲洖鎴愬姛");
+ getList();
+ })
+ .catch(() => {
+ proxy.$modal.msgError("瀹℃壒椹冲洖澶辫触");
+ });
+ return;
+ }
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
// 瀵煎嚭
const handleOut = () => {
@@ -234,7 +307,7 @@
type: "warning",
})
.then(() => {
- delStockOut(ids).then((res) => {
+ delPendingStockOut(ids).then((res) => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
});
@@ -405,7 +478,6 @@
<div class="print-page">
<div class="delivery-note">
<div class="header">
- <div class="company-name">鑻辨辰闃查攬鏂版潗鏂欐湁闄愬叕鍙�</div>
<div class="document-title">闆跺敭鍙戣揣鍗�</div>
</div>
@@ -417,7 +489,7 @@
</div>
<div>
<span class="label">瀹㈡埛鍚嶇О锛�</span>
- <span class="value">${item.supplierName || '寮犵埍鏈�'}</span>
+ <span class="value">${item.supplierName}</span>
</div>
</div>
<div class="info-row">
@@ -537,6 +609,14 @@
getList();
fetchStockRecordTypeOptions();
});
+
+watch(
+ () => props.topParentProductId,
+ () => {
+ page.current = 1;
+ getList();
+ }
+);
</script>
<style scoped lang="scss">
--
Gitblit v1.9.3