chenrui 1 rok temu
rodzic
commit
233cfe1858

+ 2 - 1
src/views/promotionRulesManagement/dealerPromotions/chooseProductsModal.vue

@@ -67,7 +67,7 @@
             :columns="columns"
             :data="loadData"
             :defaultLoadData="false"
-             style="max-height:580px;"
+            style="max-height:580px;"
             :scroll="{ y: 520 }"
             bordered>
             <!-- 产品分类 -->
@@ -211,6 +211,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.resetSearchForm()
       } else {
         const _this = this
         _this.resetSearchForm()

+ 13 - 4
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -63,7 +63,7 @@
         </a-form-model-item>
         <a-form-model-item label="满赠规则" prop="regularSameFlag">
           <div class="ruleDescList">
-            <a-select default-value="1" v-model="form.regularSameFlag" style="width: 100px" size="small">
+            <a-select default-value="1" v-model="form.regularSameFlag" style="width: 100px" size="small" @change="handleFullGift">
               <a-select-option value="1">
                 同款
               </a-select-option>
@@ -161,7 +161,7 @@
             placeholder="请输入金额"/>
         </a-form-model-item>
         <a-form-model-item label="促销品与正品一致" prop="regularPromotionSameFlag">
-          <a-radio-group v-model="form.regularPromotionSameFlag" button-style="solid" size="small">
+          <a-radio-group v-model="form.regularPromotionSameFlag" button-style="solid" size="small" :disabled="form.regularSameFlag==0">
             <a-radio-button value="1">
             </a-radio-button>
@@ -255,7 +255,7 @@ export default {
         minOrderAmount: undefined,
         upperLimitFlag: '0', // 活动经费上限
         upperLimitAmount: undefined,
-        regularPromotionSameFlag: undefined
+        regularPromotionSameFlag: '1'
       },
       rules: {
         description: [ { required: true, message: '请输入规则简称', trigger: 'blur' } ],
@@ -271,6 +271,15 @@ export default {
     }
   },
   methods: {
+    //满赠  同款    促销品与正品一致  默认是 可修改   
+    //     不同款                   默认否 不可修改
+    handleFullGift(e){
+      if(e==='0'){
+        this.form.regularPromotionSameFlag='0'
+      }else{
+        this.form.regularPromotionSameFlag='1'
+      }
+    },
     // 导入
     closeGuideModel () {
       this.openGuideModal = false
@@ -393,7 +402,7 @@ export default {
         minOrderAmount: undefined,
         upperLimitFlag: '0', // 活动经费上限
         upperLimitAmount: undefined,
-        regularPromotionSameFlag: undefined,
+        regularPromotionSameFlag: '1',
         gateProductList: undefined,
         giftProductList: undefined,
         regularProductList: undefined

+ 49 - 50
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -401,58 +401,57 @@ export default {
     },
     // +新增产品
     handleProductsOk (con) {
-      const chooseProductsList = []
       const _this = this
-      con.forEach(item => {
-        getNewScopeSn({}).then(res => {
-          if (res.status == 200) {
-            const newData = {
-              productScopeSn: res.data,
-              dataSourceOrigin: '1',
-              productTypeArr: [],
-              productTypeList: [],
-              productBrandArr: [{ brandSn: item.productBrandSn, brandName: item.productBrandName }],
-              productBrandList: [{ brandSn: item.productBrandSn }],
-              productThisList: [{
-                productSn: item.productSn,
-                productCode: item.code
-              }],
-              provincePrice: item.provincePrice,
-              cityPrice: item.cityPrice,
-              specialPrice: item.specialPrice,
-              provinceDiscountPrice: item.provinceDiscountPriceText,
-              cityDiscountPrice: item.cityDiscountPriceText,
-              specialDiscountPrice: item.specialDiscountPriceText,
-              unitType: 'SL',
-              unitQty: 1
-            }
-            const obj = {}
-            if (item.productTypeSn1) {
-              obj.productType1 = item.productTypeSn1
-            }
-            if (item.productTypeSn2) {
-              obj.productType2 = item.productTypeSn2
-            }
-            if (item.productTypeSn3) {
-              obj.productType3 = item.productTypeSn3
-            }
-            const newObj = { ...obj, ...{} }
-            if (Object.keys(obj).length == 1) {
-              newObj.title = item.productTypeName1
-              newObj.id = item.productTypeSn1
-            } else if (Object.keys(obj).length == 2) {
-              newObj.title = item.productTypeName1 + '/' + item.productTypeName2
-              newObj.id = item.productTypeSn2
-            } else {
-              newObj.title = item.productTypeName1 + '/' + item.productTypeName2 + '/' + item.productTypeName3
-              newObj.id = item.productTypeSn3
-            }
-            newData.productTypeList[0] = obj
-            newData.productTypeArr[0] = newObj
-            chooseProductsList.push(newData)
-            _this.$refs.specialProduct.setSourceData(chooseProductsList)
+      con.forEach(async (item) => {
+        const chooseProductsList = []
+        const getSn = await getNewScopeSn({})
+        if (getSn.status == 200) {
+          const newData = {
+            productScopeSn: getSn.data,
+            dataSourceOrigin: '1',
+            productTypeArr: [],
+            productTypeList: [],
+            productBrandArr: [{ brandSn: item.productBrandSn, brandName: item.productBrandName }],
+            productBrandList: [{ brandSn: item.productBrandSn }],
+            productThisList: [{
+              productSn: item.productSn,
+              productCode: item.code
+            }],
+            provincePrice: item.provincePrice,
+            cityPrice: item.cityPrice,
+            specialPrice: item.specialPrice,
+            provinceDiscountPrice: item.provinceDiscountPriceText,
+            cityDiscountPrice: item.cityDiscountPriceText,
+            specialDiscountPrice: item.specialDiscountPriceText,
+            unitType: 'SL',
+            unitQty: 1
           }
-        })
+          const obj = {}
+          if (item.productTypeSn1) {
+            obj.productType1 = item.productTypeSn1
+          }
+          if (item.productTypeSn2) {
+            obj.productType2 = item.productTypeSn2
+          }
+          if (item.productTypeSn3) {
+            obj.productType3 = item.productTypeSn3
+          }
+          const newObj = { ...obj, ...{} }
+          if (Object.keys(obj).length == 1) {
+            newObj.title = item.productTypeName1
+            newObj.id = item.productTypeSn1
+          } else if (Object.keys(obj).length == 2) {
+            newObj.title = item.productTypeName1 + '/' + item.productTypeName2
+            newObj.id = item.productTypeSn2
+          } else {
+            newObj.title = item.productTypeName1 + '/' + item.productTypeName2 + '/' + item.productTypeName3
+            newObj.id = item.productTypeSn3
+          }
+          newData.productTypeList[0] = obj
+          newData.productTypeArr[0] = newObj
+          chooseProductsList.push(newData)
+        }
+        _this.$refs.specialProduct.setSourceData(chooseProductsList)
       })
     }
   },

+ 18 - 3
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -13,7 +13,7 @@
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record,index">
-        <div style="max-height:126px;width:100%;overflow-y:scroll;">
+        <div style="max-height:126px;width:100%;overflow-y:scroll;" v-if="!record.productThisList || record.productThisList.length==0">
           <a-row v-if="record.productTypeArr && record.productTypeArr.length>0">
             <a-col :span="16">
               <div v-for="con in record.productTypeArr" :key="con.id">
@@ -41,10 +41,15 @@
             </a-col>
           </a-row>
         </div>
+        <div v-else>
+          <a-tag style="background: #fff; borderStyle: dashed;" :style="{color:'grey',cursor:'not-allowed'}">
+            <a-icon type="plus" /> 选择
+          </a-tag>
+        </div>
       </template>
       <!-- 品牌 -->
       <template slot="productBrand" slot-scope="text, record,index">
-        <div style="max-height:126px;overflow-y:scroll;">
+        <div style="max-height:126px;overflow-y:scroll;" v-if="!record.productThisList || record.productThisList.length==0">
           <a-row v-if="record.productBrandArr && record.productBrandArr.length>0">
             <a-col :span="16">
               <div v-for="item in record.productBrandArr" :key="item.brandSn">
@@ -73,10 +78,20 @@
             </a-col>
           </a-row>
         </div>
+        <div v-else>
+          <a-tag style="background: #fff; borderStyle: dashed;" :style="{color:'grey',cursor:'not-allowed'}">
+            <a-icon type="plus" /> 选择
+          </a-tag>
+        </div>
       </template>
       <!-- 产品 -->
       <template slot="product" slot-scope="text, record,index">
-        <div style="max-height:126px;overflow-y:scroll;">
+        <div v-if="(record.productBrandArr && record.productBrandArr.length>0)||(record.productTypeArr && record.productTypeArr.length>0)">
+          <a-tag style="background: #fff; borderStyle: dashed;" :style="{color:'grey',cursor:'not-allowed'}">
+            <a-icon type="plus" /> 选择
+          </a-tag>
+        </div>
+        <div style="max-height:126px;overflow-y:scroll;" v-else>
           <a-row v-if="record.productThisList && record.productThisList.length>0">
             <a-col :span="16">
               <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'productList')" v-for="item in record.productThisList" :key="item.productSn">

+ 19 - 3
src/views/promotionRulesManagement/dealerPromotions/tableType2.vue

@@ -13,7 +13,7 @@
       bordered>
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record,index">
-        <div style="max-height:126px;width:100%;overflow-y:scroll;">
+        <div style="max-height:126px;width:100%;overflow-y:scroll;" v-if="!record.productThisList || record.productThisList.length==0">
           <a-row v-if="record.productTypeArr && record.productTypeArr.length>0">
             <a-col :span="16">
               <div v-for="con in record.productTypeArr" :key="con.id">
@@ -41,10 +41,15 @@
             </a-col>
           </a-row>
         </div>
+        <div v-else>
+          <a-tag style="background: #fff; borderStyle: dashed;" :style="{color:'grey',cursor:'not-allowed'}">
+            <a-icon type="plus" /> 选择
+          </a-tag>
+        </div>
       </template>
       <!-- 品牌 -->
       <template slot="productBrand" slot-scope="text, record,index">
-        <div style="max-height:126px;overflow-y:scroll;">
+        <div style="max-height:126px;overflow-y:scroll;" v-if="!record.productThisList || record.productThisList.length==0">
           <a-row v-if="record.productBrandArr && record.productBrandArr.length>0">
             <a-col :span="16">
               <div v-for="item in record.productBrandArr" :key="item.brandSn">
@@ -73,10 +78,20 @@
             </a-col>
           </a-row>
         </div>
+        <div v-else>
+          <a-tag style="background: #fff; borderStyle: dashed;" :style="{color:'grey',cursor:'not-allowed'}">
+            <a-icon type="plus" /> 选择
+          </a-tag>
+        </div>
       </template>
       <!-- 产品 -->
       <template slot="product" slot-scope="text, record,index">
-        <div style="max-height:126px;overflow-y:scroll;">
+        <div v-if="(record.productBrandArr && record.productBrandArr.length>0)||(record.productTypeArr && record.productTypeArr.length>0)">
+          <a-tag style="background: #fff; borderStyle: dashed;" :style="{color:'grey',cursor:'not-allowed'}">
+            <a-icon type="plus" /> 选择
+          </a-tag>
+        </div>
+        <div style="max-height:126px;overflow-y:scroll;" v-else>
           <a-row v-if="record.productThisList && record.productThisList.length>0">
             <a-col :span="16">
               <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'productList')" v-for="item in record.productThisList" :key="item.productSn">
@@ -98,6 +113,7 @@
           </a-row>
         </div>
       </template>
+      <!-- 操作 -->
       <span slot="action" slot-scope="text,record">
         <a-button
           size="small"