From 9feea2f82cb21abf58643dcffd875b1ed6f1162b Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期二, 08 七月 2025 11:06:41 +0800
Subject: [PATCH] yys 1.新增入库查询 2.新增入库 3.入库分页查询 4.编辑
---
src/views/inventoryManagement/receiptManagement/index.vue | 47 +++++++++++++++++++++++++++++++++--------------
src/views/inventoryManagement/stockManagement/index.vue | 2 +-
src/api/inventoryManagement/stockIn.js | 2 +-
vite.config.js | 2 +-
4 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/src/api/inventoryManagement/stockIn.js b/src/api/inventoryManagement/stockIn.js
index b03b60b..53ee074 100644
--- a/src/api/inventoryManagement/stockIn.js
+++ b/src/api/inventoryManagement/stockIn.js
@@ -13,7 +13,7 @@
export const updateStockIn = (data) => {
return request({
url: "/stockin/update",
- method: "put",
+ method: "post",
data,
});
};
diff --git a/src/views/inventoryManagement/receiptManagement/index.vue b/src/views/inventoryManagement/receiptManagement/index.vue
index 734d9e7..c843b5a 100644
--- a/src/views/inventoryManagement/receiptManagement/index.vue
+++ b/src/views/inventoryManagement/receiptManagement/index.vue
@@ -19,18 +19,18 @@
:summary-method="summarizeMainTable" 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="inboundTime" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鎵规" prop="inboundBatch" width="160" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏃堕棿" prop="createDate" width="100" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鎵规" prop="inboundBatches" width="160" show-overflow-tooltip />
<el-table-column label="渚涘簲鍟嗗悕绉�" prop="supplierName" width="160" show-overflow-tooltip />
- <el-table-column label="浜у搧澶х被" prop="productName" width="100" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="model" width="160" show-overflow-tooltip />
+ <el-table-column label="浜у搧澶х被" prop="productCategory" width="100" show-overflow-tooltip />
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="160" show-overflow-tooltip />
<el-table-column label="鍗曚綅" prop="unit" width="70" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundQuantity" width="90" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="90" show-overflow-tooltip />
<el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
<el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
<el-table-column label="绋庣巼(%)" prop="taxRate" width="80" show-overflow-tooltip />
<el-table-column label="涓嶅惈绋庢�讳环" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip />
- <el-table-column label="鍏ュ簱浜�" prop="nickName" width="80" show-overflow-tooltip />
+ <el-table-column label="鍏ュ簱浜�" prop="createBy" width="80" show-overflow-tooltip />
<el-table-column fixed="right" label="鎿嶄綔" min-width="60" align="center">
<template #default="scope">
<el-button link type="primary" size="small" @click="openForm('edit', scope.row);">缂栬緫</el-button>
@@ -257,16 +257,21 @@
}
productList.value = [] // 娓呯┖浜у搧鍒楄〃
} else {
+
form.value = JSON.parse(JSON.stringify(row))
try {
loadingProducts.value = true
// 鏍规嵁鍚堝悓鍙峰姞杞藉搴旂殑浜у搧鍒楄〃锛堝亣璁� getProductByContract 鏄彲鐢ㄦ帴鍙o級
- const res = await getProductRecordByhetong(form.value.purchaseContractNumber)
+ const res = await selectProductRecordListByPuechaserId({
+ purchaseContractNumber: form.value.purchaseContractNumber,
+ id: row.id
+ });
productList.value = res.data.map(item => ({
...item,
quantityStock: item.quantityStock || 0 // 濡傛灉宸叉湁鍏ュ簱鏁伴噺鍒欎繚鐣�
}))
} catch (error) {
+ console.error('鍔犺浇浜у搧澶辫触:', error)
proxy.$modal.msgError('鍔犺浇浜у搧澶辫触')
productList.value = []
} finally {
@@ -275,18 +280,32 @@
}
}
+ const updatePro = async () => {
+ // 鍑嗗鎻愪氦鏁版嵁
+ // 鍑嗗鎻愪氦鏁版嵁 - 淇敼涓哄悗绔渶瑕佺殑鏍煎紡
+ const stockInData = {
+ id: selectedRows.value[0].recordId,
+ quantityStock: Number(selectedRows.value[0].quantityStock),// 浣跨敤鏂版牸寮忓寲鍑芥暟
+ };
+ await updateStockIn(stockInData)
+ proxy.$modal.msgSuccess('淇敼鍏ュ簱鎴愬姛')
+ closeDia()
+ getList() // 鍒锋柊鍒楄〃
+ }
// 鎻愪氦琛ㄥ崟
const submitForm = async () => {
+ // 楠岃瘉鑷冲皯閫夋嫨浜嗕竴涓骇鍝�
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgError('璇峰厛鏌ヨ骞堕�夋嫨浜у搧')
+ return
+ }
+ if(operationType.value !== 'add'){
+ await updatePro()
+ return
+ }
try {
await proxy.$refs.formRef.validate()
-
- // 楠岃瘉鑷冲皯閫夋嫨浜嗕竴涓骇鍝�
- if (selectedRows.value.length === 0) {
- proxy.$modal.msgError('璇峰厛鏌ヨ骞堕�夋嫨浜у搧')
- return
- }
-
// 楠岃瘉鍏ュ簱鏁伴噺
const invalidProducts = selectedRows.value.filter(
product => product.quantityStock <= 0 || product.quantityStock > product.quantity0
diff --git a/src/views/inventoryManagement/stockManagement/index.vue b/src/views/inventoryManagement/stockManagement/index.vue
index b5181d2..a9b2f88 100644
--- a/src/views/inventoryManagement/stockManagement/index.vue
+++ b/src/views/inventoryManagement/stockManagement/index.vue
@@ -25,7 +25,7 @@
<el-table-column label="浜у搧澶х被" prop="productName" width="100" show-overflow-tooltip />
<el-table-column label="瑙勬牸鍨嬪彿" prop="model" width="100" show-overflow-tooltip />
<el-table-column label="鍗曚綅" prop="unit" width="80" show-overflow-tooltip />
- <el-table-column label="鍑哄簱鏁伴噺" prop="stockQuantity" width="100" show-overflow-tooltip />
+ <el-table-column label="搴撳瓨鏁伴噺" prop="stockQuantity" width="100" show-overflow-tooltip />
<el-table-column label="鍚◣鍗曚环" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip />
<el-table-column label="鍚◣鎬讳环" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip />
<el-table-column label="绋庣巼(%)" prop="taxRate" width="100" show-overflow-tooltip />
diff --git a/vite.config.js b/vite.config.js
index 2f9c048..8d2eccb 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -8,7 +8,7 @@
const { VITE_APP_ENV } = env;
const baseUrl =
VITE_APP_ENV == "development"
- ? "http://127.0.0.1:7005" // 寮�鍙戠幆澧冨悗绔帴鍙�
+ ? "http://127.0.0.1:7003" // 寮�鍙戠幆澧冨悗绔帴鍙�
: "http://114.132.189.42:7003"; // 鐢熶骇鐜鍚庣鎺ュ彛
return {
--
Gitblit v1.9.3