From 19f2e3bdbe04e7ea79c6a0bdc8c7318d4837b189 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 28 五月 2026 17:36:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_pro_山西_晋和园
---
src/views/inventoryManagement/stockManagement/Record.vue | 640 +++++++++++++++++++++++++++------------------------------
1 files changed, 307 insertions(+), 333 deletions(-)
diff --git a/src/views/inventoryManagement/stockManagement/Record.vue b/src/views/inventoryManagement/stockManagement/Record.vue
index d898a37..8f58262 100644
--- a/src/views/inventoryManagement/stockManagement/Record.vue
+++ b/src/views/inventoryManagement/stockManagement/Record.vue
@@ -1,384 +1,358 @@
<template>
<div>
<div class="search_form mb10">
- <el-form
- ref="searchFormRef"
- :model="searchForm"
- class="demo-form-inline"
- >
+ <el-form ref="searchFormRef"
+ :model="searchForm"
+ class="demo-form-inline">
<el-row :gutter="20">
<el-col :span="4">
- <el-form-item label="浜у搧澶х被" prop="productName">
+ <el-form-item label="浜у搧澶х被"
+ prop="productName">
<el-input v-model="searchForm.productName"
style="width: 240px"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
-
<el-col :span="4">
- <el-form-item label="浜у搧瑙勬牸" prop="model">
+ <el-form-item label="瑙勬牸鍨嬪彿"
+ prop="model">
<el-input v-model="searchForm.model"
style="width: 240px"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
<el-col :span="4">
- <el-form-item label="鎵瑰彿" prop="batchNo">
+ <el-form-item label="鎵瑰彿"
+ prop="batchNo">
<el-input v-model="searchForm.batchNo"
style="width: 240px"
placeholder="璇疯緭鍏�"
- clearable/>
+ clearable />
</el-form-item>
</el-col>
<el-col :span="24" :sm="24" :md="12" :lg="12">
<el-form-item>
- <div style="display: flex; align-items: center; gap: 4px; width: 100%; flex-wrap: wrap;">
- <el-button type="primary" @click="getList">
- 鎼滅储
- </el-button>
-
- <el-button @click="resetSearch">
- 閲嶇疆
- </el-button>
- <div style="display: flex; gap: 4px; margin-left: auto;">
- <el-button type="primary" @click="isShowNewModal = true">
- 鏂板搴撳瓨
- </el-button>
- <el-button
- type="info"
- plain
- icon="Upload"
- @click="isShowImportModal = true"
- >
- 瀵煎叆搴撳瓨
- </el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </div>
- </div>
+ <el-button type="primary"
+ @click="getList">
+ 鎼滅储
+ </el-button>
+ <el-button @click="resetSearch">
+ 閲嶇疆
+ </el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
+ <div>
+ <el-button type="primary"
+ @click="isShowNewModal = true">鏂板搴撳瓨</el-button>
+ <el-button type="info"
+ plain
+ icon="Upload"
+ @click="isShowImportModal = true">
+ 瀵煎叆搴撳瓨
+ </el-button>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </div>
</div>
<div class="table_list">
- <el-table
- :data="tableData"
- border
- v-loading="tableLoading"
- @selection-change="handleSelectionChange"
- :expand-row-keys="expandedRowKeys"
- :row-key="(row, index) => index"
- style="width: 100%"
- :row-class-name="tableRowClassName"
- height="calc(100vh - 18.5em)"
- >
- <el-table-column align="center" type="selection" width="55" />
- <el-table-column align="center" label="搴忓彿" type="index" width="60" />
- <el-table-column
- label="浜у搧鍚嶇О"
- prop="productName"
- show-overflow-tooltip
- />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="model" show-overflow-tooltip />
- <el-table-column label="鍗曚綅" prop="unit" show-overflow-tooltip />
- <el-table-column label="鎵瑰彿" prop="batchNo" show-overflow-tooltip />
- <el-table-column
- label="鍚堟牸搴撳瓨鏁伴噺"
- prop="qualifiedQuantity"
- show-overflow-tooltip
- />
- <el-table-column
- label="涓嶅悎鏍煎簱瀛樻暟閲�"
- prop="unQualifiedQuantity"
- show-overflow-tooltip
- />
- <el-table-column
- label="鍚堟牸鍐荤粨鏁伴噺"
- prop="qualifiedLockedQuantity"
- show-overflow-tooltip
- />
- <el-table-column
- label="涓嶅悎鏍煎喕缁撴暟閲�"
- prop="unQualifiedLockedQuantity"
- show-overflow-tooltip
- />
- <el-table-column
- label="搴撳瓨棰勮鏁伴噺"
- prop="warnNum"
- show-overflow-tooltip
- />
- <el-table-column label="澶囨敞" prop="remark" show-overflow-tooltip />
- <el-table-column
- label="鏈�杩戞洿鏂版椂闂�"
- prop="updateTime"
- show-overflow-tooltip
- />
- <el-table-column
- fixed="right"
- label="鎿嶄綔"
- min-width="80"
- align="center"
- >
+ <el-table :data="tableData"
+ border
+ v-loading="tableLoading"
+ @selection-change="handleSelectionChange"
+ :expand-row-keys="expandedRowKeys"
+ :row-key="(row, index) => index"
+ style="width: 100%"
+ :row-class-name="tableRowClassName"
+ height="calc(100vh - 18.5em)">
+ <el-table-column align="center"
+ type="selection"
+ width="55" />
+ <el-table-column align="center"
+ label="搴忓彿"
+ type="index"
+ width="60" />
+ <el-table-column label="浜у搧鍚嶇О"
+ prop="productName"
+ show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿"
+ prop="model"
+ show-overflow-tooltip />
+ <el-table-column label="鍗曚綅"
+ prop="unit"
+ show-overflow-tooltip />
+ <el-table-column label="鎵瑰彿"
+ prop="batchNo"
+ show-overflow-tooltip />
+ <el-table-column label="鍚堟牸搴撳瓨鏁伴噺"
+ prop="qualifiedQuantity"
+ show-overflow-tooltip />
+ <el-table-column label="涓嶅悎鏍煎簱瀛樻暟閲�"
+ prop="unQualifiedQuantity"
+ show-overflow-tooltip />
+ <el-table-column label="鍚堟牸鍐荤粨鏁伴噺"
+ prop="qualifiedLockedQuantity"
+ show-overflow-tooltip />
+ <el-table-column label="涓嶅悎鏍煎喕缁撴暟閲�"
+ prop="unQualifiedLockedQuantity"
+ show-overflow-tooltip />
+ <el-table-column label="搴撳瓨棰勮鏁伴噺"
+ prop="warnNum"
+ show-overflow-tooltip />
+ <el-table-column label="澶囨敞"
+ prop="remark"
+ show-overflow-tooltip />
+ <el-table-column label="鏈�杩戞洿鏂版椂闂�"
+ prop="updateTime"
+ show-overflow-tooltip />
+ <el-table-column fixed="right"
+ label="鎿嶄綔"
+ min-width="80"
+ align="center">
<template #default="scope">
- <el-button
- link
- type="primary"
- @click="showDetailModal(scope.row)"
- >璇︽儏</el-button
- >
+ <el-button link
+ type="primary"
+ @click="showDetailModal(scope.row)">璇︽儏</el-button>
</template>
</el-table-column>
</el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- layout="total, sizes, prev, pager, next, jumper"
- :page="page.current"
- :limit="page.size"
- @pagination="paginationChange"
- />
+ <pagination v-show="total > 0"
+ :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current"
+ :limit="page.size"
+ @pagination="paginationChange" />
</div>
- <batch-no-qty-detail
- v-if="isShowDetailModal"
- v-model:visible="isShowDetailModal"
- :record="record"
- @subtract="handleDetailSubtract"
- @frozen="handleDetailFrozen"
- @thaw="handleDetailThaw"
- />
- <new-stock-inventory
- v-if="isShowNewModal"
- v-model:visible="isShowNewModal"
- :top-product-parent-id="props.productId"
- @completed="handleQuery"
- />
-
- <subtract-stock-inventory
- v-if="isShowSubtractModal"
- v-model:visible="isShowSubtractModal"
- :record="record"
- :type="record.stockType"
- @completed="handleQuery"
- />
+ <batch-no-qty-detail v-if="isShowDetailModal"
+ v-model:visible="isShowDetailModal"
+ :record="record"
+ @subtract="handleDetailSubtract"
+ @frozen="handleDetailFrozen"
+ @thaw="handleDetailThaw" />
+ <new-stock-inventory v-if="isShowNewModal"
+ v-model:visible="isShowNewModal"
+ :top-product-parent-id="props.productId"
+ @completed="handleQuery" />
+ <subtract-stock-inventory v-if="isShowSubtractModal"
+ v-model:visible="isShowSubtractModal"
+ :record="record"
+ :type="record.stockType"
+ @completed="handleQuery" />
<!-- 瀵煎叆搴撳瓨-->
- <import-stock-inventory
- v-if="isShowImportModal"
- v-model:visible="isShowImportModal"
- type="qualified"
- @uploadSuccess="handleQuery"
- />
+ <import-stock-inventory v-if="isShowImportModal"
+ v-model:visible="isShowImportModal"
+ type="qualified"
+ @uploadSuccess="handleQuery" />
<!-- 鍐荤粨/瑙e喕搴撳瓨-->
- <frozen-and-thaw-stock-inventory
- v-if="isShowFrozenAndThawModal"
- v-model:visible="isShowFrozenAndThawModal"
- :record="record"
- :operation-type="operationType"
- :type="record.stockType"
- @completed="handleQuery"
- />
+ <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
+ v-model:visible="isShowFrozenAndThawModal"
+ :record="record"
+ :operation-type="operationType"
+ :type="record.stockType"
+ @completed="handleQuery" />
</div>
</template>
<script setup>
-import pagination from "@/components/PIMTable/Pagination.vue";
-import { ref, reactive, toRefs, onMounted, getCurrentInstance } from "vue";
-import { ElMessage, ElMessageBox } from "element-plus";
-import { getStockInventoryListPageCombined } from "@/api/inventoryManagement/stockInventory.js";
-const props = defineProps({
- productId: {
- type: Number,
- required: true,
- default: 0,
- },
-});
+ import pagination from "@/components/PIMTable/Pagination.vue";
+ import { ref, reactive, toRefs, onMounted, getCurrentInstance } from "vue";
+ import { ElMessage, ElMessageBox } from "element-plus";
+ import { getStockInventoryListPageCombined } from "@/api/inventoryManagement/stockInventory.js";
+ const props = defineProps({
+ productId: {
+ type: Number,
+ required: true,
+ default: 0,
+ },
+ });
-const NewStockInventory = defineAsyncComponent(() =>
- import("@/views/inventoryManagement/stockManagement/New.vue")
-);
-const SubtractStockInventory = defineAsyncComponent(() =>
- import("@/views/inventoryManagement/stockManagement/Subtract.vue")
-);
-const ImportStockInventory = defineAsyncComponent(() =>
- import("@/views/inventoryManagement/stockManagement/Import.vue")
-);
-const FrozenAndThawStockInventory = defineAsyncComponent(() =>
- import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue")
-);
-const BatchNoQtyDetail = defineAsyncComponent(() =>
- import("@/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue")
-);
-const { proxy } = getCurrentInstance();
-const tableData = ref([]);
-const selectedRows = ref([]);
-const record = ref({});
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
-});
-const total = ref(0);
-// 鏄惁鏄剧ず鏂板寮规
-const isShowNewModal = ref(false);
-// 鏄惁鏄剧ず棰嗙敤寮规
-const isShowSubtractModal = ref(false);
-// 鏄惁鏄剧ず鍐荤粨/瑙e喕寮规
-const isShowFrozenAndThawModal = ref(false);
-// 鏄惁鏄剧ず璇︽儏寮规
-const isShowDetailModal = ref(false);
-// 鎿嶄綔绫诲瀷
-const operationType = ref("frozen");
-// 鏄惁鏄剧ず瀵煎叆寮规
-const isShowImportModal = ref(false);
-const data = reactive({
- searchForm: {
- productName: "",
- model: "",
- batchNo: "",
- topParentProductId: props.productId,
- },
-});
-const { searchForm } = toRefs(data);
-const searchFormRef = ref(null);
+ const NewStockInventory = defineAsyncComponent(() =>
+ import("@/views/inventoryManagement/stockManagement/New.vue")
+ );
+ const SubtractStockInventory = defineAsyncComponent(() =>
+ import("@/views/inventoryManagement/stockManagement/Subtract.vue")
+ );
+ const ImportStockInventory = defineAsyncComponent(() =>
+ import("@/views/inventoryManagement/stockManagement/Import.vue")
+ );
+ const FrozenAndThawStockInventory = defineAsyncComponent(() =>
+ import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue")
+ );
+ const BatchNoQtyDetail = defineAsyncComponent(() =>
+ import("@/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue")
+ );
+ const { proxy } = getCurrentInstance();
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const record = ref({});
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ });
+ const total = ref(0);
+ // 鏄惁鏄剧ず鏂板寮规
+ const isShowNewModal = ref(false);
+ // 鏄惁鏄剧ず棰嗙敤寮规
+ const isShowSubtractModal = ref(false);
+ // 鏄惁鏄剧ず鍐荤粨/瑙e喕寮规
+ const isShowFrozenAndThawModal = ref(false);
+ // 鏄惁鏄剧ず璇︽儏寮规
+ const isShowDetailModal = ref(false);
+ // 鎿嶄綔绫诲瀷
+ const operationType = ref("frozen");
+ // 鏄惁鏄剧ず瀵煎叆寮规
+ const isShowImportModal = ref(false);
+ const data = reactive({
+ searchForm: {
+ productName: "",
+ model: "",
+ batchNo: "",
+ topParentProductId: props.productId,
+ },
+ });
+ const { searchForm } = toRefs(data);
+ const searchFormRef = ref(null);
-const resetSearch = () => {
- searchFormRef.value?.resetFields();
- page.current = 1;
- getList();
-}
+ const resetSearch = () => {
+ searchFormRef.value?.resetFields();
+ page.current = 1;
+ getList();
+ };
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const paginationChange = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- getStockInventoryListPageCombined({ ...searchForm.value, ...page })
- .then((res) => {
- tableLoading.value = false;
- tableData.value = res.data.records;
- total.value = res.data.total;
- // 鏁版嵁鍔犺浇瀹屾垚鍚庢鏌ュ簱瀛�
- // checkStockAndCreatePurchase();
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const paginationChange = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ getStockInventoryListPageCombined({ ...searchForm.value, ...page })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ // 鏁版嵁鍔犺浇瀹屾垚鍚庢鏌ュ簱瀛�
+ // checkStockAndCreatePurchase();
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+ };
+
+ const handleFileSuccess = response => {
+ const { code, msg } = response;
+ if (code == 200) {
+ ElMessage({ message: "瀵煎叆鎴愬姛", type: "success" });
+ upload.open = false;
+ emits("uploadSuccess");
+ } else {
+ ElMessage({ message: msg, type: "error" });
+ }
+ };
+
+ // 鐐瑰嚮棰嗙敤
+ const showSubtractModal = row => {
+ record.value = row;
+ isShowSubtractModal.value = true;
+ };
+
+ // 鐐瑰嚮璇︽儏
+ const showDetailModal = row => {
+ if (!row?.productId || !row?.productModelId) {
+ proxy.$modal.msgError("褰撳墠鏁版嵁缂哄皯浜у搧ID鎴栬鏍煎瀷鍙稩D");
+ return;
+ }
+ record.value = row;
+ isShowDetailModal.value = true;
+ };
+
+ const handleDetailSubtract = row => {
+ isShowDetailModal.value = false;
+ showSubtractModal(row);
+ };
+
+ const handleDetailFrozen = row => {
+ isShowDetailModal.value = false;
+ showFrozenModal(row);
+ };
+
+ const handleDetailThaw = row => {
+ isShowDetailModal.value = false;
+ showThawModal(row);
+ };
+
+ // 鐐瑰嚮鍐荤粨
+ const showFrozenModal = row => {
+ record.value = row;
+ isShowFrozenAndThawModal.value = true;
+ operationType.value = "frozen";
+ };
+
+ // 鐐瑰嚮瑙e喕
+ const showThawModal = row => {
+ record.value = row;
+ isShowFrozenAndThawModal.value = true;
+ operationType.value = "thaw";
+ };
+
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ // 杩囨护鎺夊瓙鏁版嵁
+ selectedRows.value = selection.filter(item => item.id);
+ console.log("selection", selectedRows.value);
+ };
+ const expandedRowKeys = ref([]);
+
+ // 琛ㄦ牸琛岀被鍚�
+ const tableRowClassName = ({ row }) => {
+ const stock = Number(row?.qualifiedUnLockedQuantity ?? 0);
+ const warn = Number(row?.warnNum ?? 0);
+ if (!Number.isFinite(stock) || !Number.isFinite(warn)) {
+ return "";
+ }
+ return stock < warn ? "row-low-stock" : "";
+ };
+
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
})
- .catch(() => {
- tableLoading.value = false;
- });
-};
+ .then(() => {
+ proxy.download(
+ "/stockInventory/exportStockInventory",
+ { topParentProductId: props.productId },
+ "搴撳瓨淇℃伅.xlsx"
+ );
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
-const handleFileSuccess = (response) => {
- const { code, msg } = response;
- if (code == 200) {
- ElMessage({ message: "瀵煎叆鎴愬姛", type: "success" });
- upload.open = false;
- emits("uploadSuccess");
- } else {
- ElMessage({ message: msg, type: "error" });
- }
-};
-
-// 鐐瑰嚮棰嗙敤
-const showSubtractModal = (row) => {
- record.value = row;
- isShowSubtractModal.value = true;
-};
-
-// 鐐瑰嚮璇︽儏
-const showDetailModal = (row) => {
- if (!row?.productId || !row?.productModelId) {
- proxy.$modal.msgError("褰撳墠鏁版嵁缂哄皯浜у搧ID鎴栬鏍煎瀷鍙稩D");
- return;
- }
- record.value = row;
- isShowDetailModal.value = true;
-};
-
-const handleDetailSubtract = (row) => {
- isShowDetailModal.value = false;
- showSubtractModal(row);
-};
-
-const handleDetailFrozen = (row) => {
- isShowDetailModal.value = false;
- showFrozenModal(row);
-};
-
-const handleDetailThaw = (row) => {
- isShowDetailModal.value = false;
- showThawModal(row);
-};
-
-// 鐐瑰嚮鍐荤粨
-const showFrozenModal = (row) => {
- record.value = row;
- isShowFrozenAndThawModal.value = true;
- operationType.value = "frozen";
-};
-
-// 鐐瑰嚮瑙e喕
-const showThawModal = (row) => {
- record.value = row;
- isShowFrozenAndThawModal.value = true;
- operationType.value = "thaw";
-};
-
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- // 杩囨护鎺夊瓙鏁版嵁
- selectedRows.value = selection.filter((item) => item.id);
- console.log("selection", selectedRows.value);
-};
-const expandedRowKeys = ref([]);
-
-// 琛ㄦ牸琛岀被鍚�
-const tableRowClassName = ({ row }) => {
- const stock = Number(row?.qualifiedUnLockedQuantity ?? 0);
- const warn = Number(row?.warnNum ?? 0);
- if (!Number.isFinite(stock) || !Number.isFinite(warn)) {
- return "";
- }
- return stock < warn ? "row-low-stock" : "";
-};
-
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download(
- "/stockInventory/exportStockInventory",
- { topParentProductId: props.productId },
- "搴撳瓨淇℃伅.xlsx"
- );
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-
-onMounted(() => {
- getList();
-});
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped lang="scss">
-:deep(.row-low-stock td) {
- background-color: #fde2e2;
- color: #c45656;
-}
+ :deep(.row-low-stock td) {
+ background-color: #fde2e2;
+ color: #c45656;
+ }
-:deep(.row-low-stock:hover > td) {
- background-color: #fcd4d4;
-}
+ :deep(.row-low-stock:hover > td) {
+ background-color: #fcd4d4;
+ }
</style>
--
Gitblit v1.9.3