From 9aae2af6f3937a7d99ec619b51f457002cef969f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 14:29:37 +0800
Subject: [PATCH] 档案管理-添加导出功能
---
src/views/basicData/supplierManage/index.vue | 65 +++++++++++++++++++++++++++++---
1 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/src/views/basicData/supplierManage/index.vue b/src/views/basicData/supplierManage/index.vue
index 5aaed78..e990bce 100644
--- a/src/views/basicData/supplierManage/index.vue
+++ b/src/views/basicData/supplierManage/index.vue
@@ -35,8 +35,7 @@
:isSelection="true"
@selection-change="handleSelectionChange"
:tableLoading="tableLoading"
- @pagination="pagination"
- :total="total"
+ @pagination="pagination"
></PIMTable>
</div>
<el-dialog
@@ -193,6 +192,7 @@
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
+ :on-error="handleFileError"
:auto-upload="false"
drag
>
@@ -222,7 +222,7 @@
</template>
<script setup>
-import { ref } from "vue";
+import { onMounted, ref } from "vue";
import { Search } from "@element-plus/icons-vue";
import { delSupplier } from "@/api/basicData/supplierManageFile.js";
import { ElMessageBox } from "element-plus";
@@ -245,6 +245,11 @@
width: 250,
},
{
+ label: "绾崇◣浜鸿瘑鍒彿",
+ prop: "taxpayerIdentificationNum",
+ width: 230,
+ },
+ {
label: "鍏徃鍦板潃",
prop: "companyAddress",
width: 220,
@@ -252,14 +257,17 @@
{
label: "鑱旂郴鏂瑰紡",
prop: "companyPhone",
+ width:150
},
{
label: "寮�鎴疯",
prop: "bankAccountName",
+ width: 220,
},
{
label: "璐﹀彿",
prop: "bankAccountNum",
+ width: 220,
},
{
label: "鑱旂郴浜�",
@@ -268,6 +276,7 @@
{
label: "鑱旂郴鐢佃瘽",
prop: "contactUserPhone",
+ width: 150,
},
{
label: "缁存姢浜�",
@@ -277,11 +286,13 @@
{
label: "缁存姢鏃堕棿",
prop: "maintainTime",
+ width:100
},
{
dataType: "action",
label: "鎿嶄綔",
align: "center",
+ fixed: 'right',
operation: [
{
name: "缂栬緫",
@@ -289,6 +300,9 @@
clickFun: (row) => {
openForm("edit", row);
},
+ disabled: (row) => {
+ return row.maintainUserName !== userStore.nickName
+ }
},
],
},
@@ -299,9 +313,9 @@
const tableLoading = ref(false);
const page = reactive({
current: 1,
- size: 10,
+ size: 100,
+ total: 0,
});
-const total = ref(0);
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
@@ -352,6 +366,7 @@
};
/** 鎻愪氦涓婁紶鏂囦欢 */
function submitFileForm() {
+ upload.isUploading = true;
proxy.$refs["uploadRef"].submit();
}
const getList = () => {
@@ -359,7 +374,7 @@
listSupplier({ ...searchForm.value, ...page }).then((res) => {
tableLoading.value = false;
tableData.value = res.data.records;
- total.value = res.data.total;
+ page.total = res.data.total;
});
};
const upload = reactive({
@@ -369,6 +384,8 @@
title: "",
// 鏄惁绂佺敤涓婁紶
isUploading: false,
+ // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+ updateSupport: 1,
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
@@ -379,6 +396,36 @@
upload.title = "渚涘簲鍟嗗鍏�";
upload.open = true;
}
+/** 涓嬭浇妯℃澘 */
+function importTemplate() {
+ proxy.download("/system/supplier/downloadTemplate", {}, "渚涘簲鍟嗗鍏ユā鏉�.xlsx");
+}
+
+/**鏂囦欢涓婁紶涓鐞� */
+const handleFileUploadProgress = (event, file, fileList) => {
+ upload.isUploading = true;
+};
+
+/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
+const handleFileSuccess = (response, file, fileList) => {
+ upload.isUploading = false;
+ if(response.code === 200){
+ proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+ upload.open = false;
+ proxy.$refs["uploadRef"].clearFiles();
+ getList();
+ }else if(response.code === 500){
+ proxy.$modal.msgError(response.msg);
+ }else{
+ proxy.$modal.msgWarning(response.msg);
+ }
+};
+
+/** 鏂囦欢涓婁紶澶辫触澶勭悊 */
+const handleFileError = (error, file, fileList) => {
+ upload.isUploading = false;
+ proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
@@ -450,6 +497,12 @@
const handleDelete = () => {
let ids = [];
if (selectedRows.value.length > 0) {
+ // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
+ const unauthorizedData = selectedRows.value.filter(item => item.maintainUserName !== userStore.nickName);
+ if (unauthorizedData.length > 0) {
+ proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+ return;
+ }
ids = selectedRows.value.map((item) => item.id);
} else {
proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
--
Gitblit v1.9.3