浏览代码

修改bug

chenrui 4 月之前
父节点
当前提交
6127313360
共有 1 个文件被更改,包括 13 次插入30 次删除
  1. 13 30
      src/views/productManagement/productInfo/list.vue

+ 13 - 30
src/views/productManagement/productInfo/list.vue

@@ -366,21 +366,14 @@ export default {
     // 批量导入产品
     hanldeOk (obj) {
       this.spinning = true
-      if (obj && obj.type && obj.type == 'offline') { // 下线导入
-        importSaveBatch(obj).then(res => {
-          if (res.status == 200) {
-            this.resetSearchForm()
-          }
-          this.spinning = false
-        })
-      } else {
-        saveBatchImportProduct(obj).then(res => {
-          if (res.status == 200) {
-            this.resetSearchForm()
-          }
-          this.spinning = false
-        })
-      }
+      // importSaveBatch 下线导入
+      const ajaxName = obj && obj.type && obj.type == 'offline' ? importSaveBatch : saveBatchImportProduct
+      ajaxName(obj).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm()
+        }
+        this.spinning = false
+      })
     },
     // 审核
     handleAudit (row) {
@@ -395,10 +388,8 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
@@ -435,10 +426,8 @@ export default {
               _this.$refs.table.clearSelected() // 清空表格选中项
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
@@ -499,10 +488,8 @@ export default {
               _this.$refs.table.clearSelected() // 清空表格选中项
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
@@ -571,10 +558,8 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
@@ -597,10 +582,8 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })