From 3712799f3e0904f28e4268deaa5c5ee291323c38 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 08 一月 2026 09:27:53 +0800
Subject: [PATCH] 军泰伟业 1.迁移仓库
---
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue | 165 ++++++++++++++++---------------------------------------
1 files changed, 48 insertions(+), 117 deletions(-)
diff --git a/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue b/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
index 016fef6..abaaeb8 100644
--- a/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
+++ b/src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -16,54 +16,43 @@
type="index"
width="60"
/>
- <el-table-column label="浜у搧鍥剧墖" align="center" prop="productCategory" width="100">
+ <el-table-column label="浜у搧澶х被" prop="productCategory" width="200">
<template #default="scope">
- <el-upload
- :action="uploadUrl"
- :before-upload="handleBeforeUpload"
- :on-success="(res,file)=>{handleUploadSuccess(res,file,scope.row)}"
- :on-error="handleUploadError"
- name="file"
- :show-file-list="false"
- :headers="headers"
- accept="image/*"
- :data="{ type: 9 }"
- >
- <img class="upload-img" v-if="scope.row.url" :src="javaApiUrl+scope.row.url"></img>
- <el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
- </el-upload>
+ <el-input v-model="scope.row.productCategory" placeholder="璇疯緭鍏ヤ骇鍝佸ぇ绫�" />
</template>
</el-table-column>
- <el-table-column label="浜у搧鍚嶇О" prop="productCategory" width="200">
+ <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="200">
<template #default="scope">
- <el-input v-model="scope.row.productCategory" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" />
+ <el-input v-model="scope.row.specificationModel" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" />
</template>
</el-table-column>
- <el-table-column label="浜у搧楂樺害" prop="specificationModel" width="200">
+ <el-table-column label="鍗曚綅" prop="unit" width="100">
<template #default="scope">
- <el-input v-model="scope.row.specificationModel" placeholder="璇疯緭鍏ヤ骇鍝侀珮搴�" />
+ <el-input v-model="scope.row.unit" placeholder="璇疯緭鍏ュ崟浣�" />
</template>
</el-table-column>
- <el-table-column label="绾哥瑙勬牸" prop="cartonSpecifications" width="200">
+ <el-table-column label="渚涘簲鍟�" prop="supplierName" width="200">
<template #default="scope">
- <el-input v-model="scope.row.cartonSpecifications" placeholder="璇疯緭鍏ョ焊绠辫鏍�" />
+ <el-input v-model="scope.row.supplierName" placeholder="璇疯緭鍏ヤ緵搴斿晢" />
</template>
</el-table-column>
- <el-table-column label="鍏ュ簱鏁伴噺-浠�" prop="inboundNum" width="150">
+ <el-table-column label="鐗╁搧绫诲瀷" prop="itemType" width="150">
<template #default="scope">
- <el-input-number :step="1" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
+ <el-select v-model="scope.row.itemType" filterable allow-create placeholder="璇烽�夋嫨鐗╁搧绫诲瀷" style="width: 100%">
+ <el-option
+ v-for="item in itemTypeOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
</template>
</el-table-column>
- <el-table-column label="姣忎欢鏁伴噺/鏀�" prop="boxNum" width="150">
+ <el-table-column label="鍏ュ簱鏁伴噺" prop="inboundNum" width="150">
<template #default="scope">
- <el-input-number :step="1" :min="0" style="width: 100%" v-model="scope.row.boxNum" @change="() => calculateTotalPrice(scope.row)" />
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
</template>
</el-table-column>
- <el-table-column label="鍗曚环(缇庡厓)/浠�" prop="taxInclusiveUnitPrice" width="150">
- <template #default="scope">
- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" />
- </template>
- </el-table-column>
<el-table-column label="鍏ュ簱鏃ユ湡" prop="inboundDate" width="180">
<template #default="scope">
<el-date-picker
@@ -76,18 +65,22 @@
/>
</template>
</el-table-column>
-<!-- <el-table-column label="鏁伴噺" prop="quantityStock" width="150">-->
-<!-- <template #default="scope">-->
-<!-- <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />-->
-<!-- </template>-->
-<!-- </el-table-column>-->
-
-<!-- <el-table-column -->
-<!-- label="鎬讳环(鍏�)" -->
-<!-- prop="taxInclusiveTotalPrice" -->
-<!-- width="150" -->
-<!-- >-->
-<!-- </el-table-column>-->
+ <el-table-column label="鏁伴噺" prop="quantityStock" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" width="150">
+ <template #default="scope">
+ <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎬讳环(鍏�)"
+ prop="taxInclusiveTotalPrice"
+ width="150"
+ >
+ </el-table-column>
<el-table-column label="鎿嶄綔" width="80" v-if="operationType === 'add'">
<template #default="scope">
<el-button type="danger" size="small" @click="removeProductRow(scope.$index)">鍒犻櫎</el-button>
@@ -111,18 +104,10 @@
addStockInCustom,
updateStockInCustom,
} from "@/api/inventoryManagement/stockIn.js";
-import { getToken } from "@/utils/auth";
-const headers = ref({
- Authorization: "Bearer " + getToken(),
-});
-
-const javaApiUrl = __BASE_API__;
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close', 'success'])
-
-const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
const operationType = ref('')// 鎿嶄綔绫诲瀷: 'add' 鎴� 'edit'
const dialogFormVisible = ref(false)// 寮规鏄剧ず鐘舵��
@@ -186,7 +171,7 @@
id: null,
productCategory: '',
specificationModel: '',
- cartonSpecifications:'',
+ unit: '',
supplierName: form.value.supplierName || '',
itemType: '',
inboundNum: 0,
@@ -196,7 +181,6 @@
taxInclusiveTotalPrice: 0,
taxRate: null,
taxExclusiveTotalPrice: 0,
- boxNum: 0,
});
};
@@ -233,42 +217,23 @@
// 楠岃瘉鑷畾涔夋坊鍔犵殑鏁版嵁蹇呭~瀛楁
for (let i = 0; i < productList.value.length; i++) {
const product = productList.value[i];
- if (!product.productCategory || !product.specificationModel) {
- proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹暟鎹湭濉啓瀹屾暣锛堜骇鍝併�佷骇鍝侀珮搴︺�侀珮搴﹀崟浣嶄负蹇呭~锛塦)
+ if (!product.productCategory || !product.specificationModel || !product.unit) {
+ proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹暟鎹湭濉啓瀹屾暣锛堜骇鍝佸ぇ绫汇�佽鏍煎瀷鍙枫�佸崟浣嶄负蹇呭~锛塦)
return
}
- if (!product.url) {
- proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹湭涓婁紶浜у搧鍥剧墖`)
- return
- }
- if (!product.cartonSpecifications) {
- proxy.$modal.msgError(`绗�${i + 1}琛屼骇鍝佹湭濉啓绾哥瑙勬牸`)
- return
- }
- // if (!product.itemType) {
- // proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鐗╁搧绫诲瀷`)
- // return
- // }
- const stock = Number(product?.inboundNum ?? 0);
- if (!Number.isFinite(stock) || stock <= 0) {
- proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆″叆搴撴暟閲忛渶澶т簬0`)
- return
- }
- const boxNum = Number(product?.boxNum ?? 0);
- if (!Number.isFinite(boxNum) || boxNum <= 0) {
- proxy.$modal.msgError(`绗�${i + 1}琛屾瘡浠舵暟閲�/鏀渶澶т簬0`)
- return
- }
- const taxInclusiveUnitPrice = Number(product?.taxInclusiveUnitPrice ?? 0);
- if (!Number.isFinite(taxInclusiveUnitPrice) || taxInclusiveUnitPrice <= 0) {
- proxy.$modal.msgError(`绗�${i + 1}琛屽崟浠凤紙鍏冿級闇�澶т簬0`)
+ if (!product.itemType) {
+ proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鐗╁搧绫诲瀷`)
return
}
if (!product.inboundDate) {
proxy.$modal.msgError(`绗�${i + 1}琛岃閫夋嫨鍏ュ簱鏃ユ湡`)
return
}
-
+ const stock = Number(product?.inboundNum ?? 0);
+ if (!Number.isFinite(stock) || stock <= 0) {
+ proxy.$modal.msgError(`绗�${i + 1}琛屾湰娆″叆搴撴暟閲忛渶澶т簬0`)
+ return
+ }
}
const payloadList = productList.value.map(product => ({
@@ -276,6 +241,7 @@
inboundNum: Number(product.inboundNum),
productCategory: product.productCategory,
specificationModel: product.specificationModel,
+ unit: product.unit,
supplierName: product.supplierName || form.value.supplierName,
itemType: product.itemType,
inboundDate: formatDateTime(product.inboundDate, false),
@@ -283,9 +249,6 @@
taxExclusiveTotalPrice: Number(product.taxExclusiveTotalPrice || 0),
taxInclusiveUnitPrice: Number(product.taxInclusiveUnitPrice || 0),
taxInclusiveTotalPrice: Number(product.taxInclusiveTotalPrice || 0),
- boxNum:Number(product.boxNum),
- cartonSpecifications: product.cartonSpecifications,
- url: product.url||'',
}));
loading.value = true
if (operationType.value === 'edit') {
@@ -314,30 +277,6 @@
dialogFormVisible.value = false
productList.value = []
emit('close')
-}
-
-// 涓婁紶鍓嶆牎妫�鏍煎紡鍜屽ぇ灏�
-function handleBeforeUpload(file) {
- const type = ["image/jpeg", "image/jpg", "image/png", "image/svg"];
- const isJPG = type.includes(file.type);
- //妫�楠屾枃浠舵牸寮�
- if (!isJPG) {
- proxy.$modal.msgError(`鍥剧墖鏍煎紡閿欒!`);
- return false;
- }
- return true;
-}
-const handleUploadSuccess = (res, file,item) => {
- // 濡傛灉涓婁紶鎴愬姛
- if (res.code == 200) {
- item.url = res.data?.tempPath||''
- } else {
- proxy.$modal.msgError("鍥剧墖鎻掑叆澶辫触");
- }
-}
-// 涓婁紶澶辫触澶勭悊
-function handleUploadError() {
- proxy.$modal.msgError("鍥剧墖鎻掑叆澶辫触");
}
const openDialog = async (type, row) => {
@@ -370,6 +309,7 @@
id: row?.id ?? null,
productCategory: row?.productCategory ?? '',
specificationModel: row?.specificationModel ?? '',
+ unit: row?.unit ?? '',
supplierName: row?.supplierName ?? '',
itemType: row?.itemType ?? '',
inboundNum: Number(row?.inboundNum ?? row?.inboundQuantity ?? 0),
@@ -379,9 +319,6 @@
taxInclusiveUnitPrice: Number(row?.taxInclusiveUnitPrice ?? 0),
taxInclusiveTotalPrice: Number(row?.taxInclusiveTotalPrice ?? 0),
taxExclusiveTotalPrice: Number(row?.taxExclusiveTotalPrice ?? 0),
- boxNum: Number(row?.boxNum ?? 0),
- cartonSpecifications: row?.cartonSpecifications ?? '',
- url: row?.url ?? '',
}]
}
}
@@ -391,11 +328,5 @@
})
</script>
-<style scoped lang="scss">
- .upload-img{
- width: 80px;
- height: 80px;
- object-fit: contain;
- }
-</style>
+<style scoped lang="scss"></style>
--
Gitblit v1.9.3