lilei 3 days ago
parent
commit
475d2c676c

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

@@ -63,6 +63,26 @@
             </a-col>
             </a-col>
           </a-row>
           </a-row>
         </a-form-model-item>
         </a-form-model-item>
+        <a-form-model-item label="最大参与次数" prop="maxCyNumsFlag">
+          <a-select default-value="0" id="promotionList-maxCyNumsFlag" v-model="form.maxCyNumsFlag" style="width: 180px" placeholder="请选择">
+            <a-select-option value="0" id="promotionList-maxCyNumsFlag0">
+              不限
+            </a-select-option>
+            <a-select-option value="1" id="promotionList-maxCyNumsFlag1">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            v-show="form.maxCyNumsFlag && form.maxCyNumsFlag=='1'"
+            style="margin-left:10px;width:300px;"
+            v-model="form.maxCyNums"
+            id="promotionList-maxCyNums"
+            :min="0"
+            :step="1"
+            :max="99999999"
+            :precision="0"
+            placeholder="请输入最大参与次数"/>
+        </a-form-model-item>
         <a-form-model-item label="订单起订金额" prop="minOrderFlag">
         <a-form-model-item label="订单起订金额" prop="minOrderFlag">
           <a-select default-value="0" id="promotionList-minOrderFlag" v-model="form.minOrderFlag" style="width: 180px" placeholder="请选择">
           <a-select default-value="0" id="promotionList-minOrderFlag" v-model="form.minOrderFlag" style="width: 180px" placeholder="请选择">
             <a-select-option value="0" id="promotionList-minOrderFlag0">
             <a-select-option value="0" id="promotionList-minOrderFlag0">
@@ -195,6 +215,8 @@ export default {
         attachmentList: '', // 附件
         attachmentList: '', // 附件
         promotionDealerList: [], // 参与客户
         promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER', // 全部客户   部分客户
         dealerScope: 'SOME_DEALER', // 全部客户   部分客户
+        maxCyNumsFlag: '0',
+        maxCyNums: undefined,
         minOrderFlag: '0', // 订单起订量
         minOrderFlag: '0', // 订单起订量
         minOrderAmount: undefined, // 订单起订金额
         minOrderAmount: undefined, // 订单起订金额
         upperLimitFlag: '0', // 活动经费上限
         upperLimitFlag: '0', // 活动经费上限
@@ -211,6 +233,7 @@ export default {
         expenseDepartmentSn: [{ required: true, message: '请选择费用所属部门', trigger: 'change' }],
         expenseDepartmentSn: [{ required: true, message: '请选择费用所属部门', trigger: 'change' }],
         dealerScope: [{ required: true, message: '请选择参与客户', trigger: 'change' }],
         dealerScope: [{ required: true, message: '请选择参与客户', trigger: 'change' }],
         description: [{ required: true, message: '请输入促销简称', trigger: 'blur' }],
         description: [{ required: true, message: '请输入促销简称', trigger: 'blur' }],
+        maxCyNumsFlag: [{ required: true, message: '请选择最大参与次数', trigger: 'change' }],
         minOrderFlag: [{ required: true, message: '请选择订单起订金额', trigger: 'change' }],
         minOrderFlag: [{ required: true, message: '请选择订单起订金额', trigger: 'change' }],
         upperLimitFlag: [{ required: true, message: '请选择活动经费上限', trigger: 'change' }],
         upperLimitFlag: [{ required: true, message: '请选择活动经费上限', trigger: 'change' }],
         content: [{ required: true, message: '请输入促销描述', trigger: 'blur' }]
         content: [{ required: true, message: '请输入促销描述', trigger: 'blur' }]
@@ -345,6 +368,8 @@ export default {
         attachmentList: '', // 附件
         attachmentList: '', // 附件
         promotionDealerList: [], // 参与客户
         promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER',
         dealerScope: 'SOME_DEALER',
+        maxCyNumsFlag: '0',
+        maxCyNums: undefined,
         minOrderFlag: '0', // 订单起订金额
         minOrderFlag: '0', // 订单起订金额
         minOrderAmount: undefined,
         minOrderAmount: undefined,
         upperLimitFlag: '0', // 活动经费上限
         upperLimitFlag: '0', // 活动经费上限

+ 19 - 8
src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue

@@ -29,7 +29,15 @@
                   <a-input id="lookUpCustomers-purchaseBillNo" v-model="queryParam.dealerName" placeholder="请输入经销商名称" allowClear/>
                   <a-input id="lookUpCustomers-purchaseBillNo" v-model="queryParam.dealerName" placeholder="请输入经销商名称" allowClear/>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
-              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="参与情况">
+                  <a-select id="lookUpCustomers-participationStatus" v-model="queryParam.participationStatus" placeholder="请选择" allowClear>
+                    <a-select-option value="1">未参与</a-select-option>
+                    <a-select-option value="0">已参与</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align: center;">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="lookUpCustomers-refresh">查询</a-button>
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="lookUpCustomers-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="lookUpCustomers-reset">重置</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="lookUpCustomers-reset">重置</a-button>
                 <a-button
                 <a-button
@@ -157,7 +165,8 @@ export default {
         provinceSn: undefined, // 省
         provinceSn: undefined, // 省
         citySn: undefined, // 市
         citySn: undefined, // 市
         districtSn: undefined, // 区
         districtSn: undefined, // 区
-        dealerName: '' // 经销商名称
+        dealerName: '', // 经销商名称
+        participationStatus: undefined // 参与状态
       },
       },
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
@@ -182,13 +191,14 @@ export default {
         })
         })
       },
       },
       columns: [
       columns: [
-        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '地区', scopedSlots: { customRender: 'address' }, width: '20%', align: 'center', ellipsis: true },
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '经销商名称', dataIndex: 'dealerName', scopedSlots: { customRender: 'dealerName' }, width: '20%', align: 'left', ellipsis: true },
+        { title: '活动次数', dataIndex: 'subareaArea.subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '地区', scopedSlots: { customRender: 'address' }, width: '15%', align: 'center', ellipsis: true },
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '经销商名称', dataIndex: 'dealerName', scopedSlots: { customRender: 'dealerName' }, width: '20%', align: 'center', ellipsis: true },
-        { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       ],
       openDealerModal: false, // 修改弹窗
       openDealerModal: false, // 修改弹窗
       updateFlag: false// 是否刷新页面
       updateFlag: false// 是否刷新页面
