@dongkboy 5 месяцев назад
Родитель
Сommit
bf87438e74
1 измененных файлов с 26 добавлено и 5 удалено
  1. 26 5
      src/views/platform/index.vue

+ 26 - 5
src/views/platform/index.vue

@@ -135,8 +135,9 @@
           <el-table-column label="应收手续费" width="100">
             <template #default="scope">
               {{ scope.row.productId === '0330' || scope.row.productId === '0330034002' || scope.row.productId ===
-                '034002' ? scope.row.jqSuperviseCostsPremiums : scope.row.productId === '034001' || scope.row.productId ===
-                  '0330034001' ? scope.row.sySuperviseCostsPremiums: '' }}
+                '034002' ? scope.row.jqSuperviseCostsPremiums : scope.row.productId === '034001' || scope.row.productId
+                  ===
+                  '0330034001' ? scope.row.sySuperviseCostsPremiums : '' }}
             </template>
           </el-table-column>
           <el-table-column prop="productId" label="险种" width="100"></el-table-column>
@@ -276,7 +277,7 @@
             <el-button class="radius-2px width-100" type="primary" @click="addShow = true">添加应收</el-button>
           </div>
           <div class="col-108 m-r-8">
-            <el-button class="radius-2px width-100" type="primary" >批量结算</el-button>
+            <el-button class="radius-2px width-100" type="primary">批量结算</el-button>
           </div>
           <div class="col-108 m-r-8">
             <el-button class="radius-2px width-100" type="primary" @click="exportPlatformReceivable">导出</el-button>
@@ -467,6 +468,15 @@
             </div>
             <a style="color: #999; font-size: 12px">目前支持的文件类型为*.xls, *.xlsx</a>
           </el-upload>
+          <div v-if="importModifyCallback">
+            <div>
+              您将导入 <span style="color:#409eff;">{{ importModifyCallback?.failedNumber + importModifyCallback?.successNumber ||
+              0 }}
+            </span> 条数据,其中 <span style="color:#409eff;">{{ importModifyCallback?.successNumber || 0 }} </span> 条正常导入;<span
+              style="color: red;">{{ importModifyCallback?.failedNumber || 0 }}</span> 条不符合要求无法导入。
+            </div>
+            <el-button type="primary" link @click="downloadImportFailedData(importModifyCallback)">下载导入失败文件</el-button>
+          </div>
         </el-tab-pane>
       </el-tabs>
       <template #footer>
@@ -742,19 +752,30 @@ const handleBatchEdit = () => {
   // }
   batchEditShow.value = true
 }
+let importModifyCallback = ref()// 导入数据回调
 const uploadJYFile = async (file) => {
   let files = file.raw
   const params = new FormData(); // 声明formData数据类型
   params.append("file", files);
   const { code, data, msg } = await api.financeApi.importPlatformExcel(params)
   if (code == 200) {
+    importModifyCallback.value = data
     ElMessage({
       message: msg,
       type: 'success'
     })
   }
 }
-
+// 下载导入失败文件
+const downloadImportFailedData = (item) => {
+  const link = document.createElement('a');
+      link.href = item.failFileUrl;
+      link.download = '';
+      // 触发下载
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+}
 // 分页
 let pages = ref(1)
 let size = ref(10)
@@ -872,7 +893,7 @@ const getPlatformReceivableList = () => {
     }
   })
 }
-const  exportPlatformReceivable=()=>{
+const exportPlatformReceivable = () => {
   let params = {
     licenseNo: receivableForm.value?.licenseNo,
     companyId: receivableForm.value?.companyId,