zhangwencui
21 小时以前 0532c6b4949055189aa500f86835797f4be380ef
销售台账导入loading
已修改2个文件
65 ■■■■ 文件已修改
src/components/Dialog/FormDialog.vue 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Dialog/FormDialog.vue
@@ -1,24 +1,20 @@
<template>
  <el-dialog
    v-model="dialogVisible"
  <el-dialog v-model="dialogVisible"
    :title="computedTitle"
    :width="width"
    @close="handleClose"
  >
             @close="handleClose">
    <slot></slot>
    <template #footer>
      <div class="dialog-footer">
        <!-- 自定义按钮插槽 -->
        <slot name="footer">
          <!-- 默认按钮 -->
          <el-button
            v-if="showConfirm"
          <el-button v-if="showConfirm"
            type="primary"
            @click="handleConfirm"
          >
                     :loading="loading"
                     @click="handleConfirm">
            确认
          </el-button>
          <el-button @click="handleCancel">取消</el-button>
          <el-button :disabled="loading" @click="handleCancel">取消</el-button>
        </slot>
      </div>
    </template>
@@ -26,56 +22,60 @@
</template>
<script setup>
import { computed } from 'vue'
  import { computed } from "vue";
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false
      default: false,
  },
  title: {
    type: [String, Function],
    default: ''
      default: "",
  },
  operationType: {
    type: String,
    default: ''
      default: "",
  },
  width: {
    type: String,
    default: '70%'
  }
})
      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)
})
    set: val => emit("update:modelValue", val),
  });
// 详情模式不展示“确认”按钮,其它类型正常显示
const showConfirm = computed(() => props.operationType !== 'detail')
  const showConfirm = computed(() => props.operationType !== "detail");
const computedTitle = computed(() => {
  if (typeof props.title === 'function') {
    return props.title(props.operationType)
    if (typeof props.title === "function") {
      return props.title(props.operationType);
  }
  return props.title
})
    return props.title;
  });
const handleClose = () => {
  emit('close')
}
    emit("close");
  };
const handleConfirm = () => {
  emit('confirm')
}
    emit("confirm");
  };
const handleCancel = () => {
  emit('cancel')
  dialogVisible.value = false
}
    emit("cancel");
    dialogVisible.value = false;
  };
</script>
<style scoped>
src/views/salesManagement/salesLedger/index.vue
@@ -1529,6 +1529,7 @@
    <FormDialog v-model="importUpload.open"
                :title="importUpload.title"
                :width="'600px'"
                :loading="importUpload.isUploading"
                @close="onClose"
                @confirm="submitImportFile"
                @cancel="onClose">