lilei 6 meses atrás
pai
commit
e811a940c8

+ 4 - 4
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -147,7 +147,7 @@ export default {
       const _this = this
       // 格式化数字金额单元格
       const formatTd = (row, column, rowIndex, uniKey, fun) => {
-        if (row[column.field] || row[column.field] == 0) {
+        if (row[column.field]) {
           return (<div onClick={() => fun ? fun(row, uniKey) : false}><span class={fun ? 'table-link-btn' : ''}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
         } else {
           return ''
@@ -419,7 +419,7 @@ export default {
         cols.push({
           field: '',
           key: '26',
-          title: '操作',
+          title: '产品',
           width: 130,
           center: 'center',
           fixed: 'right',
@@ -585,7 +585,7 @@ export default {
       salesPromoSaveSort({ salesBillSn: this.salesBillSn, salesPromoList: data }).then(res => {
         this.spinning = false
         if (res.status == 200) {
-          this.tableData = this.tableData.sort((a, b) => a.sort - b.sort)
+          this.$emit('refash', '', 'sort')
         } else {
           // 恢复排序
           item.sort = temp.sort
@@ -596,7 +596,7 @@ export default {
     // 刷新当前规则
     refashRow (item, enable) {
       // 刷新产品列表
-      this.$emit('refash', '', 'update')
+      this.$emit('refash', '', 'enable')
       const active = this.tableData.find(k => k.id == item.id)
       active.enabledFlag = enable
       // 获取禁用的活动规则

+ 16 - 19
src/views/salesManagement/salesQueryNew/comps/productActiveList.vue

@@ -100,19 +100,11 @@
               >批量操作<a-icon type="down" /> </a-button>
             </a-dropdown>
             <span v-if="selectTotal" style="margin:0 10px;">已选 {{ selectTotal }} 项</span>
-          </a-col>
-          <a-col :md="12" :sm="24" style="text-align:right;">
-            <a-button
-              :id="'salesEdit-searchBox-'+id"
-              type="link"
-              class="button-info"
-              @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
             <a-button
               :id="'salesEdit-allSetWare-'+id"
               type="link"
               class="button-info"
               size="small"
-              style="margin-right:10px;"
               @click="handleMenuClick({key:3})"
             ><a-icon type="setting"/> 全部仓库设置</a-button>
             <a-button
@@ -123,6 +115,13 @@
               @click="handleMenuClick({key:2})"
             ><a-icon type="delete"/> 全部删除</a-button>
           </a-col>
+          <a-col :md="12" :sm="24" style="text-align:right;">
+            <a-button
+              :id="'salesEdit-searchBox-'+id"
+              type="link"
+              class="button-info"
+              @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
+          </a-col>
         </a-row>
       </div>
 
@@ -459,7 +458,7 @@ export default {
                       id={'salesEdit-upactive-' + row.id}
                       size="small"
                       type="link"
-                      loading={_this.delLoading}
+                      disabled={_this.delLoading}
                       class="button-primary"
                       onClick={() => _this.handleUpdateActive(row)}
                     >换促销</a-button> : ''
@@ -470,7 +469,7 @@ export default {
                       id={'salesEdit-del-' + row.id}
                       size="small"
                       type="link"
-                      loading={_this.delLoading}
+                      disabled={_this.delLoading}
                       class="button-error"
                       onClick={() => _this.handleDel(row)}
                     >删除{row.regularPromotionSameFlag}</a-button> : ''
@@ -712,6 +711,7 @@ export default {
         _this.$message.warning('请先选择要批量取消的产品!')
         return
       }
+      const len = this.selectedRowKeys.length
       const rowSelect = this.dataSource.filter(item => this.selectedRowKeys.includes(item.id))
       // 判断是否全部为赠品
       const obj = []
@@ -750,7 +750,7 @@ export default {
         }
       })
     },
-    // 删除全部产品 this.promo ? this.promo.salesPromoSn : ''
+    // 删除全部产品
     handleBatchDelAll () {
       const _this = this
       if (_this.dataSource.length == 0) {
@@ -763,7 +763,7 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
+          deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.searchProduct()
               _this.$emit('refash', 'promo', 'batchDel')
@@ -791,7 +791,6 @@ export default {
           _this.spinning = true
           salesDetailBatchDel({
             salesBillSn: _this.salesBillSn,
-            salesPromoSn: '',
             salesBillDetailSnList: obj
           }).then(res => {
             if (res.status == 200) {
@@ -810,8 +809,7 @@ export default {
       const ajax_data = {
         warehouseSn: row.warehouseSn,
         salesBillDetailSnList: snArr,
-        salesBillSn: this.salesBillSn,
-        salesPromoSn: ''
+        salesBillSn: this.salesBillSn
       }
       this.setWarehouseInfo(ajax_data)
     },
@@ -826,7 +824,6 @@ export default {
         warehouseSn: sn,
         salesBillDetailSnList: snArr,
         salesBillSn: _this.salesBillSn,
-        salesPromoSn: '',
         allFlag: _this.warehouseTit ? true : undefined
       }
       _this.setWarehouseInfo(ajax_data)
@@ -869,6 +866,7 @@ export default {
       } else if (e.key == 4) { // 批量取消促销
         _this.handleBatchCancelActive()
       } else { // 全部删除
+        _this.clearTableSelect()
         _this.handleBatchDelAll()
       }
     },
@@ -891,8 +889,7 @@ export default {
         salesDetailUpdateQty({
           salesBillDetailSn: record.salesBillDetailSn,
           qty: record.qty,
-          salesBillSn: _this.salesBillSn,
-          salesPromoSn: ''
+          salesBillSn: _this.salesBillSn
         }).then(res => {
           if (res.status == 200) {
             _this.$emit('refash', 'promo', 'update')
@@ -916,7 +913,7 @@ export default {
         onOk () {
           _this.delLoading = true
           _this.spinning = true
-          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
+          salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.searchProduct()
               _this.$emit('refash', 'promo', 'del')

+ 6 - 4
src/views/salesManagement/salesQueryNew/comps/totalProductDetailModal.vue

@@ -160,9 +160,9 @@ export default {
     // 页面数据初始化
     pageInit (objInfo) {
       this.parameter = { ...objInfo, ...this.parameter }
-      this.$nextTick(() => {
+      setTimeout(() => {
         this.$refs.table.refresh(true)
-      })
+      }, 200)
     },
     // 重置
     resetSearchForm () {
@@ -202,11 +202,13 @@ export default {
     }
   },
   watch: {
-    show (newValue, oldValue) {
-      this.opened = newValue
+    opened (newValue, oldValue) {
       if (!newValue) {
         this.$emit('cancel')
       }
+    },
+    show (newValue, oldValue) {
+      this.opened = newValue
     }
   }
 }

+ 1 - 1
src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue

@@ -29,7 +29,7 @@
           </aRadioGroup>
         </div>
         <!-- 叠加活动 -->
-        <div v-if="upActiveValArr&&upActiveValArr.length">
+        <div v-if="stackActiveList&&stackActiveList.length">
           <div>
             <strong >叠加活动</strong>
           </div>

+ 2 - 2
src/views/salesManagement/salesQueryNew/edit.vue

@@ -57,7 +57,7 @@
         v-if="activeList.length"
       >
         <div slot="title">
-          <div style="display: flex;justify-content: space-between;">
+          <div style="display: flex;justify-content: space-between;align-items: center;">
             <span>活动产品</span>
             <a-button size="small" @click="getActiveList(false)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
           </div>
@@ -420,7 +420,7 @@ export default {
     },
     // 添加活动产品成功的回调,刷新产品列表
     // type:normal 正常列表 ,active 活动列表
-    // action:add 添加,del 删除,batchDel 批量删除,update 更新数据
+    // action:add 添加,del 删除,batchDel 批量删除,update 更新数据, enable 启用禁用,sort 排序
     // 如果添加操作,不实时刷新列表,关闭后再刷新
     refashTableData (type, action) {
       // 重新获取详情信息