Browse Source

代码暂存

zhangqi 1 year ago
parent
commit
a89c66c236
2 changed files with 11 additions and 9 deletions
  1. 10 8
      src/DRP/HDrpManagement/programme/index.vue
  2. 1 1
      src/components/tableImport/index.vue

+ 10 - 8
src/DRP/HDrpManagement/programme/index.vue

@@ -70,7 +70,7 @@
             </a-space>
           </template>
           <template #more>
-            <a-tooltip v-if="prodTable.data.length > 0">
+            <a-tooltip v-if="prodTable && prodTable.data.length > 0">
               <template #title>已存在不参与返利的商品,请先删除后再进行导入!</template>
               <UploadOutlined style="color:grey"></UploadOutlined>
             </a-tooltip>
@@ -317,13 +317,15 @@ const importSuccess = async (res)=>{
       attachmentid:res.data.attachmentids[0]
     }
   })
-  utils.message(rs,'导入成功',()=>{
-    prodlist.value.listData()
-    mianData()
-    if (rs.data !== '成功') {
-      failedData.value = rs.data
-    }
-  })
+  if (rs.code == 0) {
+    failedData.value = rs.msg
+  } else {
+    utils.message(rs,'导入成功',()=>{
+      prodTable.value.listData()
+      failedData.value = null
+      mianData()
+    })
+  }
 }
 onMounted(()=>{
   accountList()

+ 1 - 1
src/components/tableImport/index.vue

@@ -169,7 +169,7 @@ const getExcelMode = async () => {
   excelMode.value = res.data
 }
 watch(() => props.failedData, value => {
-  message.error({content:'部分数据未导入成功,请下载导入失败的数据查看!',key:1})
+  value ? message.error({content:'部分数据未导入成功,请下载导入失败的数据查看!',key:1}) :""
 })
 onMounted(() => {
 })