chenrui hace 11 meses
padre
commit
21e68be369

+ 11 - 5
src/views/promotionRulesManagement/promotionManagement/detailModal.vue

@@ -99,9 +99,9 @@
               {{ form.publishFlag?form.publishFlag==='1'?'是':'否':'--' }}
             </a-form-model-item>
             <a-form-model-item label="产品范围" prop="productRangeList" >
-              <div v-if="form.promoRule&&form.promoRule.productRangeList">
+              <div v-if="productRangeList&&productTypeList.length>0">
                 <a-tree-select
-                  v-model="form.promoRule.productRangeList"
+                  v-model="productRangeList"
                   :maxTagCount="12"
                   :tree-data="productTypeList"
                   tree-checkable
@@ -110,7 +110,7 @@
                   :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
                   placeholder="请选择产品范围" />
               </div>
-              <div>--</div>
+              <div v-else>--</div>
             </a-form-model-item>
             <a-form-model-item label="返券产品" prop="publishFlag" >
               <div class="productTable">
@@ -167,6 +167,7 @@ export default {
         wrapperCol: { span: 18 }
       },
       productTypeList: [],
+      productRangeList: [],
       form: {
         promoActiveSn: undefined, // 促销活动sn
         title: '', // 标题
@@ -280,8 +281,10 @@ export default {
             this.$nextTick(() => {
               this.getTreeData()
             })
-            if (res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.productRangeList.length > 0) {
-              this.form.promoRule.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
+            if (res.data.promoRule && res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.length > 0) {
+              this.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
+            } else {
+              this.productRangeList = []
             }
           }
           if (res.data.imageSet) {
@@ -390,6 +393,9 @@ export default {
    .productTable{
      width:100%;
    }
+   /deep/.ant-select-disabled .ant-select-selection--multiple .ant-select-selection__choice{
+     color:#333;
+   }
   }
 
 </style>