From 01a0dbc37d2df7557f6bab27a8f3f78970b8251e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 01 四月 2026 17:39:03 +0800
Subject: [PATCH] 军泰伟业 1.军泰伟业-库存管理增加库位 2.军泰伟业-生产入库要审核,加个入库审核菜单,入库数量,库位,通过不通过
---
src/views/productionManagement/productStructure/index.vue | 56 ++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/src/views/productionManagement/productStructure/index.vue b/src/views/productionManagement/productStructure/index.vue
index 5d4dbe1..fb9e7d8 100644
--- a/src/views/productionManagement/productStructure/index.vue
+++ b/src/views/productionManagement/productStructure/index.vue
@@ -1,11 +1,11 @@
<template>
<div class="app-container">
<div style="text-align: right; margin-bottom: 10px;">
+ <el-button type="primary" @click="handleAdd">鏂板</el-button>
<el-button type="info" plain icon="Upload" @click="handleImport"
v-hasPermi="['product:bom:import']">瀵煎叆</el-button>
<el-button type="warning" plain icon="Download" @click="handleExport" :disabled="selectedRows.length !== 1"
v-hasPermi="['product:bom:export']">瀵煎嚭</el-button>
- <el-button type="primary" @click="handleAdd">鏂板</el-button>
<el-button type="danger" plain @click="handleBatchDelete" :disabled="selectedRows.length === 0">鍒犻櫎</el-button>
</div>
<PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
@@ -45,7 +45,7 @@
<!-- BOM瀵煎叆瀵硅瘽妗� -->
<ImportDialog ref="uploadRef" v-model="upload.open" :title="upload.title" :action="upload.url"
:headers="upload.headers" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess" :show-download-template="true" @confirm="submitFileForm"
+ :on-success="handleFileSuccess" :on-error="handleFileError" :show-download-template="true" @confirm="submitFileForm"
@download-template="handleDownloadTemplate" @close="handleImportClose" />
</div>
</template>
@@ -77,16 +77,11 @@
minWidth: 160
},
- {
- label: "浜у搧鍥剧焊缂栧彿",
- prop: "drawingNumber",
- minWidth: 160
- },
- {
- label: "瑙勬牸鍨嬪彿",
- prop: "productModelName",
- minWidth: 140
- },
+ {
+ label: "鍥剧焊缂栧彿",
+ prop: "productModelName",
+ minWidth: 140
+ },
{
label: "鐗堟湰鍙�",
prop: "version",
@@ -339,7 +334,7 @@
};
// 鏂囦欢涓婁紶鎴愬姛澶勭悊
-const handleFileSuccess = (response, file, fileList) => {
+const handleFileSuccess = (response, file) => {
upload.open = false;
upload.isUploading = false;
proxy.$refs["uploadRef"].clearFiles();
@@ -347,13 +342,42 @@
proxy.$modal.msgSuccess(response.msg || "瀵煎叆鎴愬姛");
getList();
} else {
- proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true });
+ proxy.$modal.msgError(response.msg || "瀵煎叆澶辫触");
}
};
-// 鎻愪氦涓婁紶鏂囦欢
+// 鏂囦欢涓婁紶澶辫触澶勭悊 - 鍚庣杩斿洖閿欒鏂囦欢娴�
+const handleFileError = (error, file) => {
+ upload.open = false;
+ upload.isUploading = false;
+ proxy.$refs["uploadRef"].clearFiles();
+
+ // error 鍙兘鏄� Blob 瀵硅薄锛堝悗绔繑鍥炵殑閿欒鏂囦欢锛�
+ if (error instanceof Blob) {
+ // 涓嬭浇閿欒鏂囦欢
+ const blob = error;
+ const downloadElement = document.createElement('a');
+ const href = window.URL.createObjectURL(blob);
+ downloadElement.href = href;
+ downloadElement.download = "瀵煎叆閿欒鏁版嵁.xlsx";
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+ document.body.removeChild(downloadElement);
+ window.URL.revokeObjectURL(href);
+ proxy.$modal.msgError("瀵煎叆澶辫触锛岃鏌ョ湅涓嬭浇鐨勯敊璇枃浠�");
+ } else if (error && error.msg) {
+ // 鍚庣杩斿洖鐨勯敊璇俊鎭�
+ proxy.$modal.msgError(error.msg);
+ } else {
+ // 鏅�氶敊璇�
+ proxy.$modal.msgError("瀵煎叆澶辫触");
+ }
+};
+
+// 鎻愪氦涓婁紶鏂囦欢 - 鐜板湪鐢� ImportDialog 鍐呴儴澶勭悊
const submitFileForm = () => {
- proxy.$refs["uploadRef"].submit();
+ // ImportDialog 鐨� handleConfirm 浼氳皟鐢� uploadRef.value.submit()
+ // 杩欓噷涓嶉渶瑕侀澶栨搷浣�
};
// 瀵煎嚭鎸夐挳鎿嶄綔
--
Gitblit v1.9.3