瀏覽代碼

修改bug

chenrui 1 年之前
父節點
當前提交
0b4710a8f7

+ 5 - 5
src/views/promotionRulesManagement/dealerPromotions/chooseImportModal.vue

@@ -43,7 +43,7 @@
         <template slot="unitTypeShow" slot-scope="text,record">
           {{ record.unitType==='SL'?'按数量设置':'按整箱设置' }}
         </template>
-        <template slot="errorMsg" slot-scope="text,record">
+       <!-- <template slot="errorMsg" slot-scope="text,record">
           <a-popover placement="topRight">
             <template slot="content">
               <p v-for="d in record.importErrorMsgSet">{{ d }}</p>
@@ -52,7 +52,7 @@
               查看
             </a-button>
           </a-popover>
-        </template>
+        </template> -->
       </a-table>
       <!-- 按钮 -->
       <div class="btn-con">
@@ -135,10 +135,10 @@ export default {
       const unColumnsArr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '起订类型', scopedSlots: { customRender: 'unitTypeShow' }, dataIndex: 'unitType', width: '15%', align: 'center' },
+        { title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '起订类型', scopedSlots: { customRender: 'unitTypeShow' }, dataIndex: 'unitType', width: '10%', align: 'center' },
         { title: '起订数量', dataIndex: 'unitQty', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
-        { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '20%', align: 'center' }
+        { title: '错误说明',dataIndex: 'importErrorMsgSet', width: '30%', align: 'center', customRender: function (text) { return text || '--' },ellipsis: true }
       ]
       if (_this.goodsFlag == '0' && _this.discountType == '0') {
         unColumnsArr.splice(3, 0, { title: '省级特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return text || '--' } },

+ 10 - 6
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -86,19 +86,23 @@
               <div v-if="record.restrictFlag==='1'">限制正价产品{{ record.restrictCategory }}款</div>
             </div>
             <div v-else-if="record.promotionRuleType == 'BUY_PROD_GIVE_MONEY'">
-              <div v-if="record.giveRuleType==='SUM_MONEY'">金额叠加;购买满{{ record.giveRuleList[0].regularValue }}{{ record.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ record.giveRuleList[0].promotionValue }}元<span v-if="record.giveRuleList[0].regularUnit==='YUAN'">({{ record.giveRuleList[0].regularValue!=0?(record.giveRuleList[0].promotionValue/record.giveRuleList[0].regularValue).toFixed(2)*100:0 }}%促销品采购额)</span><span v-else>(促销品采购额)</span></div>
-              <div v-if="record.giveRuleType==='RATIO' &&record.giveRuleList && record.giveRuleList.length>0 ">
-                <span>按比例;</span>
-                <div v-for="item in record.giveRuleList" :key="item.scopeLevel">
-                  {{ record.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue }}%为促销品采购额
+              <div v-if="record.giveRuleList&&record.giveRuleList.length>0">
+                <div v-if="record.giveRuleType==='SUM_MONEY'">金额叠加;购买满{{ record.giveRuleList[0].regularValue }}{{ record.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ record.giveRuleList[0].promotionValue }}元<span v-if="record.giveRuleList[0].regularUnit==='YUAN'">({{ record.giveRuleList[0].regularValue!=0?(record.giveRuleList[0].promotionValue/record.giveRuleList[0].regularValue).toFixed(2)*100:0 }}%促销品采购额)</span><span v-else>(促销品采购额)</span></div>
+                <div v-if="record.giveRuleType==='RATIO' &&record.giveRuleList && record.giveRuleList.length>0 ">
+                  <span>按比例;</span>
+                  <div v-for="item in record.giveRuleList" :key="item.scopeLevel">
+                    {{ record.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue }}%为促销品采购额
+                  </div>
                 </div>
               </div>
+              <span v-else>--</span>
             </div>
-            <div v-else>
+            <div v-else-if="record.promotionRuleType == 'PROMO_PROD'">
               <span v-if="record.discountType ==='0'">手动输入特价</span>
               <span v-else-if="record.discountType ==='1'">各级别价打折;省级折扣{{ record.provinceValue }}%,市级折扣{{ record.cityValue }}%,特约折扣{{ record.specialValue }}%</span>
               <span v-else>各级别价直降;省级直降{{ record.provinceValue }},市级直降{{ record.cityValue }},特约直降{{ record.specialValue }}</span>
             </div>
+            <div v-else>--</div>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">

+ 69 - 51
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -15,6 +15,9 @@
         :model="form"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="规则简称" v-if="form.description">
+          {{ form.description }}
+        </a-form-model-item>
         <a-form-model-item label="规则门槛" v-if="form.gateFlag">
           {{ form.gateFlag==='1'?'有':'无' }}
           <div v-if="form.gateFlag==='1'">
@@ -24,22 +27,24 @@
             <span v-if="form.gateType==='FIXED_AMOUNT'&&form.promotionRuleType ==='PROMO_PROD'">购买每满 {{ form.gateValue }} {{ form.regularUnit==='YUAN'?'元':'个' }}门槛产品,可采购 {{ form.quotaAmount }} 个特价产品(配额算销售额)</span>
           </div>
         </a-form-model-item>
-        <a-form-model-item label="规则简称" v-if="form.description">
-          {{ form.description }}
-        </a-form-model-item>
         <!-- 买产品送产品 -->
-        <a-form-model-item label="满赠规则" prop="regularSameFlag" v-if="form.promotionRuleType ==='BUY_PROD_GIVE_PROD'&&form.giveRuleList&&form.giveRuleList.length>0">
-          <div v-for="item in form.giveRuleList" :key="item.scopeLevel">{{ form.giveRuleList.length>1?item.scopeLevel+'、' :'' }}{{ item.regularSameFlag==='1'?'同款':'不同款' }}产品购买满 {{ item.regularValue }} {{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送 {{ item.promotionValue }} 个促销产品</div>
-          <div v-if="form.restrictFlag&&form.restrictFlag==1">限制正价产品{{ form.restrictCategory }}款 </div>
-          <div v-if="form.convertExpenseFlag&&form.convertExpenseFlag==1">可转费用报销单</div>
+        <a-form-model-item label="满赠规则" prop="regularSameFlag" v-if="form.promotionRuleType ==='BUY_PROD_GIVE_PROD'">
+          <div v-if="form.giveRuleList&&form.giveRuleList.length>0">
+            <div v-for="item in form.giveRuleList" :key="item.scopeLevel">{{ form.giveRuleList.length>1?item.scopeLevel+'、' :'' }}{{ item.regularSameFlag==='1'?'同款':'不同款' }}产品购买满 {{ item.regularValue }} {{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送 {{ item.promotionValue }} 个促销产品</div>
+            <div v-if="form.restrictFlag&&form.restrictFlag==1">限制正价产品{{ form.restrictCategory }}款 </div>
+            <div v-if="form.convertExpenseFlag&&form.convertExpenseFlag==1">可转费用报销单</div>
+          </div>
+          <span v-else>--</span>
         </a-form-model-item>
         <!-- 买产品送采购额 -->
         <a-form-model-item label="满赠规则" prop="regularSameFlag" v-if="form.promotionRuleType ==='BUY_PROD_GIVE_MONEY'">
           <div>{{ form.giveRuleType==='SUM_MONEY'?'金额叠加':'按比例' }}</div>
-          <div v-if="form.giveRuleType==='SUM_MONEY'">购买满{{ form.giveRuleList[0].regularValue }}{{ form.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ form.giveRuleList[0].promotionValue }}元<span v-if="form.giveRuleList[0].regularUnit==='YUAN'">({{ perCentNum }}%促销品采购额)</span></div>
-          <div v-if="form.giveRuleType==='RATIO' &&form.giveRuleList && form.giveRuleList.length>0 ">
-            <div v-for="item in form.giveRuleList" :key="item.scopeLevel">
-              {{ form.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue }}%为促销品采购额
+          <div v-if="form.giveRuleList&&form.giveRuleList.length>0">
+            <div v-if="form.giveRuleType==='SUM_MONEY'">购买满{{ form.giveRuleList[0].regularValue }}{{ form.giveRuleList[0].regularUnit==='YUAN'?'元':'个' }}正价产品,送{{ form.giveRuleList[0].promotionValue }}元<span v-if="form.giveRuleList[0].regularUnit==='YUAN'">({{ perCentNum }}%促销品采购额)</span></div>
+            <div v-if="form.giveRuleType==='RATIO' &&form.giveRuleList && form.giveRuleList.length>0 ">
+              <div v-for="item in form.giveRuleList" :key="item.scopeLevel">
+                {{ form.giveRuleList.length>1?item.scopeLevel+'、' :'' }}产品购买满{{ item.regularValue }}{{ item.regularUnit==='YUAN'?'元':'个' }}正价产品,送正价产品总金额的{{ item.promotionValue }}%为促销品采购额
+              </div>
             </div>
           </div>
         </a-form-model-item>
@@ -128,43 +133,45 @@
           </a-table>
         </div>
         <!-- 买产品送产品列表 -->
-        <div v-for="(con,k) in form.giveRuleList" :key="k" v-show="chooseVal==('c'+k)">
-          <a-table
-            class="sTable"
-            style="margin-top:10px;max-height:340px;"
-            ref="table"
-            size="small"
-            :rowKey="(record) => record.id"
-            :columns="columns"
-            :data-source="form.giftProductMap['GIFT'+(k*1+1)]"
-            :scroll="{ y: 330 }"
-            :pagination="false"
-            bordered
-          >
-            <!-- 产品分类 -->
-            <template slot="productType" slot-scope="text, record">
-              <div class="tabBox" 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>
-              </div>
-            </template>
-            <!-- 品牌 -->
-            <template slot="productBrand" slot-scope="text, record">
-              <div class="tabBox" v-if="record.productBrandList && record.productBrandList.length>0">
-                <a-tag style="margin-bottom:5px;" v-for="item in record.productBrandList" :key="item.id">{{ item.productBrandName }}</a-tag>
-              </div>
-            </template>
-            <!-- 产品 -->
-            <template slot="product" slot-scope="text, record">
-              <div class="tabBox" v-if="record.productThisList && record.productThisList.length>0">
-                <a-tag style="margin-bottom:5px;" v-for="item in record.productThisList" :key="item.id">{{ item.productCode }}</a-tag>
-              </div>
-            </template>
-            <!-- 设置起订量 -->
-            <template slot="setNum" slot-scope="text, record">
-              <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>
-          </a-table>
+        <div v-if="form.giftProductMap && form.giveRuleList&& form.giveRuleList.length>0">
+          <div v-for="(con,k) in form.giveRuleList" :key="k" v-show="chooseVal==('c'+k)">
+            <a-table
+              class="sTable"
+              style="margin-top:10px;max-height:340px;"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns"
+              :data-source="form.giftProductMap['GIFT'+(k*1+1)]"
+              :scroll="{ y: 330 }"
+              :pagination="false"
+              bordered
+            >
+              <!-- 产品分类 -->
+              <template slot="productType" slot-scope="text, record">
+                <div class="tabBox" 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>
+                </div>
+              </template>
+              <!-- 品牌 -->
+              <template slot="productBrand" slot-scope="text, record">
+                <div class="tabBox" v-if="record.productBrandList && record.productBrandList.length>0">
+                  <a-tag style="margin-bottom:5px;" v-for="item in record.productBrandList" :key="item.id">{{ item.productBrandName }}</a-tag>
+                </div>
+              </template>
+              <!-- 产品 -->
+              <template slot="product" slot-scope="text, record">
+                <div class="tabBox" v-if="record.productThisList && record.productThisList.length>0">
+                  <a-tag style="margin-bottom:5px;" v-for="item in record.productThisList" :key="item.id">{{ item.productCode }}</a-tag>
+                </div>
+              </template>
+              <!-- 设置起订量 -->
+              <template slot="setNum" slot-scope="text, record">
+                <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>
+            </a-table>
+          </div>
         </div>
         <!-- 特价产品 -->
         <div v-show="chooseVal=='d'">
@@ -339,10 +346,21 @@ export default {
       getRuleDetail({ sn: this.itemSn }).then(res => {
         if (res.status == 200) {
           const resultObj = res.data
-          if (resultObj.giveRuleList && resultObj.giveRuleList.length > 0) {
-            this.chooseVal = 'c0'
+          if (resultObj.gateFlag == '1') {
+            this.chooseVal = 'a'
           } else {
-            this.chooseVal = resultObj.gateFlag == '1' ? 'a' : resultObj.promotionRuleType == 'PROMO_PROD' ? 'd' : 'b'
+            if (resultObj.promotionRuleType == 'BUY_PROD_GIVE_PROD') {
+              this.chooseVal = 'b'
+            } else if (resultObj.promotionRuleType == 'BUY_PROD_GIVE_MONEY') {
+              this.chooseVal = 'b'
+            } else {
+              this.chooseVal = 'd'
+            }
+            // if (resultObj.giveRuleList && resultObj.giveRuleList.length > 0) {
+            //   this.chooseVal = 'c0'
+            // } else {
+            //   this.chooseVal = resultObj.promotionRuleType == 'PROMO_PROD' ? 'd' : 'b'
+            // }
           }
           this.form = { ...this.form, ...resultObj }
           this.setTableData = [{

+ 3 - 1
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -577,7 +577,9 @@ export default {
             resultObj.regularProductList = _this.newData(resultObj.regularProductList)
             _this.$refs.normalPriceProduct.setTabVal(resultObj.regularProductList)
           }
-          _this.form = { ..._this.form, ...resultObj }
+          const newDataObj = { ..._this.form, ...resultObj }
+          delete newDataObj.giftProductList
+          _this.form = newDataObj
         }
       })
     },

+ 17 - 13
src/views/reportData/promotionSalesRealTimeReport/index.vue

@@ -83,10 +83,10 @@
                     <a-col :md="6" :sm="24">
                       <a-form-model-item label="采购额">
                         <v-select
-                          v-model="queryParam.buyerLevel"
-                          ref="buyerLevel"
-                          id="promotionSalesRealTimeReport-buyerLevel"
-                          code="DEALER_LEVEL"
+                          v-model="queryParam.giveMoney"
+                          ref="giveMoney"
+                          id="promotionSalesRealTimeReport-giveMoney"
+                          code="GIVE_MONEY"
                           placeholder="请选择采购额"
                           allowClear></v-select>
                       </a-form-model-item>
@@ -135,11 +135,10 @@
                 <span>{{ record.promotion.promotionDateStart }}-{{ record.promotion.promotionDateEnd }}</span>
               </template>
               <!-- 规则 -->
-              <!-- <template slot="promotionDesc" slot-scope="text, record">
-              <span v-if="record.promotionRule.promotionRuleType=='PROMO_PROD'">{{ record.promotionRule.promotionRuleTypeDictValue }}</span>
-              <span v-else-if="record.promotionRule.promotionRuleType=='RATIO_AMOUNT'">{{ record.promotionRule.regularSameFlag==1?'同款':'不同款' }}产品购买满{{ record.promotionRule.regularQty }}个正价产品,送{{ record.promotionQty }}个促销产品</span>
-              <span v-else>购买满{{ record.promotionRule.regularAmount }}元正价产品,送{{ record.promotionRule.giveAmount }}元促销品采购额{{ record.promotionRule.accrualFlag&&record.promotionRule.accrualFlag==1?'(金额叠加)':'(金额不叠加)' }}</span>
-            </template> -->
+              <template slot="promotionDesc" slot-scope="text, record">
+                <div v-if="record.ruleInfo" v-html="record.ruleInfo"></div>
+                <span v-else>--</span>
+              </template>
               <!-- 地区 -->
               <template slot="addressInfo" slot-scope="text, record">
                 <span>{{ record.provinceName }}{{ record.cityName?'/'+record.cityName:'' }}{{ record.districtName?'/'+record.districtName :'' }}</span>
@@ -157,6 +156,8 @@
                       <a-col span="4">损失费用:{{ (totalData && (totalData.lossAmount || totalData.lossAmount==0)) ? toThousands(totalData.lossAmount) : '--' }}</a-col>
                       <a-col span="4">采购额结余:{{ (totalData && (totalData.surplusPromoGiftsAmount || totalData.surplusPromoGiftsAmount==0)) ? toThousands(totalData.surplusPromoGiftsAmount) : '--' }}</a-col>
                       <a-col span="4">采购额超出:{{ (totalData && (totalData.outPromoGiftsAmount || totalData.outPromoGiftsAmount==0)) ? toThousands(totalData.outPromoGiftsAmount) : '--' }}</a-col>
+                      <a-col span="4">转采购额数量:{{ (totalData && (totalData.convertPromoGiftsQty || totalData.convertPromoGiftsQty==0)) ? totalData.convertPromoGiftsQty : '--' }}</a-col>
+                      <a-col span="4">转采购额金额:{{ (totalData && (totalData.convertPromoGiftsAmount || totalData.convertPromoGiftsAmount==0)) ? toThousands(totalData.convertPromoGiftsAmount) : '--' }}</a-col>
                     </a-row>
                   </a-col>
                 </a-row>
@@ -219,7 +220,8 @@ export default {
         },
         dealerProvinceSn: undefined, // 省份编码
         dealerCitySn: undefined, // 城市编码
-        dealerDistrictSn: undefined // 区域编码
+        dealerDistrictSn: undefined, // 区域编码
+        giveMoney: undefined
       },
       rules: {
         salesDate: [{ required: true, message: '请选择销售审核时间', trigger: 'change' }]
@@ -236,7 +238,7 @@ export default {
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '130px', align: 'center', fixed: 'left' },
         { title: '费用所属部门', dataIndex: 'departmentName', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
         { title: '促销类型', dataIndex: 'promotionRule.promotionRuleTypeDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '规则', dataIndex: 'promotionRule.ruleInfo', width: '180px', align: 'left', customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '规则', dataIndex: 'promotionRule.ruleInfo', width: '180px', align: 'left', scopedSlots: { customRender: 'promotionDesc' }, fixed: 'left' },
         { title: '销售单号', dataIndex: 'salesBillNo', width: '120px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
@@ -251,7 +253,8 @@ export default {
         { title: '成本金额', dataIndex: 'totalRealCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '损失成本', dataIndex: 'lossCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '损失费用', dataIndex: 'lossAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '促销产品转采购额', dataIndex: 'lossAmount1', width: '130px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: <a-tooltip placement='top' title='即在下推时促销产品已转采购额的数量'>转采购额数量&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'convertPromoGiftsQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: <a-tooltip placement='top' title='即促销产品转采购额金额,促销产品转采购额数量*销售价'>转采购额金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'convertPromoGiftsAmount', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '采购额结余', dataIndex: 'surplusPromoGiftsAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '采购额超出', dataIndex: 'outPromoGiftsAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '促销品费用归属品牌', dataIndex: 'promoProductBrandName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
@@ -396,7 +399,8 @@ export default {
         },
         dealerProvinceSn: undefined, // 省份编码
         dealerCitySn: undefined, // 城市编码
-        dealerDistrictSn: undefined // 区域编码
+        dealerDistrictSn: undefined, // 区域编码
+        giveMoney: undefined
       }
       this.time = undefined
       this.$refs.subarea.clearData()