From 0532c6b4949055189aa500f86835797f4be380ef Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 17 四月 2026 17:38:54 +0800
Subject: [PATCH] 销售台账导入loading
---
src/views/salesManagement/salesLedger/index.vue | 3 +
src/components/Dialog/FormDialog.vue | 116 +++++++++++++++++++++++++++++-----------------------------
2 files changed, 60 insertions(+), 59 deletions(-)
diff --git a/src/components/Dialog/FormDialog.vue b/src/components/Dialog/FormDialog.vue
index 8b657de..3c6a40d 100644
--- a/src/components/Dialog/FormDialog.vue
+++ b/src/components/Dialog/FormDialog.vue
@@ -1,24 +1,20 @@
<template>
- <el-dialog
- v-model="dialogVisible"
- :title="computedTitle"
- :width="width"
- @close="handleClose"
- >
+ <el-dialog v-model="dialogVisible"
+ :title="computedTitle"
+ :width="width"
+ @close="handleClose">
<slot></slot>
<template #footer>
<div class="dialog-footer">
<!-- 鑷畾涔夋寜閽彃妲� -->
<slot name="footer">
- <!-- 榛樿鎸夐挳 -->
- <el-button
- v-if="showConfirm"
- type="primary"
- @click="handleConfirm"
- >
+ <el-button v-if="showConfirm"
+ type="primary"
+ :loading="loading"
+ @click="handleConfirm">
纭
</el-button>
- <el-button @click="handleCancel">鍙栨秷</el-button>
+ <el-button :disabled="loading" @click="handleCancel">鍙栨秷</el-button>
</slot>
</div>
</template>
@@ -26,61 +22,65 @@
</template>
<script setup>
-import { computed } from 'vue'
+ import { computed } from "vue";
-const props = defineProps({
- modelValue: {
- type: Boolean,
- default: false
- },
- title: {
- type: [String, Function],
- default: ''
- },
- operationType: {
- type: String,
- default: ''
- },
- width: {
- type: String,
- default: '70%'
- }
-})
+ const props = defineProps({
+ modelValue: {
+ type: Boolean,
+ default: false,
+ },
+ title: {
+ type: [String, Function],
+ default: "",
+ },
+ operationType: {
+ type: String,
+ default: "",
+ },
+ width: {
+ type: String,
+ default: "70%",
+ },
+ loading: {
+ type: Boolean,
+ default: false,
+ },
+ });
-const emit = defineEmits(['update:modelValue', 'close', 'confirm', 'cancel'])
+ const emit = defineEmits(["update:modelValue", "close", "confirm", "cancel"]);
-const dialogVisible = computed({
- get: () => props.modelValue,
- set: (val) => emit('update:modelValue', val)
-})
+ const dialogVisible = computed({
+ get: () => props.modelValue,
+ set: val => emit("update:modelValue", val),
+ });
-// 璇︽儏妯″紡涓嶅睍绀衡�滅‘璁も�濇寜閽紝鍏跺畠绫诲瀷姝e父鏄剧ず
-const showConfirm = computed(() => props.operationType !== 'detail')
+ // 璇︽儏妯″紡涓嶅睍绀衡�滅‘璁も�濇寜閽紝鍏跺畠绫诲瀷姝e父鏄剧ず
+ const showConfirm = computed(() => props.operationType !== "detail");
-const computedTitle = computed(() => {
- if (typeof props.title === 'function') {
- return props.title(props.operationType)
- }
- return props.title
-})
+ const computedTitle = computed(() => {
+ if (typeof props.title === "function") {
+ return props.title(props.operationType);
+ }
+ return props.title;
+ });
-const handleClose = () => {
- emit('close')
-}
+ const handleClose = () => {
+ emit("close");
+ };
-const handleConfirm = () => {
- emit('confirm')
-}
+ const handleConfirm = () => {
+ emit("confirm");
+ };
-const handleCancel = () => {
- emit('cancel')
- dialogVisible.value = false
-}
+ const handleCancel = () => {
+ emit("cancel");
+ dialogVisible.value = false;
+ };
</script>
<style scoped>
-.dialog-footer {
- text-align: center;
-}
+ .dialog-footer {
+ text-align: center;
+ }
</style>
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 4e214f7..594bb22 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -461,7 +461,7 @@
:key="item.id"
:label="item.customerName"
:value="item.id">
-{{ item.customerName + (item.taxpayerIdentificationNumber ? "鈥斺��" + item.taxpayerIdentificationNumber : "") }}
+ {{ item.customerName + (item.taxpayerIdentificationNumber ? "鈥斺��" + item.taxpayerIdentificationNumber : "") }}
</el-option>
</el-select>
</el-form-item>
@@ -1529,6 +1529,7 @@
<FormDialog v-model="importUpload.open"
:title="importUpload.title"
:width="'600px'"
+ :loading="importUpload.isUploading"
@close="onClose"
@confirm="submitImportFile"
@cancel="onClose">
--
Gitblit v1.9.3