소스 검색

修改bug

chenrui 9 달 전
부모
커밋
ce7a718e7e

+ 11 - 11
src/views/easyPassManagement/promotionalActivities/chooseProductsModal.vue

@@ -1,13 +1,13 @@
 <template>
-  <a-modal
-    centered
-    class="chooseProducts-modal"
-    :footer="null"
-    :maskClosable="false"
+  <a-drawer
     title="选择产品"
-    v-model="isShow"
-    @cancel="isShow=false"
-    width="70%">
+    class="chooseProducts-modal"
+    placement="right"
+    closable
+    :visible="isShow"
+    @close="isShow=false"
+    width="70%"
+  >
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="products-con">
         <!-- 搜索条件 -->
@@ -72,8 +72,8 @@
           :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
           :data="loadData"
           :defaultLoadData="false"
-          style="max-height:460px;"
-          :scroll="{ y: 400 }"
+          style="max-height:650px;"
+          :scroll="{ y: 600 }"
           bordered>
           <!-- 产品分类 -->
           <template slot="productType" slot-scope="text, record">
@@ -90,7 +90,7 @@
         </s-table>
       </div>
     </a-spin>
-  </a-modal>
+  </a-drawer>
 </template>
 
 <script>

+ 7 - 3
src/views/easyPassManagement/promotionalActivities/edit.vue

@@ -458,9 +458,13 @@ export default {
       })
       saveChooseProduct(productArr).then(res => {
         if (res.status == 200) {
-          this.showProModal = false
-          // 获取产品列表 有分页
-          this.$refs.chooseProductList.pageInit()
+          if (!res.data) {
+            this.showProModal = false
+            // 获取产品列表 有分页
+            this.$refs.chooseProductList.pageInit()
+          } else {
+            this.$message.warning(res.data)
+          }
         }
       })
     },

+ 14 - 3
src/views/easyPassManagement/promotionalActivities/productTable.vue

@@ -121,6 +121,9 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
+                data.list[i].resultValue = data.list[i].resultValue ? data.list[i].resultValue * 100 : ''
+              }
             }
             this.chooseProductNum = data.count
             this.disabled = false
@@ -174,6 +177,9 @@ export default {
           conditionValue: typeName === 'conditionValue' ? row.conditionValue : undefined,
           resultValue: typeName === 'resultValue' ? row.resultValue : undefined
         })
+        if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
+          ajaxData[0].resultValue = row.resultValue ? row.resultValue / 100 : ''
+        }
       } else {
         ajaxData = row || []
       }
@@ -185,14 +191,19 @@ export default {
       })
     },
     // 修改产品活动价、返券金额
-    editMorePrice (objInfo) {
+    editMorePrice (oldObjInfo) {
       if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length === 0)) {
         this.$message.warning('请选择要修改的产品!')
         return
       }
       let ajaxArr = []
-      if (this.activeType === 'PROMO_PROD' && this.discountType === 'STRAIGHT_DOWN') {
-        ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
+      const objInfo = JSON.parse(JSON.stringify(oldObjInfo))
+      if (this.activeType === 'PROMO_PROD') {
+        if (this.discountType === 'STRAIGHT_DOWN') {
+          ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
+        } else {
+          ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue / 100 } })
+        }
       } else {
         ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue } })
       }