@@ -256,7 +266,8 @@ export default {
           subareaAreaSn: undefined
           subareaAreaSn: undefined
         },
         },
         dealerName: '',
         dealerName: '',
-        state: undefined
+        state: undefined,
+        participationStatus: undefined
       }, this.snObj)
       }, this.snObj)
       this.updateFlag = false
       this.updateFlag = false
       this.$refs.areaList.clearData()
       this.$refs.areaList.clearData()

+ 2 - 2
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -194,8 +194,8 @@
                 id="promotionList-promotionValue1"
                 id="promotionList-promotionValue1"
                 size="small"/>
                 size="small"/>
               %为促销品采购额
               %为促销品采购额
-              <a-button type="link" id="promotionList-add" v-if="i==0&&fullGiftRuleList&&fullGiftRuleList.length<5" class="button-info" @click="addFullGiftRule">+新增</a-button>
-              <a-button type="link" id="promotionList-del" v-if="i!=0" class="button-error" @click="delFullGiftRule(i)">删除</a-button>
+              <a-button type="link" id="promotionList-add" v-if="i==0&&fullGiftRuleList&&fullGiftRuleList.length<5" class="button-info" @click="addFullGiftRule"><a-icon type="plus"/>新增</a-button>
+              <a-button type="link" :id="'promotionList-del-'+i" v-if="i!=0" class="button-error" @click="delFullGiftRule(i)"><a-icon type="delete" />删除</a-button>
             </div>
             </div>
           </div>
           </div>
         </a-form-model-item>
         </a-form-model-item>

+ 11 - 2
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -153,8 +153,17 @@
                 :max="99999999"
                 :max="99999999"
                 size="small"/>
                 size="small"/>
               个促销产品
               个促销产品
-              <a-button type="link" id="promotionList-add" v-if="i==0&&fullGiftRuleList&&fullGiftRuleList.length<5" class="button-info" @click="addFullGiftRule">+新增</a-button>
-              <a-button type="link" id="promotionList-del" v-if="i!=0" class="button-error" @click="delFullGiftRule(con.id)">删除</a-button>
+              <a-button
+                type="link"
+                id="promotionList-add"
+                v-if="i==0&&fullGiftRuleList&&fullGiftRuleList.length<5"
+                class="button-info"
+                @click="addFullGiftRule">
+                <a-icon type="plus"/>新增
+              </a-button>
+              <a-button type="link" :id="'promotionList-del-'+i" v-if="i!=0" class="button-error" @click="delFullGiftRule(con.id)">
+                <a-icon type="delete" />删除
+              </a-button>
             </div>
             </div>
           </div>
           </div>
           <div class="ruleDescList">
           <div class="ruleDescList">

