chenrui 1 год назад
Родитель
Сommit
b61ed3d1c0

BIN
public/templ/促销规则导入特价产品.xlsx


+ 1 - 0
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -10,6 +10,7 @@
     :width="800">
     :width="800">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
       <a-form-model
+        style="max-height:650px;overflow-y: scroll;"
         id="promotionList-basicInfo-form"
         id="promotionList-basicInfo-form"
         ref="ruleForm"
         ref="ruleForm"
         :model="form"
         :model="form"

+ 9 - 8
src/views/promotionRulesManagement/dealerPromotions/chooseProductsModal.vue

@@ -1,12 +1,13 @@
 <template>
 <template>
-  <a-drawer
-    title="选择产品"
+  <a-modal
+    centered
     class="chooseProducts-modal"
     class="chooseProducts-modal"
-    placement="right"
-    :visible="isShow"
-    @close="isShow=false"
-    width="50%"
-  >
+    :footer="null"
+    :maskClosable="false"
+    title="选择产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="products-con">
       <div class="products-con">
         <div>
         <div>
@@ -86,7 +87,7 @@
         </div>
         </div>
       </div>
       </div>
     </a-spin>
     </a-spin>
-  </a-drawer>
+  </a-modal>
 </template>
 </template>
 
 
 <script>
 <script>

+ 14 - 14
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -7,7 +7,7 @@
     title="详情"
     title="详情"
     v-model="isShow"
     v-model="isShow"
     @cancel="isShow=false"
     @cancel="isShow=false"
-    width="70%">
+    width="80%">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
       <a-form-model
         id="dealerPromotions-basicInfo-form"
         id="dealerPromotions-basicInfo-form"
@@ -52,7 +52,7 @@
             </a-tooltip>
             </a-tooltip>
             活动经费上限
             活动经费上限
           </span>
           </span>
-          {{ form.upperLimitFlag === '1'?'限制':'不限制' }}{{ form.upperLimitAmount?form.upperLimitAmount+'元' :''}}
+          {{ form.upperLimitFlag === '1'?'限制':'不限制' }}{{ form.upperLimitAmount?form.upperLimitAmount+'元' :'' }}
         </a-form-model-item>
         </a-form-model-item>
         <a-form-model-item label="促销品是否与正品一致" v-if="form.regularPromotionSameFlag" prop="regularPromotionSameFlag">{{ form.regularPromotionSameFlag==='1'?'是':'否' }}</a-form-model-item>
         <a-form-model-item label="促销品是否与正品一致" v-if="form.regularPromotionSameFlag" prop="regularPromotionSameFlag">{{ form.regularPromotionSameFlag==='1'?'是':'否' }}</a-form-model-item>
         <a-form-model-item label="采购额适用范围" v-if="form.scopeFlag" prop="scopeFlag">{{ form.scopeFlag==='1'?'全部产品':'部分产品' }}</a-form-model-item>
         <a-form-model-item label="采购额适用范围" v-if="form.scopeFlag" prop="scopeFlag">{{ form.scopeFlag==='1'?'全部产品':'部分产品' }}</a-form-model-item>
@@ -76,20 +76,20 @@
         <div v-show="chooseVal!='d'">
         <div v-show="chooseVal!='d'">
           <a-table
           <a-table
             class="sTable"
             class="sTable"
-            style="margin-top:10px;max-height:280px;"
+            style="margin-top:10px;max-height:340px;"
             ref="table"
             ref="table"
             size="small"
             size="small"
             :rowKey="(record) => record.productScopeSn"
             :rowKey="(record) => record.productScopeSn"
             :columns="columns"
             :columns="columns"
             :data-source="chooseVal==='a'?form.gateProductList:chooseVal==='b'?form.regularProductList:form.giftProductList"
             :data-source="chooseVal==='a'?form.gateProductList:chooseVal==='b'?form.regularProductList:form.giftProductList"
-            :scroll="{ y: 500 }"
+            :scroll="{ y: 330 }"
             :pagination="false"
             :pagination="false"
             bordered
             bordered
           >
           >
             <!-- 产品分类 -->
             <!-- 产品分类 -->
             <template slot="productType" slot-scope="text, record">
             <template slot="productType" slot-scope="text, record">
               <div style="max-height:110px;overflow-y:scroll;" v-if="record.productTypeList && record.productTypeList.length>0">
               <div style="max-height:110px;overflow-y:scroll;" v-if="record.productTypeList && record.productTypeList.length>0">
