From c7aebff7f6184b2d8da2669d2db5656e2bc09ec4 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 21 四月 2026 15:49:45 +0800
Subject: [PATCH] 湟水峡 1.反馈登记删减字段 2.售后服务字段匹配错误问题
---
src/views/productionManagement/productStructure/index.vue | 91 +++++++++++++++++++++++++++------------------
1 files changed, 55 insertions(+), 36 deletions(-)
diff --git a/src/views/productionManagement/productStructure/index.vue b/src/views/productionManagement/productStructure/index.vue
index ce88565..bc5a538 100644
--- a/src/views/productionManagement/productStructure/index.vue
+++ b/src/views/productionManagement/productStructure/index.vue
@@ -1,19 +1,22 @@
<template>
<div class="app-container">
- <div style="text-align: right; margin-bottom: 10px;">
- <el-button type="info" plain icon="Upload" @click="handleImport">瀵煎叆</el-button>
- <el-button type="warning" plain icon="Download" @click="handleExport"
- :disabled="selectedRows.length !== 1">瀵煎嚭</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"
- @selection-change="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination">
- <template #detail="{ row }">
- <el-button type="primary" text @click="showDetail(row)">{{ row.bomNo }}
- </el-button>
- </template>
- </PIMTable>
+ <div class="table_list">
+ <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="danger" plain @click="handleBatchDelete" :disabled="selectedRows.length === 0">鍒犻櫎</el-button>
+ </div>
+ <PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
+ @selection-change="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination">
+ <template #detail="{ row }">
+ <el-button type="primary" text @click="showDetail(row)">{{ row.bomNo }}
+ </el-button>
+ </template>
+ </PIMTable>
+ </div>
<StructureEdit v-if="showEdit" v-model:show-model="showEdit" :record="currentRow" />
<!-- 鏂板/缂栬緫寮圭獥 -->
@@ -33,8 +36,8 @@
</el-form-item>
</el-form>
<template #footer>
- <el-button @click="closeDialog">鍙栨秷</el-button>
<el-button type="primary" @click="handleSubmit">纭畾</el-button>
+ <el-button @click="closeDialog">鍙栨秷</el-button>
</template>
</el-dialog>
@@ -42,35 +45,21 @@
<ProductSelectDialog v-model="showProductSelectDialog" @confirm="handleProductSelect" single />
<!-- BOM瀵煎叆瀵硅瘽妗� -->
- <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
- <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
- :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
- :auto-upload="false" drag>
- <el-icon class="el-icon--upload"><upload-filled /></el-icon>
- <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
- <template #tip>
- <div class="el-upload__tip text-center">
- <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
- </div>
- </template>
- </el-upload>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
- <el-button @click="upload.open = false">鍙� 娑�</el-button>
- </div>
- </template>
- </el-dialog>
+ <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"
+ @download-template="handleDownloadTemplate" @close="handleImportClose" />
</div>
</template>
<script setup>
import { ref, reactive, toRefs, onMounted, getCurrentInstance, defineAsyncComponent } from "vue";
import { getToken } from "@/utils/auth";
-import { listPage, add, update, batchDelete, exportBom } from "@/api/productionManagement/productBom.js";
+import { listPage, add, update, batchDelete, exportBom, downloadTemplate } from "@/api/productionManagement/productBom.js";
import { useRouter } from 'vue-router'
import { ElMessageBox } from 'element-plus'
import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
+import ImportDialog from "@/components/Dialog/ImportDialog.vue";
const router = useRouter()
const { proxy } = getCurrentInstance()
@@ -336,6 +325,11 @@
upload.open = true;
};
+// 鍏抽棴瀵煎叆瀵硅瘽妗嗘椂娓呴櫎鏂囦欢
+const handleImportClose = () => {
+ proxy.$refs["uploadRef"].clearFiles();
+};
+
// 鏂囦欢涓婁紶涓鐞�
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true;
@@ -345,7 +339,7 @@
const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
- proxy.$refs["uploadRef"].handleRemove(file);
+ proxy.$refs["uploadRef"].clearFiles();
if (response.code === 200) {
proxy.$modal.msgSuccess(response.msg || "瀵煎叆鎴愬姛");
getList();
@@ -397,6 +391,31 @@
});
};
+// 涓嬭浇妯℃澘
+const handleDownloadTemplate = async () => {
+ const res = await downloadTemplate();
+ // 杩斿洖鐨勬暟鎹槸鍚︿负绌�
+ if (!res) {
+ proxy.$modal.msgError("涓嬭浇澶辫触锛岃繑鍥炴暟鎹负绌�");
+ return;
+ }
+
+ const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
+ const downloadElement = document.createElement('a');
+ const href = window.URL.createObjectURL(blob);
+
+ downloadElement.href = href;
+ downloadElement.download = "BOM妯℃澘.xlsx";
+
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+
+ document.body.removeChild(downloadElement);
+ window.URL.revokeObjectURL(href);
+
+ proxy.$modal.msgSuccess("涓嬭浇鎴愬姛");
+};
+
// 鏌ョ湅璇︽儏
const showDetail = (row) => {
router.push({
--
Gitblit v1.9.3