Browse Source

bug 修复

lilei 3 years ago
parent
commit
4e40e4acd5

+ 9 - 5
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -365,10 +365,12 @@ export default {
       })
     },
     // 获取单据详细
-    getOrderDetail () {
+    getOrderDetail (flag) {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
-        this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
+        if (!flag) {
+          this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
+        }
       })
     },
     // 打折
@@ -383,7 +385,7 @@ export default {
         id: this.ordeDetail.id
       }).then(res => {
         if (res.status == 200) {
-          this.resetSearchForm()
+          this.getOrderDetail(true)
           this.spinning = false
         } else {
           this.spinning = false
@@ -437,7 +439,9 @@ export default {
     //  重置
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
-      // this.getOrderDetail()
+      if (flag) {
+        this.getOrderDetail()
+      }
     },
     // 添加或修改产品
     saveProduct (row, type) {
@@ -474,7 +478,7 @@ export default {
       }
       this.spinning = true
       salesReturnSaveProduct(params).then(res => {
-        this.resetSearchForm(type != 'edit')
+        this.resetSearchForm(type == 'edit')
         this.isInster = false
         this.spinning = false
       })

+ 11 - 7
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -351,10 +351,12 @@ export default {
       })
     },
     // 获取单据详细
-    getOrderDetail () {
+    getOrderDetail (flag) {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
-        this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
+        if (!flag) {
+          this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
+        }
       })
     },
     // 打折
@@ -369,7 +371,7 @@ export default {
         id: this.ordeDetail.id
       }).then(res => {
         if (res.status == 200) {
-          this.resetSearchForm()
+          this.getOrderDetail(true)
           this.spinning = false
         } else {
           this.spinning = false
@@ -389,7 +391,7 @@ export default {
           _this.spinning = true
           salesReturnDelAll({ sn: _this.ordeDetail.salesReturnSn }).then(res => {
             if (res.status == 200) {
-              _this.resetSearchForm()
+              _this.resetSearchForm(true)
               _this.$refs.queryPart.resetSearchForm()
             }
             _this.$message.info(res.message)
@@ -423,8 +425,10 @@ export default {
     },
     //  重置
     resetSearchForm (flag) {
-      this.$refs.table.refresh(!!flag)
-      // this.getOrderDetail()
+      this.$refs.table.refresh(flag)
+      if (flag) {
+        this.getOrderDetail()
+      }
     },
     // 添加或修改产品
     saveProduct (row, type) {
@@ -458,7 +462,7 @@ export default {
       }
       this.spinning = true
       salesReturnSaveProduct(params).then(res => {
-        this.resetSearchForm(type != 'edit')
+        this.resetSearchForm(type == 'edit')
         this.isInster = false
         this.spinning = false
       })