Browse Source

修改bug

chenrui 10 months ago
parent
commit
8ddab376a9
1 changed files with 82 additions and 50 deletions
  1. 82 50
      src/views/easyPassManagement/promotionalActivities/edit.vue

+ 82 - 50
src/views/easyPassManagement/promotionalActivities/edit.vue

@@ -97,16 +97,6 @@
                   :maxNums="1"
                   @change="changeImage"
                   listType="picture-card"></Upload>
-                <!-- <div v-else>
-                  <img
-                    :src="con"
-                    alt="图片走丢了"
-                    width="80"
-                    height="80"
-                    v-for="(con,i) in imageSet"
-                    style="margin-right:10px;object-fit: cover;"
-                    :key="i" />
-                </div> -->
                 <span class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</span>
               </a-form-model-item>
             </a-col>
@@ -133,47 +123,89 @@
                   allowClear></v-select>
               </a-form-model-item>
             </a-col>
-            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-              <a-form-model-item label="促销规则" prop="promoRule.range">
-                <div class="productInfo flex-center">
-                  <div>
-                    同款产品买<a-input-number
-                      v-model="form.promoRule.ruleValue"
-                      style="margin:0 5px;"
-                      :min="0"
-                      :step="1"
-                      :precision="2"
-                      :max="99999999"
-                      id="promotionEdit-ruleValue"
-                      :disabled="isDisabled"
-                      size="small"/>赠
-                    <a-input-number
-                      v-model="form.promoRule.ruleValue"
-                      style="margin:0 5px;"
-                      :min="0"
-                      :step="1"
-                      :precision="2"
-                      :max="99999999"
-                      id="promotionEdit-ruleValue"
-                      :disabled="isDisabled"
-                      size="small"/>个(数量叠加)
-                    <a-button
-                      type="primary"
-                      id="promotionEdit-addSet-btn"
-                      :disabled="isDisabled"
-                      class="button-primary"
-                      size="small"
-                      @click="handleBatchAdd">批量设置</a-button>
+            <a-col
+              :xs="24"
+              :sm="24"
+              :md="24"
+              :lg="24"
+              :xl="24"
+              v-if="!isShowNextStep">
+              <div style="text-align:center;"><a-button type="primary" size="large" :disabled="isDisabled" @click="handleSave('part')" >保存后设置产品</a-button></div>
+            </a-col>
+            <div v-else>
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <a-form-model-item :label="form.promotionRuleType=='BUY_PROD_GIVE_PROD'?'满赠规则':'优惠方式'" prop="promoRule.range">
+                  <div class="productInfo flex-center">
+                    <!-- 买产品送产品 -->
+                    <div v-if="form.promotionRuleType == 'BUY_PROD_GIVE_PROD'">
+                      同款产品买<a-input-number
+                        v-model="form.promoRule.ruleValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        id="promotionEdit-ruleValue"
+                        :disabled="isDisabled"
+                        size="small"/>赠
+                      <a-input-number
+                        v-model="form.promoRule.ruleValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        id="promotionEdit-ruleValue"
+                        :disabled="isDisabled"
+                        size="small"/>个(数量叠加)
+                      <a-button
+                        type="primary"
+                        id="promotionEdit-addSet-btn"
+                        :disabled="isDisabled"
+                        class="button-primary"
+                        size="small"
+                        @click="handleBatchAdd">批量设置</a-button>
+                    </div>
+                    <!-- 特价产品 -->
+                    <div v-if="form.promotionRuleType == 'PROMO_PROD'">
+                      同款产品买<a-input-number
+                        v-model="form.promoRule.ruleValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        id="promotionEdit-ruleValue"
+                        :disabled="isDisabled"
+                        size="small"/>赠
+                      <a-input-number
+                        v-model="form.promoRule.ruleValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        id="promotionEdit-ruleValue"
+                        :disabled="isDisabled"
+                        size="small"/>个(数量叠加)
+                      <a-button
+                        type="primary"
+                        id="promotionEdit-addSet-btn"
+                        :disabled="isDisabled"
+                        class="button-primary"
+                        size="small"
+                        @click="handleBatchAdd">批量设置</a-button>
+                    </div>
+                    <a-button type="primary" id="promotionEdit-add-btn" :disabled="isDisabled" @click="handleAddProduct" size="small">选择产品</a-button>
                   </div>
-                  <a-button type="primary" id="promotionEdit-add-btn" :disabled="isDisabled" @click="handleAddProduct" size="small">选择产品</a-button>
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <div style="width: 83%;margin:0 auto 10px;">
+                  <productTable ref="chooseProductList" :promoActiveSn="$route.params.sn" :disabledVal="isDisabled"></productTable>
                 </div>
-              </a-form-model-item>
-            </a-col>
-            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-              <div style="width: 83%;margin:0 auto 10px;">
-                <productTable ref="chooseProductList" :promoActiveSn="$route.params.sn" :disabledVal="isDisabled"></productTable>
-              </div>
-            </a-col>
+              </a-col>
+            </div>
           </a-row>
         </a-form-model>
       </a-card>
@@ -186,7 +218,7 @@
         id="productInfoEdit-submit-btn"
         size="large"
         @click="handleSave('all')"
-        v-if="form.contentType !='LINK'|| isShowNextStep ||(form.contentType ==='LINK'&&form.linkType ==='2')"
+        v-if="isShowNextStep"
         style="padding: 0 60px;">保存</a-button>
     </div>
     <!-- 添加产品 -->