-                <a-tag style="margin-bottom:5px;" v-for="item in record.productTypeList" :key="item.id">{{ item.productTypeName3? item.productTypeName2+'/'+item.productTypeName3:(item.productTypeName2&&!item.productTypeName3)?item.productTypeName2:item.productTypeName1}}</a-tag>
+                <a-tag style="margin-bottom:5px;" v-for="item in record.productTypeList" :key="item.id">{{ item.productTypeName3? item.productTypeName2+'/'+item.productTypeName3:(item.productTypeName2&&!item.productTypeName3)?item.productTypeName2:item.productTypeName1 }}</a-tag>
               </div>
               </div>
             </template>
             </template>
             <!-- 品牌 -->
             <!-- 品牌 -->
@@ -106,8 +106,8 @@
             </template>
             </template>
             <!-- 设置起订量 -->
             <!-- 设置起订量 -->
             <template slot="setNum" slot-scope="text, record">
             <template slot="setNum" slot-scope="text, record">
-              <span style="margin-right:10px;">{{ record.unitTypeDictValue }}</span>
-              <span>{{ record.unitQty }}</span>
+              <a-tag style="width:60%;margin-bottom:5px;margin-right:0;">{{ record.unitTypeDictValue }}</a-tag>
+              <a-tag style="width:60%;margin-right:0;">{{ record.unitQty }}</a-tag>
             </template>
             </template>
           </a-table>
           </a-table>
         </div>
         </div>
@@ -115,20 +115,20 @@
         <div v-show="chooseVal=='d'">
         <div v-show="chooseVal=='d'">
           <a-table
           <a-table
             class="sTable"
             class="sTable"
-            style="margin-top:10px;max-height:280px;"
+            style="margin-top:10px;max-height:340px;"
             ref="table"
             ref="table"
             size="small"
             size="small"
             :rowKey="(record) => record.productScopeSn"
             :rowKey="(record) => record.productScopeSn"
             :columns="specialColumns"
             :columns="specialColumns"
             :data-source="form.specialProductList"
             :data-source="form.specialProductList"
-            :scroll="{ y: 500 }"
+            :scroll="{ y: 330 }"
             :pagination="false"
             :pagination="false"
             bordered
             bordered
           >
           >
             <!-- 产品分类 -->
             <!-- 产品分类 -->
             <template slot="productType" slot-scope="text, record">
             <template slot="productType" slot-scope="text, record">
               <div style="max-height:100px;overflow-y:scroll;" v-if="record.productTypeList && record.productTypeList.length>0">
               <div style="max-height:100px;overflow-y:scroll;" v-if="record.productTypeList && record.productTypeList.length>0">
-                <a-tag style="margin-bottom:5px;" v-for="item in record.productTypeList" :key="item.id">{{ item.productTypeName3? item.productTypeName2+'/'+item.productTypeName3:(item.productTypeName2&&!item.productTypeName3)?item.productTypeName2:item.productTypeName1}}</a-tag>
+                <a-tag style="margin-bottom:5px;" v-for="item in record.productTypeList" :key="item.id">{{ item.productTypeName3? item.productTypeName2+'/'+item.productTypeName3:(item.productTypeName2&&!item.productTypeName3)?item.productTypeName2:item.productTypeName1 }}</a-tag>
               </div>
               </div>
             </template>
             </template>
             <!-- 品牌 -->
             <!-- 品牌 -->
@@ -146,8 +146,8 @@
             </template>
             </template>
             <!-- 设置起订量 -->
             <!-- 设置起订量 -->
             <template slot="setNum" slot-scope="text, record">
             <template slot="setNum" slot-scope="text, record">
-              <span style="margin-right:10px;">{{ record.unitTypeDictValue }}</span>
-              <span>{{ record.unitQty }}</span>
+              <a-tag style="width:90%;margin-bottom:5px;margin-right:0;">{{ record.unitTypeDictValue }}</a-tag>
+              <a-tag style="width:90%;margin-right:0;">{{ record.unitQty }}</a-tag>
             </template>
             </template>
           </a-table>
           </a-table>
         </div>
         </div>
