Explorar o código

vin码查询后,更改已选产品价格数量不清空 产品查询条件

chenrui %!s(int64=3) %!d(string=hai) anos
pai
achega
9da831701a

+ 1 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -383,6 +383,7 @@ export default {
     },
     //  重置
     resetSearchForm (flag) {
+      if (flag) { this.$refs.partQuery.onlyList = true }
       this.$refs.table.refresh(!!flag)
       this.getOrderDetail()
     },
@@ -463,7 +464,6 @@ export default {
     },
     // 添加产品
     insterProduct (row) {
-      console.log(row)
       // 防止多次添加产品
       if (this.isInster) { return }
       const _this = this

+ 19 - 6
src/views/salesManagement/salesQuery/queryPart.vue

@@ -241,7 +241,7 @@ export default {
           parameter.sortAlias = 'sd'
         }
         const params = Object.assign(parameter, _this.queryParam)
-        if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17) { //  输入vin,查出vin码信息后请求列表数据
+        if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) { //  输入vin,查出vin码信息后请求列表数据
           _this.disabled = true
           return supperCodeByVin({ vin: _this.queryParam.vinCode }).then(res => {
             if (res.status == 200) {
@@ -254,9 +254,16 @@ export default {
               _this.$refs.table.clearTable()
             }
           })
-        } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17) { // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
+        } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17 && !this.onlyList) { // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
           _this.$refs.table.localLoading = false
           _this.$refs.table.clearTable()
+        } else if (this.onlyList) {
+          _this.disabled = true
+          if (_this.queryParam.vinCode && _this.vinInfoData) {
+            return _this.getList(Object.assign(params, { productCodeList: _this.vinInfoData.partCodeList }))
+          } else {
+            return _this.getList(params)
+          }
         } else { //  未输入vin码信息,只查列表数据
           _this.disabled = true
           return _this.getList(params)
@@ -265,7 +272,8 @@ export default {
       openModal: false, //  查看客户详情  弹框
       cost: false,
       cityPrice: false,
-      openCarInfoModal: false
+      openCarInfoModal: false,
+      onlyList: false
     }
   },
   computed: {
@@ -309,6 +317,7 @@ export default {
       const _this = this
       return querySumByProductLocation(params).then(res => {
         let data
+        this.onlyList = false
         if (res.status == 200) {
           data = res.data
           data.list = data.list.filter(item => item != null)
@@ -376,9 +385,13 @@ export default {
       this.vinInfoData = null
     },
     pageInit (buyerSn, priceType) {
-      this.priceType = priceType
-      this.buyerSn = buyerSn
-      this.resetSearchForm()
+      this.priceType = priceType || ''
+      this.buyerSn = buyerSn || ''
+      if (this.onlyList) { // 不清空查询条件
+        this.$refs.table.refresh()
+      } else {
+        this.resetSearchForm()
+      }
     },
     // 刷新当前页面
     resetCurForm () {