Browse Source

修改bug

chenrui 10 tháng trước cách đây
mục cha
commit
60766348e4

+ 9 - 0
src/views/promotionManagement/promotionInfo/edit.vue

@@ -486,6 +486,15 @@ export default {
     },
     //  确定保存
     handleSave (type) {
+      if (this.form.contentType === 'LINK') {
+        if (this.$refs.chooseProductList) {
+          const numInfo = this.$refs.chooseProductList.getDataNum()
+          if (numInfo == 0) {
+            this.$message.warning('请选择返券产品!')
+            return
+          }
+        }
+      }
       this.$message.success('保存成功')
       this.$nextTick(() => {
         this.handleBack()

+ 5 - 0
src/views/promotionManagement/promotionInfo/productTable.vue

@@ -71,6 +71,7 @@ export default {
       spinning: false,
       rowSelectionInfo: null,
       queryParam: {},
+      dataListQty: '0',
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -101,6 +102,7 @@ export default {
               }
             }
             this.disabled = false
+            this.dataListQty = res.data.count
           }
           this.spinning = false
           return data
@@ -140,6 +142,9 @@ export default {
       const ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, ruleValue: numInfo } })
       this.editAllPrice(ajaxArr, 'all')
     },
+    getDataNum () {
+      return this.dataListQty
+    },
     // 删除
     handleDel (row) {
       const _this = this