+ 54 - 12
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -138,15 +138,13 @@
           </a-select>
           </a-select>
           <a-table
           <a-table
             v-show="form.discountType!=0"
             v-show="form.discountType!=0"
-            class="sTable"
             ref="setTable"
             ref="setTable"
-            size="small"
             :rowKey="(record) => record.id"
             :rowKey="(record) => record.id"
             :columns="setColumns"
             :columns="setColumns"
             :dataSource="setTableData"
             :dataSource="setTableData"
             :pagination="false"
             :pagination="false"
             style="width:60%;"
             style="width:60%;"
-            bordered>
+          >
             <template slot="provinceDiscount" slot-scope="text, record">
             <template slot="provinceDiscount" slot-scope="text, record">
               <a-input-number
               <a-input-number
                 size="small"
                 size="small"
@@ -216,6 +214,20 @@
                 placeholder="请输入"
                 placeholder="请输入"
                 @blur="handleSpecialPrice"/>
                 @blur="handleSpecialPrice"/>
             </template>
             </template>
+            <template slot="orginAmount" slot-scope="text, record">
+              <a-input-number
+                size="small"
+                :id="'promotionList-orginAmountValue'+record.id"
+                v-model="record.orginAmountValue"
+                :min="0"
+                :precision="2"
+                :max="99999999"
+                placeholder="请输入"/>
+            </template>
+            <template slot="actions" slot-scope="text, record, index">
+              <a-button v-if="index==0" size="small" type="link" class="button-info" @click="addTableData"><a-icon type="plus"/>新增</a-button>
+              <a-button v-else size="small" type="link" @click="delTableData(record,index)"><a-icon type="delete"/>删除</a-button>
+            </template>
           </a-table>
           </a-table>
         </a-form-model-item>
         </a-form-model-item>
         <a-form-model-item label="规则叠加" v-if="form.discountType!=0">
         <a-form-model-item label="规则叠加" v-if="form.discountType!=0">
