chenrui 3 лет назад
Родитель
Сommit
090779525e

+ 9 - 1
src/views/salesManagement/salesReturn/queryPart.vue

@@ -69,6 +69,7 @@
           type="primary"
           type="primary"
           class="button-info"
           class="button-info"
           :loading="newLoading"
           :loading="newLoading"
+          :disabled="(grabFlag==1)&&(record.qty==record.hasReturnQty)"
           @click="handleAdd(record)"
           @click="handleAdd(record)"
         >添加</a-button>
         >添加</a-button>
       </template>
       </template>
@@ -122,10 +123,12 @@ export default {
           for (var i = 0; i < data.list.length; i++) {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].no = no + i + 1
           }
           }
+          this.listData = data.list || []
           this.disabled = false
           this.disabled = false
           return data
           return data
         })
         })
-      }
+      },
+      listData: []
     }
     }
   },
   },
   mounted () {
   mounted () {
@@ -182,6 +185,11 @@ export default {
       this.queryParam.productCode = ''
       this.queryParam.productCode = ''
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
+    refreshData () {
+      if (this.listData.length > 0) {
+        this.$refs.table.refresh(true)
+      }
+    },
     // 选择配件
     // 选择配件
     handleAdd (row) {
     handleAdd (row) {
       this.$emit('add', row, 'new')
       this.$emit('add', row, 'new')

+ 2 - 1
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -19,7 +19,7 @@
       </a-page-header>
       </a-page-header>
       <a-card size="small" :bordered="false" class="pages-wrap">
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- 查询配件列表 -->
         <!-- 查询配件列表 -->
-        <queryPart :buyerSn="$route.params.buyerSn" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
+        <queryPart ref="queryPart" :buyerSn="$route.params.buyerSn" grabFlag="1" :newLoading="isInster" @add="saveProduct"></queryPart>
       </a-card>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
         <!-- alert -->
@@ -415,6 +415,7 @@ export default {
       this.spinning = true
       this.spinning = true
       salesReturnSaveProduct(params).then(res => {
       salesReturnSaveProduct(params).then(res => {
         this.resetSearchForm(true)
         this.resetSearchForm(true)
+        this.$refs.queryPart.refreshData()
         this.isInster = false
         this.isInster = false
         this.spinning = false
         this.spinning = false
       })
       })