gaoluyang
8 天以前 60af97808e44b3a483145199f79a0828469db122
src/views/basicData/supplierManage/index.vue
@@ -192,6 +192,7 @@
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :on-error="handleFileError"
        :auto-upload="false"
        drag
      >
@@ -200,13 +201,13 @@
        <template #tip>
          <div class="el-upload__tip text-center">
            <span>仅允许导入xls、xlsx格式文件。</span>
            <!-- <el-link
            <el-link
              type="primary"
              :underline="false"
              style="font-size: 12px; vertical-align: baseline"
              @click="importTemplate"
              >下载模板</el-link
            > -->
            >
          </div>
        </template>
      </el-upload>
@@ -365,7 +366,7 @@
};
/** 提交上传文件 */
function submitFileForm() {
  console.log(upload.url + '?updateSupport=' + upload.updateSupport)
  upload.isUploading = true;
  proxy.$refs["uploadRef"].submit();
}
const getList = () => {
@@ -395,6 +396,10 @@
  upload.title = "供应商导入";
  upload.open = true;
}
/** 下载模板 */
function importTemplate() {
  proxy.download("/system/supplier/downloadTemplate", {}, "供应商导入模板.xlsx");
}
/**文件上传中处理 */
const handleFileUploadProgress = (event, file, fileList) => {
@@ -403,10 +408,23 @@
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
  upload.open = false;
  upload.isUploading = false;
  proxy.$refs["uploadRef"].handleRemove(file);
  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) => {