@@ -361,15 +373,17 @@ export default {
       var arr = []
       var arr = []
       if (_this.form.discountType === '1') {
       if (_this.form.discountType === '1') {
         arr = [
         arr = [
-          { title: '省价折扣', scopedSlots: { customRender: 'provinceDiscount' }, width: '33%', align: 'center' },
-          { title: '市价折扣', scopedSlots: { customRender: 'cityDiscount' }, width: '33%', align: 'center' },
-          { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' }, width: '33%', align: 'center' }
+          { title: '特价产品原价金额', scopedSlots: { customRender: 'orginAmount' }, width: '30%', align: 'left' },
+          { title: '省价折扣', scopedSlots: { customRender: 'provinceDiscount' }, width: '20%', align: 'left' },
+          { title: '市价折扣', scopedSlots: { customRender: 'cityDiscount' }, width: '20%', align: 'left' },
+          { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' }, width: '20%', align: 'left' },
+          { title: '', scopedSlots: { customRender: 'actions' }, width: '10%', align: 'center' }
         ]
         ]
       } else if (_this.form.discountType === '2') {
       } else if (_this.form.discountType === '2') {
         arr = [
         arr = [
-          { title: '省价直降', scopedSlots: { customRender: 'provincePrice' }, width: '33%', align: 'center' },
-          { title: '市价直降', scopedSlots: { customRender: 'cityPrice' }, width: '33%', align: 'center' },
-          { title: '特约直降', scopedSlots: { customRender: 'specialPrice' }, width: '33%', align: 'center' }
+          { title: '省价直降', scopedSlots: { customRender: 'provincePrice' }, width: '33%', align: 'left' },
+          { title: '市价直降', scopedSlots: { customRender: 'cityPrice' }, width: '33%', align: 'left' },
+          { title: '特约直降', scopedSlots: { customRender: 'specialPrice' }, width: '33%', align: 'left' }
         ]
         ]
       }
       }
       return arr
       return arr
@@ -398,6 +412,7 @@ export default {
       this.form.discountType = val
       this.form.discountType = val
       this.$refs.specialProduct.reSetTableData()
       this.$refs.specialProduct.reSetTableData()
       this.setTableData = [{
       this.setTableData = [{
+        orginAmountValue: 0,
         provinceValue: undefined,
         provinceValue: undefined,
         cityValue: undefined,
         cityValue: undefined,
         specialValue: undefined
         specialValue: undefined
@@ -435,6 +450,24 @@ export default {
       this.form.gateValue = undefined
       this.form.gateValue = undefined
       this.form.quotaAmount = undefined
       this.form.quotaAmount = undefined
     },
     },
+    // 新增特价规则阶梯
+    addTableData () {
+      const len = this.setTableData.length
+      if (len >= 5) {
+        this.$message.warning('最多只能添加5条!')
+        return
+      }
+      this.setTableData.push({
+        orginAmountValue: 0,
+        provinceValue: undefined,
+        cityValue: undefined,
+        specialValue: undefined
+      })
+    },
+    // 删除特价规则阶梯
+    delTableData (row, index) {
+      this.setTableData.splice(index, 1)
+    },
     //  保存
     //  保存
     handleSave () {
     handleSave () {
       const _this = this
       const _this = this
@@ -452,9 +485,16 @@ export default {
             }
             }
           }
           }
           // 验证特价规则条件必填
           // 验证特价规则条件必填
+          console.log(_this.setTableData)
           if (_this.form.discountType != '0' && _this.setTableData) {
           if (_this.form.discountType != '0' && _this.setTableData) {
-            if (_this.setTableData[0].provinceValue == undefined || _this.setTableData[0].cityValue == undefined || _this.setTableData[0].specialValue == undefined) {
-              _this.$message.warning('特价规则条件不能为空!')
+            const hasTemp = _this.setTableData.some(item => {
+              if (_this.form.discountType == '2' || _this.setTableData.length == 1) {
+                return item.provinceValue == undefined || item.cityValue == undefined || item.specialValue == undefined
+              }
+              return item.orginAmountValue == 0 || item.provinceValue == undefined || item.cityValue == undefined || item.specialValue == undefined
+            })
+            if (hasTemp) {
+              _this.$message.warning(_this.form.discountType == '2' || _this.setTableData.length == 1 ? '特价规则条件不能为空!' : '特价规则条件不能为空且原价金额必需大于0!')
               return
               return
             }
             }
           }
           }
@@ -484,7 +524,7 @@ export default {
           if (_this.isJudge(form.specialProductList, '特价')) {
           if (_this.isJudge(form.specialProductList, '特价')) {
             return
             return
           }
           }
-          // 手动输入必填项
+          // 校验产品折扣手动输入必填项
           if (form.discountType === '0') {
           if (form.discountType === '0') {
             const isCountEmpty = _this.isNumEmpty(form.specialProductList)
             const isCountEmpty = _this.isNumEmpty(form.specialProductList)
             if (isCountEmpty.flag) {
             if (isCountEmpty.flag) {
@@ -502,6 +542,7 @@ export default {
           }
           }
           // 组后端所需数据
           // 组后端所需数据
           form.promotionSn = _this.promotionSn
           form.promotionSn = _this.promotionSn
+          // 门槛描述
           if (form.gateFlag == '1') {
           if (form.gateFlag == '1') {
             if (form.gateType === 'RATIO_AMOUNT') {
             if (form.gateType === 'RATIO_AMOUNT') {
               form.gateInfo = '购买门槛产品金额' + (form.gateValue * 100).toFixed(2) + '%作为配额'
               form.gateInfo = '购买门槛产品金额' + (form.gateValue * 100).toFixed(2) + '%作为配额'
@@ -511,6 +552,7 @@ export default {
               form.gateInfo = '购买每满' + (form.gateUnit == 'YUAN' ? (form.gateValue).toFixed(2) : form.gateValue) + (form.gateUnit == 'YUAN' ? '元' : '个') + '门槛产品,可采购' + form.quotaAmount + '个特价产品(配额算销售额)'
               form.gateInfo = '购买每满' + (form.gateUnit == 'YUAN' ? (form.gateValue).toFixed(2) : form.gateValue) + (form.gateUnit == 'YUAN' ? '元' : '个') + '门槛产品,可采购' + form.quotaAmount + '个特价产品(配额算销售额)'
             }
             }
           }
           }
+          // 规则描述
           let infoDetail = `<div>${form.stackFlag == '1' ? '规则叠加;' : ''}</div>`
           let infoDetail = `<div>${form.stackFlag == '1' ? '规则叠加;' : ''}</div>`
           if (form.discountType == '0') {
           if (form.discountType == '0') {
             infoDetail += '手动输入特价'
             infoDetail += '手动输入特价'

+ 27 - 3
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -137,8 +137,13 @@ export default {
         { value: 'BUY_PROD_GIVE_MONEY', label: '卖产品送采购额', selected: true },
         { value: 'BUY_PROD_GIVE_MONEY', label: '卖产品送采购额', selected: true },
         { value: 'PROMO_PROD', label: '特价活动', selected: true }
         { value: 'PROMO_PROD', label: '特价活动', selected: true }
       ],
       ],
+      ruleEnableList: [
+        { value: '1', label: '启用', selected: true },
+        { value: '0', label: '禁用', selected: true }
+      ],
       searchData: {
       searchData: {
-        ruleType: []
+        ruleType: [],
+        enable: []
       },
       },
       // 表格列表
       // 表格列表
       tableData: [],
       tableData: [],
@@ -426,6 +431,25 @@ export default {
                 <a-switch checked-children="启" un-checked-children="禁" checked={row.enabledFlag == 1} on-change={(c, e) => this.enableRow(c, e, row)}/>
                 <a-switch checked-children="启" un-checked-children="禁" checked={row.enabledFlag == 1} on-change={(c, e) => this.enableRow(c, e, row)}/>
               </div>
               </div>
             )
             )
+          },
+          // 筛选项
+          filter: {
+            filterList: _this.ruleEnableList,
+            isMultiple: true,
+            // filter confirm
+            filterConfirm: (filterList) => {
+              const labels = filterList
+                .filter((x) => x.selected)
+                .map((x) => x.value)
+              _this.searchData.enable = labels
+              _this.filtrateList()
+            },
+            // filter reset
+            filterReset: (filterList) => {
+              filterList.map(x => { x.selected = true })
+              _this.searchData.enable = []
+              _this.filtrateList()
+            }
           }
           }
         })
         })
         cols.push({
         cols.push({
@@ -502,8 +526,8 @@ export default {
   methods: {
   methods: {
     // 筛选
     // 筛选
     filtrateList () {
     filtrateList () {
-      const { ruleType } = this.searchData
-      const list = this.activeList.filter(item => ruleType.length === 0 || ruleType.includes(item.promotionRule.promotionRuleType))
+      const { ruleType, enable } = this.searchData
+      const list = this.activeList.filter(item => ruleType.length === 0 || ruleType.includes(item.promotionRule.promotionRuleType)).filter(item => enable.length == 0 || enable.includes(item.enabledFlag))
       this.tableData = []
       this.tableData = []
       this.getDataList(list)
       this.getDataList(list)
     },
     },

+ 7 - 2
src/views/salesManagement/salesQueryNew/edit.vue

@@ -59,11 +59,15 @@
       >
       >
         <div slot="title">
         <div slot="title">
           <div style="display: flex;justify-content: space-between;align-items: center;">
           <div style="display: flex;justify-content: space-between;align-items: center;">
-            <span>活动产品</span>
-            <a-button size="small" @click="getActiveList(false)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
+            <strong>活动产品</strong>
+            <div>
+              <a-button size="small" @click="showActiveList=!showActiveList" type="link" class="button-info"><a-icon :type="showActiveList?'up':'down'"/> {{ showActiveList?'收起':'展开' }}活动</a-button>
+              <a-button size="small" @click="getActiveList(false)" type="link" class="button-info"><a-icon type="reload"/> 刷新</a-button>
+            </div>
           </div>
           </div>
         </div>
         </div>
         <activeStatisticsList
         <activeStatisticsList
+          v-show="showActiveList"
           ref="activeTjList"
           ref="activeTjList"
           @openCpModal="openProductModal"
           @openCpModal="openProductModal"
           @refash="refashTableData"
           @refash="refashTableData"
@@ -212,6 +216,7 @@ export default {
       spinning: false,
       spinning: false,
       activeList: [], // 活动列表
       activeList: [], // 活动列表
       newActiveList: [], // 新活动列表
       newActiveList: [], // 新活动列表
+      showActiveList: true,
       salesBillSn: null, // 销售单sn
       salesBillSn: null, // 销售单sn
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       warehouseSn: undefined, // 仓库sn
       warehouseSn: undefined, // 仓库sn