gaoluyang
8 天以前 a78e352b672fd6b634c24e0d9cf184f56b846f6a
src/views/basicData/customerFile/index.vue
@@ -209,13 +209,13 @@
        <template #tip>
          <div class="el-upload__tip text-center">
            <span>仅允许导入xls、xlsx格式文件。</span>
<!--            <el-link-->
<!--              type="primary"-->
<!--              :underline="false"-->
<!--              style="font-size: 12px; vertical-align: baseline"-->
<!--              @click="importTemplate"-->
<!--              >下载模板</el-link-->
<!--            >-->
            <el-link
              type="primary"
              :underline="false"
              style="font-size: 12px; vertical-align: baseline"
              @click="importTemplate"
              >下载模板</el-link
            >
          </div>
        </template>
      </el-upload>
@@ -399,8 +399,12 @@
  // 文件上传成功时的回调
  onSuccess: (response, file, fileList) => {
    console.log('上传成功', 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{
@@ -410,6 +414,7 @@
  // 文件上传失败时的回调
  onError: (error, file, fileList) => {
    console.error('上传失败', error, file, fileList);
    upload.isUploading = false;
    proxy.$modal.msgError("文件上传失败");
  },
  // 文件上传进度回调
@@ -455,6 +460,7 @@
};
/** 提交上传文件 */
function submitFileForm() {
  upload.isUploading = true;
  proxy.$refs["uploadRef"].submit();
}
/** 导入按钮操作 */
@@ -462,6 +468,10 @@
  upload.title = "客户导入";
  upload.open = true;
}
/** 下载模板 */
function importTemplate() {
  proxy.download("/basic/customer/downloadTemplate", {}, "客户导入模板.xlsx");
}
// 打开弹框
const openForm = (type, row) => {
  operationType.value = type;