lilei vor 2 Monaten
Ursprung
Commit
b1c4f3a40d
3 geänderte Dateien mit 95 neuen und 34 gelöschten Zeilen
  1. 1 1
      public/version.json
  2. 92 31
      src/views/salesManagement/salesQueryNew/chooseProductModal.vue
  3. 2 2
      vue.config.js

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1742777899033
+  "version": 1744612148158
 }

+ 92 - 31
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -89,6 +89,7 @@
         <!-- 查看更多 -->
         <div v-if="hasVaild&&showTable" class="vinInfo-box">
           <div>
+            <span style="margin-right: 5px;">VIN车型:</span>
             <div class="vinInfo-error" v-if="vinInfoData&&!vinInfoData.carInfo">
               <a-icon type="exclamation-circle" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!
             </div>
@@ -99,7 +100,26 @@
                   <span style="vertical-align: middle;">{{ vinInfoData.carInfo.brandName }} {{ vinInfoData.carInfo.modelName }} {{ vinInfoData.carInfo.displacement }} {{ vinInfoData.carInfo.modelYear+'年' }}</span>
                 </div>
                 <div style="color: #f90;cursor: pointer;margin-left: 5px;">
-                  <span>查看详情</span> >
+                  <span>查看详情</span>
+                </div>
+              </div>
+            </div>
+            <!-- 产品分类 -->
+            <div class="vinInfo-productType" v-if="vinInfoData&&vinInfoData.productTypeList">
+              <div style="display: flex;align-items: center;">
+                <span style="margin-right: 5px;">VIN产品分类:</span>
+                <div style="flex-grow: 1;">
+                  <a-select
+                    size="small"
+                    allowClear
+                    v-model="vinProductTypeSn"
+                    @change="vinChangeProductType"
+                    mode="multiple"
+                    style="min-width:300px"
+                    maxTagCount="1"
+                    placeholder="请选择产品分类筛选">
+                    <a-select-option v-for="item in vinInfoData.productTypeList" :key="item.id" :value="item.productTypeSn">{{ item.namePaths.replace(',','>') }}</a-select-option>
+                  </a-select>
                 </div>
               </div>
             </div>
@@ -139,7 +159,7 @@
         :columns="columns"
         :data="loadData"
         @dblclick="handleClickRow"
-        :pageSize="30"
+        :pageSize="200"
         :scroll="{ y: tableHeight, x: tableWidth }"
         bordered>
         <div slot="costTitle">
@@ -337,6 +357,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       warehouseList: [], // 仓库列表
       vinInfoData: null, // vin匹配的车辆信息
+      dataSorce: [], // 表格当前页数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const _this = this
@@ -367,6 +388,7 @@ export default {
             if (res.status == 200) {
               _this.vinInfoData = res.data
               params.productCodeList = res.data.partCodeList || []
+              _this.onlyList = true
               return _this.getList(params)
             } else {
               _this.vinInfoData = null
@@ -395,7 +417,8 @@ export default {
       tyuePrice: false, // 特约价
       zdPrice: false, // 终端价
       openCarInfoModal: false, // 打开车辆信息弹框
-      onlyList: false // 是否重置条件查询
+      onlyList: false, // 是否重置条件查询
+      vinProductTypeSn: undefined
     }
   },
   computed: {
@@ -469,34 +492,54 @@ export default {
     },
     getList (params) {
       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)
-          const no = (data.pageNo - 1) * data.pageSize
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = data.list[i].productSn + '_' + (no + i + 1)
-            data.list[i].salesNums = 1
-            data.list[i].currentQty = data.list[i].currentQty || 0
-            data.list[i].price = data.list[i].origSalePriceFlag == 0 ? data.list[i].lastSalePrice : data.list[i].origSalePriceFlag == 1 ? data.list[i].salePrice : data.list[i].selfSaleprice
-            data.list[i].productOrigCode = data.list[i].productOrigCode ? data.list[i].productOrigCode.trim() : ''
-          }
-          if (!params.vinCode) {
-            _this.vinInfoData = null
-          }
-        } else {
-          data = {
-            list: [],
-            pageNo: 1,
-            pageSize: 10
+      console.log(_this.vinProductTypeSn)
+      // 如果有vin识别的分类
+      if (_this.vinProductTypeSn) {
+        const typeSn = _this.vinProductTypeSn
+        const asyncTask = new Promise((resolve, reject) => {
+          const list = typeSn.length ? _this.dataSorce.filter(item => item && typeSn.includes(item.productTypeSn2)) : _this.dataSorce
+          resolve(list)
+        })
+        return asyncTask
+          .then(result => {
+            _this.disabled = false
+            return {
+              list: result,
+              pageNo: 1,
+              pageSize: 200
+            }
+          })
+      } else {
+        return querySumByProductLocation(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            data.list = data.list.filter(item => item != null)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = data.list[i].productSn + '_' + (no + i + 1)
+              data.list[i].salesNums = 1
+              data.list[i].currentQty = data.list[i].currentQty || 0
+              data.list[i].price = data.list[i].origSalePriceFlag == 0 ? data.list[i].lastSalePrice : data.list[i].origSalePriceFlag == 1 ? data.list[i].salePrice : data.list[i].selfSaleprice
+              data.list[i].productOrigCode = data.list[i].productOrigCode ? data.list[i].productOrigCode.trim() : ''
+            }
+            if (!params.vinCode) {
+              _this.vinInfoData = null
+              _this.vinProductTypeSn = undefined
+            }
+            _this.dataSorce = data.list
+          } else {
+            data = {
+              list: [],
+              pageNo: 1,
+              pageSize: 200
+            }
+            _this.dataSorce = []
           }
-        }
-        _this.disabled = false
-        console.log(data)
-        return data
-      })
+          _this.disabled = false
+          return data
+        })
+      }
     },
     // vin  change
     vinCodeChange (e) {
@@ -518,6 +561,7 @@ export default {
     },
     //  重置
     resetSearchForm (flag) {
+      this.vinProductTypeSn = undefined
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.productOrigCode = ''
@@ -533,7 +577,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.vinInfoData = null
       this.showTable = false
-
+      this.onlyList = false
       if (!flag) {
         this.$refs.table.refresh(true)
       }
@@ -633,6 +677,11 @@ export default {
         }
       })
     },
+    // vin 识别的产品分类
+    vinChangeProductType (val) {
+      this.vinProductTypeSn = val
+      this.searchForm()
+    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
@@ -704,6 +753,18 @@ export default {
       .vinInfo-error{
         color: red;
       }
+      > div{
+        &:first-child{
+          flex-grow: 1;
+          display: flex;
+          align-items: center;
+          .vinInfo-productType{
+            padding-left: 10px;
+            margin-left: 10px;
+            border-left: 1px solid #eee;
+          }
+        }
+      }
     }
   }
   .vininputs{

+ 2 - 2
vue.config.js

@@ -209,8 +209,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.113:8550/qpls-md',
-        target: 'https://p.iscm.360arrow.com/qpls-md',
+        target: 'http://192.168.2.103:8503/qpls-md',
+        // target: 'https://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,
         changeOrigin: true,