lilei 3 weeks ago
parent
commit
c55611b446

+ 7 - 6
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -366,17 +366,18 @@ export default {
           this.transferTableData(this.chooseList)
         } else {
           // 查询正常产品明细列表
-          this.dataSource = await salesDetailAllList(params).then(res => res.data || [])
+          if (this.promoFlag == 0 || this.promoFlag == undefined) {
+            this.dataSource = await salesDetailAllList(params).then(res => res.data || [])
+          }
         }
       } else {
         // 查询活动产品明细列表
-        this.dataSource = await salesDetailExtPromoList({ salesPromoSnSet: this.salesPromoSnSet, ...params }).then(res => res.data || [])
+        if (this.promoFlag !== '0') {
+          this.dataSource = await salesDetailExtPromoList({ salesPromoSnSet: this.salesPromoSnSet, ...params }).then(res => res.data || [])
+        }
       }
 
-      // 没用数据,则不显示当前表格
-      if (this.dataSource.length == 0) {
-        this.$emit('hideTable', this.type)
-      }
+      this.$emit('hideTable', this.type, this.dataSource.length)
 
       // 格式化数据
       let f = 0

+ 12 - 3
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -291,6 +291,17 @@ export default {
       const priceFormat = function (data) {
         return _this.toThousands(data) || '--'
       }
+      // 显示折扣价
+      const discountPriceFormat = function (record, data, h) {
+        return (
+          <div>
+            {_this.toThousands(data)}
+            {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
+              <span title="原价">({ _this.toThousands(record.origPrice)})</span>
+            ) : ''}
+          </div>
+        )
+      }
       // 数字
       const numsFormat = function (data) {
         return data || data == 0 ? data : '--'
@@ -491,9 +502,7 @@ export default {
           key: 'price',
           align: 'right',
           operationColumn: false,
-          renderBodyCell: ({ row, column, rowIndex }, h) => {
-            return <div>{_this.toThousands(row[column.field])}<span style="color:#666;margin-left:3px;" title="原价">({_this.toThousands(row.origPrice)})</span></div>
-          }
+          renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) }
         })
         arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 60, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
         if (_this.showStockCol) {

+ 26 - 7
src/views/salesManagement/salesQueryNew/detail.vue

@@ -128,7 +128,13 @@
                   </a-col>
                   <a-col flex="300px" v-if="hasPrompActive">
                     <a-form-item label="产品类型">
-                      <a-select v-model.trim="promoFlag" id="salesDetail-promoFlag" allowClear :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
+                      <a-select
+                        v-model="promoFlag"
+                        @change="e=> {borrowFlag = undefined}"
+                        id="salesDetail-promoFlag"
+                        allowClear
+                        :dropdownMatchSelectWidth="false"
+                        placeholder="请选择产品类型">
                         <a-select-option value="0">
                           正常产品
                         </a-select-option>
@@ -150,7 +156,7 @@
                       </a-select>
                     </a-form-item>
                   </a-col>
-                  <a-col flex="200px" v-if="hasPrompActive">
+                  <a-col flex="200px" v-if="hasPrompActive&&promoFlag!=='0'">
                     <a-form-item label="累计产品">
                       <v-select code="FLAG" v-model="borrowFlag" allowClear placeholder="请选择是否累计产品"></v-select>
                     </a-form-item>
@@ -188,8 +194,16 @@
             </div>
           </div>
         </div>
-        <!-- 正常产品列表 -->
-        <div v-if="!hideNormalTable">
+      </a-card>
+      <!-- 正常产品列表 -->
+      <a-card
+        size="small"
+        :bordered="false"
+        class="salesEdit-cont"
+        style="margin-bottom: 6px;"
+        v-if="!hideNormalTable"
+      >
+        <div>
           <detailProductList
             ref="productList"
             :maxHeight="pageHeight"
@@ -254,6 +268,7 @@
           :activeList="activeList"
           :warehouseSn="warehouseSn"
           :promoFlag="promoFlag"
+          :borrowFlag="borrowFlag"
           :salesBillSn="$route.params.sn || bizSn"
           :salesPromoSnSet="salesPromoSnSet"
           :authCode="authCode"
@@ -542,11 +557,14 @@ export default {
       })
     },
     // 是否隐藏表格
-    hideTable (type) {
+    hideTable (type, len) {
+      this.spinning = false
       if (type == 'normal') {
-        this.hideNormalTable = true
+        this.hideNormalTable = !(this.promoFlag == 0 || this.promoFlag == undefined) || this.borrowFlag != undefined
       } else {
-        // this.hideActiveTable = true
+        if (this.promoFlag == 0) {
+          this.hideActiveTable = true
+        }
       }
     },
     // 编辑
@@ -618,6 +636,7 @@ export default {
     searchTable () {
       this.hideNormalTable = false
       this.hideActiveTable = this.activeList.length == 0
+      this.spinning = true
       this.$nextTick(() => {
         this.$refs.productList.searchTable()
         if (!this.hideActiveTable) this.$refs.productActiveList.searchTable()