@@ -214,7 +214,7 @@ export default {
       specialColumns: [
       specialColumns: [
         { title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, align: 'center' },
         { title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, align: 'center' },
         { title: '品牌', width: '11%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
         { title: '品牌', width: '11%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
-        { title: '产品', scopedSlots: { customRender: 'product' }, width: '8%', align: 'center' },
+        { title: '产品', scopedSlots: { customRender: 'product' }, width: '11%', align: 'center' },
         { title: '省价原价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '省价原价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '省价特价', dataIndex: 'provinceDiscountPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '省价特价', dataIndex: 'provinceDiscountPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '省价折扣', dataIndex: 'provinceDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } },
         { title: '省价折扣', dataIndex: 'provinceDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } },
@@ -224,7 +224,7 @@ export default {
         { title: '特约原价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '特约原价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '特约特价', dataIndex: 'specialDiscountPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '特约特价', dataIndex: 'specialDiscountPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '特约折扣', dataIndex: 'specialDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } },
         { title: '特约折扣', dataIndex: 'specialDiscountRate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? (text + '%') : '--') } },
-        { title: '设置起订量', width: '12%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
+        { title: '设置起订量', width: '7%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
       ]
       ]
     }
     }
   },
   },

+ 39 - 18
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -44,13 +44,13 @@
               placeholder="请选择"
               placeholder="请选择"
               allowClear></v-select>
               allowClear></v-select>
             <div v-if="form.gateType==='RATIO_AMOUNT'">
             <div v-if="form.gateType==='RATIO_AMOUNT'">
-              购买门槛产品金额 <a-input-number v-model="form.gateAmount" :min="0" :max="100" size="small"/> %作为配额
+              购买门槛产品金额 <a-input-number v-model="form.gateAmount" :min="0" :max="999999" :precision="2" size="small"/> %作为配额
               <a-tooltip title="如:填写100%,则购买10000元门槛产品,可享受10000配额购买正价产品,根据门槛金额动态调整配额">
               <a-tooltip title="如:填写100%,则购买10000元门槛产品,可享受10000配额购买正价产品,根据门槛金额动态调整配额">
                 <a-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
                 <a-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
               </a-tooltip>
               </a-tooltip>
             </div>
             </div>
             <div v-if="form.gateType==='MIN_AMOUNT'">
             <div v-if="form.gateType==='MIN_AMOUNT'">
-              购买门槛产品满最低金额 <a-input-number v-model="form.gateAmount" :max="999999" :min="0" :precision="2" size="small"/> 不限制配额。
+              购买门槛产品满最低金额 <a-input-number v-model="form.gateAmount" :max="999999" :min="0" :precision="2" size="small"/>元,不限制配额。
             </div>
             </div>
             <div class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
             <div class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
               购买满
               购买满
@@ -103,13 +103,7 @@
           </a-radio-group>
           </a-radio-group>
           <span style="color:gray;">(如:满1000送200,金额叠加则:满2000送400,以此类推)</span>
           <span style="color:gray;">(如:满1000送200,金额叠加则:满2000送400,以此类推)</span>
         </a-form-model-item>
         </a-form-model-item>
-        <a-form-model-item prop="minOrderFlag">
-          <span slot="label">
-            <!-- <a-tooltip title="What do you want others to call you?">
-              <a-icon type="info-circle" />
-            </a-tooltip> -->
-            订单起订金额
-          </span>
+        <a-form-model-item prop="minOrderFlag" label="订单起订金额">
           <a-select default-value="1" v-model="form.minOrderFlag" style="width: 160px" size="small">
           <a-select default-value="1" v-model="form.minOrderFlag" style="width: 160px" size="small">
             <a-select-option value="0">
             <a-select-option value="0">
               不限
               不限
@@ -129,13 +123,7 @@
             :precision="2"
             :precision="2"
             placeholder="请输入金额"/>
             placeholder="请输入金额"/>
         </a-form-model-item>
         </a-form-model-item>
-        <a-form-model-item prop="upperLimitFlag">
-          <span slot="label">
-            <!-- <a-tooltip title="What do you want others to call you?">
-              <a-icon type="info-circle" />
-            </a-tooltip> -->
-            活动经费上限
-          </span>
+        <a-form-model-item prop="upperLimitFlag" label="活动经费上限">
           <a-select default-value="1" v-model="form.upperLimitFlag" style="width: 160px" size="small">
           <a-select default-value="1" v-model="form.upperLimitFlag" style="width: 160px" size="small">
             <a-select-option value="0">
             <a-select-option value="0">
               不限
               不限
@@ -304,7 +292,6 @@ export default {
     //  保存
     //  保存
     handleSave () {
     handleSave () {
       const _this = this
       const _this = this
-
       this.$refs.ruleForm.validate(valid => {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
         if (valid) {
           // 验证必填
           // 验证必填
@@ -335,11 +322,16 @@ export default {
             _this.$message.warning('请输入活动经费上限金额!')
             _this.$message.warning('请输入活动经费上限金额!')
             return
             return
           }
           }
-
           const form = JSON.parse(JSON.stringify(_this.form))
           const form = JSON.parse(JSON.stringify(_this.form))
+          let rowFlag = null
           if (form.gateFlag == '1') {
           if (form.gateFlag == '1') {
             form.gateProductList = this.$refs.cillProduct.getResultVal()
             form.gateProductList = this.$refs.cillProduct.getResultVal()
             form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
             form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
+            if (form.gateProductList.length == 0) {
+              _this.$message.warning('请添加门槛产品!')
+              return
+            }
+            rowFlag = _this.isJudge(form.gateProductList)
           } else {
           } else {
             form.gateProductList = []
             form.gateProductList = []
             form.gateAmount = ''
             form.gateAmount = ''
@@ -348,10 +340,27 @@ export default {
           }
           }
           if (form.scopeFlag == '0') {
           if (form.scopeFlag == '0') {
             form.giftProductList = this.$refs.offerProduct.getResultVal()
             form.giftProductList = this.$refs.offerProduct.getResultVal()
+            if (form.giftProductList.length == 0) {
+              _this.$message.warning('请添加促销产品!')
+              return
+            }
+            rowFlag = _this.isJudge(form.giftProductList)
           } else {
           } else {
             form.giftProductList = []
             form.giftProductList = []
           }
           }
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
+          // 判断表格必填
+          if (form.regularProductList.length == 0) {
+            _this.$message.warning('请添加正价产品!')
+            return
+          } else {
+            rowFlag = _this.isJudge(form.regularProductList)
+          }
+
+          if (rowFlag) {
+            _this.$message.warning('请选择产品分类、品牌或产品!')
+            return
+          }
           form.promotionSn = _this.promotionSn
           form.promotionSn = _this.promotionSn
           _this.spinning = true
           _this.spinning = true
           promotionSave(form).then(res => {
           promotionSave(form).then(res => {
@@ -371,6 +380,18 @@ export default {
         }
         }
       })
       })
     },
     },
+    // 判断品牌,分类,产品其中一个必填
+    isJudge (list) {
+      debugger
+      const flag = list.some(con => {
+        if (con.productThisList && con.productTypeList && con.productBrandList) {
+          return con.productThisList.length == 0 && con.productTypeList.length == 0 && con.productBrandList.length == 0
+        } else {
+          return false
+        }
+      })
+      return flag
+    },
     // 重置表格
     // 重置表格
     resetSearchForm () {
     resetSearchForm () {
       this.form = {
       this.form = {

+ 45 - 6
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -44,7 +44,7 @@
               placeholder="请选择"
               placeholder="请选择"
               allowClear></v-select>
               allowClear></v-select>
             <div v-if="form.gateType==='RATIO_AMOUNT'">
             <div v-if="form.gateType==='RATIO_AMOUNT'">
-              购买门槛产品金额 <a-input-number v-model="form.gateAmount" oninput="value=value.replace(/^\./g, '0.').match(/\d+\.?\d{0,2}/)" :min="0" size="small"/> %作为配额
+              购买门槛产品金额 <a-input-number v-model="form.gateAmount" :min="0" :max="999999" :precision="2" size="small"/> %作为配额
               <a-tooltip title="如:填写100%,则购买10000元门槛产品,可享受10000配额购买正价产品,根据门槛金额动态调整配额">
               <a-tooltip title="如:填写100%,则购买10000元门槛产品,可享受10000配额购买正价产品,根据门槛金额动态调整配额">
                 <a-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
                 <a-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
               </a-tooltip>
               </a-tooltip>
@@ -72,7 +72,13 @@
               </a-select-option>
               </a-select-option>
             </a-select>
             </a-select>
             产品购买满
             产品购买满
-            <a-input-number v-model="form.regularQty" :min="0" :step="1" :precision="0" size="small"/>
+            <a-input-number
+              v-model="form.regularQty"
+              :min="0"
+              :step="1"
+              :max="999999"
+              :precision="0"
+              size="small"/>
             个正价产品,送
             个正价产品,送
             <a-input-number
             <a-input-number
               v-model="form.promotionQty"
               v-model="form.promotionQty"
@@ -84,7 +90,7 @@
             个促销产品
             个促销产品
           </div>
           </div>
           <div class="ruleDescList">
           <div class="ruleDescList">
-            <a-checkbox size="small" @change="onChange">
+            <a-checkbox :checked="form.restrictFlag === '1'" size="small" @change="onChange">
               限制正价产品款数
               限制正价产品款数
             </a-checkbox>
             </a-checkbox>
             <a-input-number
             <a-input-number
@@ -248,7 +254,7 @@ export default {
         regularSameFlag: '1', // 满赠规则  不同款商品
         regularSameFlag: '1', // 满赠规则  不同款商品
         regularQty: undefined,
         regularQty: undefined,
         promotionQty: undefined,
         promotionQty: undefined,
-        restrictFlag: undefined, // 限制正价产品款数
+        restrictFlag: '0', // 限制正价产品款数
         restrictCategory: '',
         restrictCategory: '',
         accrualFlag: undefined, // 数量叠加
         accrualFlag: undefined, // 数量叠加
         minOrderFlag: '0', // 起订金额
         minOrderFlag: '0', // 起订金额
@@ -334,7 +340,7 @@ export default {
             _this.$message.warning('满赠规则条件不能为空!')
             _this.$message.warning('满赠规则条件不能为空!')
             return
             return
           }
           }
-          if (_this.form.restrictFlag && !_this.form.restrictCategory) {
+          if (_this.form.restrictFlag === '1' && !_this.form.restrictCategory) {
             _this.$message.warning('请输入限制正价产品款数个数!')
             _this.$message.warning('请输入限制正价产品款数个数!')
             return
             return
           }
           }
@@ -349,9 +355,15 @@ export default {
           }
           }
 
 
           const form = JSON.parse(JSON.stringify(_this.form))
           const form = JSON.parse(JSON.stringify(_this.form))
+          let rowFlag = null
           if (form.gateFlag == '1') {
           if (form.gateFlag == '1') {
             form.gateProductList = this.$refs.cillProduct.getResultVal()
             form.gateProductList = this.$refs.cillProduct.getResultVal()
             form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
             form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
+            if (form.gateProductList.length == 0) {
+              _this.$message.warning('请添加门槛产品!')
+              return
+            }
+            rowFlag = _this.isJudge(form.gateProductList)
           } else {
           } else {
             form.gateProductList = []
             form.gateProductList = []
             form.gateAmount = ''
             form.gateAmount = ''
@@ -360,10 +372,26 @@ export default {
           }
           }
           if (form.regularPromotionSameFlag == '0') {
           if (form.regularPromotionSameFlag == '0') {
             form.giftProductList = this.$refs.offerProduct.getResultVal()
             form.giftProductList = this.$refs.offerProduct.getResultVal()
+            if (form.giftProductList.length == 0) {
+              _this.$message.warning('请添加促销产品!')
+              return
+            }
+            rowFlag = _this.isJudge(form.giftProductList)
           } else {
           } else {
             form.giftProductList = []
             form.giftProductList = []
           }
           }
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
+          // 判断表格必填
+          if (form.regularProductList.length == 0) {
+            _this.$message.warning('请添加正价产品!')
+            return
+          } else {
+            rowFlag = _this.isJudge(form.regularProductList)
+          }
+          if (rowFlag) {
+            _this.$message.warning('请选择产品分类、品牌或产品!')
+            return
+          }
           form.promotionSn = _this.promotionSn
           form.promotionSn = _this.promotionSn
           _this.spinning = true
           _this.spinning = true
           promotionSave(form).then(res => {
           promotionSave(form).then(res => {
@@ -383,6 +411,17 @@ export default {
         }
         }
       })
       })
     },
     },
+    // 判断品牌,分类,产品其中一个必填
+    isJudge (list) {
+      const flag = list.some(con => {
+        if (con.productThisList && con.productTypeList && con.productBrandList) {
+          return con.productThisList.length == 0 && con.productTypeList.length == 0 && con.productBrandList.length == 0
+        } else {
+          return false
+        }
+      })
+      return flag
+    },
     // 重置表格
     // 重置表格
     resetSearchForm () {
     resetSearchForm () {
       this.form = {
       this.form = {
@@ -395,7 +434,7 @@ export default {
         regularSameFlag: '1', // 满赠规则  不同款商品
         regularSameFlag: '1', // 满赠规则  不同款商品
         regularQty: undefined,
         regularQty: undefined,
         promotionQty: undefined,
         promotionQty: undefined,
-        restrictFlag: undefined, // 限制正价产品款数
+        restrictFlag: '0', // 限制正价产品款数
         restrictCategory: '',
         restrictCategory: '',
         accrualFlag: '1', // 数量叠加
         accrualFlag: '1', // 数量叠加
         minOrderFlag: '0', // 起订金额
         minOrderFlag: '0', // 起订金额

+ 11 - 10
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -1,12 +1,13 @@
 <template>
 <template>
-  <a-drawer
-    title="规则设置"
+  <a-modal
+    centered
     class="promotionList-basicInfo-modal"
     class="promotionList-basicInfo-modal"
-    placement="right"
-    :visible="isShow"
-    @close="isShow=false"
-    width="86%"
-  >
+    :footer="null"
+    :maskClosable="false"
+    title="规则设置"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="86%">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
       <a-form-model
         id="promotionList-basicInfo-form"
         id="promotionList-basicInfo-form"
@@ -43,13 +44,13 @@
               placeholder="请选择"
               placeholder="请选择"
               allowClear></v-select>
               allowClear></v-select>
             <div v-if="form.gateType==='RATIO_AMOUNT'">
             <div v-if="form.gateType==='RATIO_AMOUNT'">
-              购买门槛产品金额 <a-input-number v-model="form.gateAmount" :min="0" :max="100" size="small"/> %作为配额
+              购买门槛产品金额 <a-input-number v-model="form.gateAmount" :min="0" :max="999999" :precision="2" size="small"/> %作为配额
               <a-tooltip title="如:填写100%,则购买10000元门槛产品,可享受10000配额购买正价产品,根据门槛金额动态调整配额">
               <a-tooltip title="如:填写100%,则购买10000元门槛产品,可享受10000配额购买正价产品,根据门槛金额动态调整配额">
                 <a-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
                 <a-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
               </a-tooltip>
               </a-tooltip>
             </div>
             </div>
             <div v-if="form.gateType==='MIN_AMOUNT'">
             <div v-if="form.gateType==='MIN_AMOUNT'">
-              购买门槛产品满最低金额 <a-input-number v-model="form.gateAmount" :min="0" :max="999999" :precision="2" size="small"/> 不限制配额。
+              购买门槛产品满最低金额 <a-input-number v-model="form.gateAmount" :min="0" :max="999999" :precision="2" size="small"/>元,不限制配额。
             </div>
             </div>
             <div class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
             <div class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
               购买满
               购买满
@@ -158,7 +159,7 @@
       @ok="handleProductsOk" />
       @ok="handleProductsOk" />
     <!-- 导入产品 -->
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
     <importGuideModal :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
-  </a-drawer>
+  </a-modal>
 </template>
 </template>
 
 
 <script>
 <script>

+ 19 - 22
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -107,24 +107,21 @@
       </template>
       </template>
       <!-- 设置起订量 -->
       <!-- 设置起订量 -->
       <template slot="setNum" slot-scope="text, record">
       <template slot="setNum" slot-scope="text, record">
-        <div>
-          <v-select
-            v-model="record.unitType"
-            size="small"
-            style="width:55%;"
-            ref="returnReason"
-            code="SCOPE_UNIT_TYPE"
-            placeholder="请选择"
-            allowClear></v-select>
-          <a-input-number
-            size="small"
-            style="margin-left:10px;width:30%;"
-            v-model="record.unitQty"
-            :min="0"
-            :step="1"
-            :precision="0"
-            placeholder="请输入"/>
-        </div>
+        <v-select
+          v-model="record.unitType"
+          size="small"
+          ref="returnReason"
+          code="SCOPE_UNIT_TYPE"
+          placeholder="请选择"
+          allowClear></v-select>
+        <a-input-number
+          size="small"
+          style="margin-top:8px;width:100%;"
+          v-model="record.unitQty"
+          :min="0"
+          :step="1"
+          :precision="0"
+          placeholder="请输入"/>
       </template>
       </template>
       <span slot="action" slot-scope="text,record">
       <span slot="action" slot-scope="text,record">
         <a-button
         <a-button
@@ -182,10 +179,10 @@ export default {
     return {
     return {
       spinning: false,
       spinning: false,
       columns: [
       columns: [
-        { title: '产品分类', width: '24%', scopedSlots: { customRender: 'productType' }, align: 'center' },
-        { title: '品牌', width: '24%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
-        { title: '产品', width: '24%', scopedSlots: { customRender: 'product' }, align: 'center' },
-        { title: '设置起订量', width: '20%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
+        { title: '产品分类', width: '27%', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '品牌', width: '27%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
+        { title: '产品', width: '27%', scopedSlots: { customRender: 'product' }, align: 'center' },
+        { title: '设置起订量', width: '11%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       ],
       dataSource: [],
       dataSource: [],