Browse Source

Merge branch 'develop_yh49_1' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh49_1

chenrui 7 tháng trước cách đây
mục cha
commit
c818680938

+ 15 - 6
src/views/salesManagement/salesQueryNew/comps/updateActiveModal.vue

@@ -5,12 +5,12 @@
     centered
     :maskClosable="false"
     :confirmLoading="confirmLoading"
-    width="450px"
+    :width="total?'450px':'300px'"
     :footer="null"
     @cancel="cancel"
   >
     <a-spin :spinning="spinning" tip="Loading...">
-      <div style="padding: 0 30px;">
+      <div style="padding: 0 30px;" v-if="total">
         <aRadioGroup v-model="upActiveVal">
           <aRadio :style="radioStyle" value="0" v-if="promoRuleSn">
             不参加促销
@@ -25,9 +25,12 @@
           </div>
         </aRadioGroup>
       </div>
+      <div style="padding: 10px 30px;text-align:center;" v-else>
+        没有可参与的【启用状态】的促销规则
+      </div>
       <div style="padding: 30px 0 0;text-align: center;">
-        <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+        <a-button @click="cancel" style="margin-right: 15px" :type="total?'default':'primary'" id="chooseCustom-btn-back">{{ total?'取消':'知道了' }}</a-button>
+        <a-button v-if="total" type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -49,14 +52,20 @@ export default {
       confirmLoading: false,
       upActiveVal: null,
       radioStyle: "display:block;height: '30px';lineHeight: '30px';padding:5px 0;",
-      activeList: null,
+      activeList: [],
       editRow: null,
       promoRuleSn: null
     }
   },
   computed: {
     title () {
+      if (this.total == 0) {
+        return '提示'
+      }
       return this.promoRuleSn ? '确定换促销活动?' : '确定参加促销活动?'
+    },
+    total () {
+      return this.promoRuleSn ? 1 : this.activeList.length
     }
   },
   methods: {
@@ -65,7 +74,7 @@ export default {
       this.editRow = record
       this.spinning = true
       salesPromoMatchProduct(data).then(res => {
-        this.activeList = res.data
+        this.activeList = res.data || []
         this.spinning = false
       })
     },