Browse Source

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

lilei 1 year ago
parent
commit
6a5d002741

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


+ 14 - 11
src/api/promotion.js

@@ -127,20 +127,23 @@ export const promotionIsOver = (params) => {
   })
 }
 
-// 导入门槛、正价、促销产品
-export const importNormalProduct = params => {
-  return axios({
-    url: '/promotion/importNormalProduct',
+// 导出门槛产品错误项
+export const downNormalFail = (params) => {
+  const url = `/promotion/downNormalFail`
+  return axios.request({
+    url: url,
+    method: 'post',
     data: params,
-    method: 'post'
+    responseType: 'blob'
   })
 }
-
-// 导入特价产品
-export const importSpecialProduct = params => {
-  return axios({
-    url: '/promotion/importSpecialProduct ',
+// 导出促销产品错误项
+export const downSpecialFail = (params) => {
+  const url = `/promotion/downSpecialFail`
+  return axios.request({
+    url: url,
+    method: 'post',
     data: params,
-    method: 'post'
+    responseType: 'blob'
   })
 }

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

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

+ 25 - 10
src/views/promotionRulesManagement/dealerPromotions/chooseImportModal.vue

@@ -54,7 +54,7 @@
           type="primary"
           id="chooseImport-submit"
           size="large"
-          :class="unLoadData.length?'button-grey':'button-primary'"
+          class="button-primary"
           @click="handleSubmit"
           style="padding: 0 40px;">确认导入</a-button>
         <a-button
@@ -63,13 +63,13 @@
           class="button-cancel"
           @click="isShow=false"
           style="padding: 0 40px;margin-left: 15px;">取消</a-button>
-        <!-- <a-button
+        <a-button
           type="primary"
           id="chooseImport-error"
           size="large"
           class="button-error"
           @click="handleError"
-          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button> -->
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
       </div>
     </div>
   </a-modal>
@@ -77,6 +77,8 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { downNormalFail, downSpecialFail } from '@/api/promotion'
 export default {
   name: 'ChooseImportModal',
   mixins: [commonMixin],
@@ -111,8 +113,8 @@ export default {
       ]
       if (_this.goodsFlag == '0') {
         const arr = [
-          { title: '省特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-          { title: '市特价', dataIndex: 'cityDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '省特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '市特价', dataIndex: 'cityDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
           { title: '特约特价', dataIndex: 'specialDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
         ]
         columnsArr = columnsArr.concat(arr)
@@ -121,15 +123,15 @@ export default {
     },
     nowUnColumns () {
       const _this = this
-      let unColumnsArr = [
+      const unColumnsArr = [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'product.name', width: '50%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '20%', align: 'center' }
       ]
       if (_this.goodsFlag == '0') {
-        unColumnsArr.splice(3,0,{ title: '省价特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-          { title: '市特价', dataIndex: 'cityDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        unColumnsArr.splice(3, 0, { title: '省级特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '市特价', dataIndex: 'cityDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
           { title: '特约特价', dataIndex: 'specialDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return unColumnsArr
@@ -153,13 +155,26 @@ export default {
     },
     // 确认导入
     handleSubmit () {
-      if (this.unLoadData.length) {
-        this.$message.warning('有错误数据不可导入,请修改正确后再试!')
+      if (this.loadData.length == 0) {
+        this.$message.warning('没有可导入的数据!')
       } else {
         const data = this.paramsData.rightList
         this.$emit('ok', data)
         this.isShow = false
       }
+    },
+    // 导出错误项
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出的错误项~')
+        return
+      }
+      _this.spinning = true
+      const ajaxName = _this.goodsFlag == '0' ? downSpecialFail : downNormalFail
+      hdExportExcel(ajaxName, _this.unLoadData, '导出产品错误项', function () {
+        _this.spinning = false
+      })
     }
   },
   watch: {

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

@@ -1,12 +1,13 @@
 <template>
-  <a-drawer
-    title="选择产品"
+  <a-modal
+    centered
     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...">
       <div class="products-con">
         <div>
@@ -77,16 +78,15 @@
             <!-- 包装数 -->
             <template slot="productQty" slot-scope="text, record">
               <span v-if="record.packQty">
-                {{ record.packQty }}{{ record.packQtyUnit }}{{ '/'+record.unit }}
+                {{ record.packQty }}{{ record.unit }}{{ '/'+record.packQtyUnit }}
               </span>
               <span v-else>--</span>
             </template>
-
           </s-table>
         </div>
       </div>
     </a-spin>
-  </a-drawer>
+  </a-modal>
 </template>
 
 <script>
@@ -218,7 +218,6 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.resetSearchForm()
       } else {
         const _this = this
         _this.resetSearchForm()

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

@@ -7,7 +7,7 @@
     title="详情"
     v-model="isShow"
     @cancel="isShow=false"
-    width="70%">
+    width="80%">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
         id="dealerPromotions-basicInfo-form"
@@ -52,7 +52,7 @@
             </a-tooltip>
             活动经费上限
           </span>
-          {{ form.upperLimitFlag === '1'?'限制':'不限制' }}{{ form.upperLimitAmount?form.upperLimitAmount+'元' :''}}
+          {{ form.upperLimitFlag === '1'?'限制':'不限制' }}{{ form.upperLimitAmount?form.upperLimitAmount+'元' :'' }}
         </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>
@@ -76,20 +76,20 @@
         <div v-show="chooseVal!='d'">
           <a-table
             class="sTable"
-            style="margin-top:10px;max-height:280px;"
+            style="margin-top:10px;max-height:340px;"
             ref="table"
             size="small"
             :rowKey="(record) => record.productScopeSn"
             :columns="columns"
             :data-source="chooseVal==='a'?form.gateProductList:chooseVal==='b'?form.regularProductList:form.giftProductList"
-            :scroll="{ y: 500 }"
+            :scroll="{ y: 330 }"
             :pagination="false"
             bordered
           >
             <!-- 产品分类 -->
             <template slot="productType" slot-scope="text, record">
               <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>
             </template>
             <!-- 品牌 -->
@@ -106,8 +106,8 @@
             </template>
             <!-- 设置起订量 -->
             <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>
           </a-table>
         </div>
@@ -115,20 +115,20 @@
         <div v-show="chooseVal=='d'">
           <a-table
             class="sTable"
-            style="margin-top:10px;max-height:280px;"
+            style="margin-top:10px;max-height:340px;"
             ref="table"
             size="small"
             :rowKey="(record) => record.productScopeSn"
             :columns="specialColumns"
             :data-source="form.specialProductList"
-            :scroll="{ y: 500 }"
+            :scroll="{ y: 330 }"
             :pagination="false"
             bordered
           >
             <!-- 产品分类 -->
             <template slot="productType" slot-scope="text, record">
               <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>
             </template>
             <!-- 品牌 -->
@@ -146,8 +146,8 @@
             </template>
             <!-- 设置起订量 -->
             <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>
           </a-table>
         </div>
@@ -214,7 +214,7 @@ export default {
       specialColumns: [
         { title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, 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: '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 + '%') : '--') } },
@@ -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: '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: '设置起订量', width: '12%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
+        { title: '设置起订量', width: '7%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
       ]
     }
   },

+ 3 - 3
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -16,7 +16,7 @@
           </div>
           <ul>
             <li v-if="goodFlag==='1'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
-            <li v-else>1) 导入的Excel文件中必须包含名为“产品编码”、“省价特价”、“市价特价”和“特约特价”的列,都为必填</li>
+            <li v-else>1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
             <li>
               <a :href="filePath" style="margin: 5px 0 0;display: block;">
@@ -90,8 +90,8 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/promotion/importNormalProduct',
-      attachAction1: process.env.VUE_APP_API_BASE_URL + '/promotion/importSpecialProduct',
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/promotion/importNormalProduct', // 导入门槛、正价、促销产品
+      attachAction1: process.env.VUE_APP_API_BASE_URL + '/promotion/importSpecialProduct', // 导入特价产品
       paramsData: null,
       filePath: ''
     }

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

@@ -44,13 +44,13 @@
               placeholder="请选择"
               allowClear></v-select>
             <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-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
               </a-tooltip>
             </div>
             <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 class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
               购买满
@@ -103,13 +103,7 @@
           </a-radio-group>
           <span style="color:gray;">(如:满1000送200,金额叠加则:满2000送400,以此类推)</span>
         </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-option value="0">
               不限
@@ -129,13 +123,7 @@
             :precision="2"
             placeholder="请输入金额"/>
         </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-option value="0">
               不限
@@ -304,7 +292,6 @@ export default {
     //  保存
     handleSave () {
       const _this = this
-
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           // 验证必填
@@ -335,11 +322,16 @@ export default {
             _this.$message.warning('请输入活动经费上限金额!')
             return
           }
-
           const form = JSON.parse(JSON.stringify(_this.form))
+          let rowFlag1, rowFlag2, rowFlag3
           if (form.gateFlag == '1') {
             form.gateProductList = this.$refs.cillProduct.getResultVal()
             form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
+            if (form.gateProductList.length == 0) {
+              _this.$message.warning('请添加门槛产品!')
+              return
+            }
+            rowFlag1 = _this.isJudge(form.gateProductList)
           } else {
             form.gateProductList = []
             form.gateAmount = ''
@@ -348,10 +340,27 @@ export default {
           }
           if (form.scopeFlag == '0') {
             form.giftProductList = this.$refs.offerProduct.getResultVal()
+            if (form.giftProductList.length == 0) {
+              _this.$message.warning('请添加促销产品!')
+              return
+            }
+            rowFlag2 = _this.isJudge(form.giftProductList)
           } else {
             form.giftProductList = []
           }
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
+          // 判断表格必填
+          if (form.regularProductList.length == 0) {
+            _this.$message.warning('请添加正价产品!')
+            return
+          } else {
+            rowFlag3 = _this.isJudge(form.regularProductList)
+          }
+
+          if (rowFlag1 || rowFlag2 || rowFlag3) {
+            _this.$message.warning('请选择产品分类、品牌或产品!')
+            return
+          }
           form.promotionSn = _this.promotionSn
           _this.spinning = true
           promotionSave(form).then(res => {
@@ -371,6 +380,29 @@ export default {
         }
       })
     },
+    // 判断品牌,分类,产品其中一个必填
+    isJudge (list) {
+      const flag = list.some(con => {
+        if (con.productThisList) {
+          if (con.productThisList.length > 0) {
+            return false
+          } else {
+            if ((con.productTypeList && con.productTypeList.length > 0) || (con.productBrandList && con.productBrandList.length > 0)) {
+              return false
+            } else {
+              return true
+            }
+          }
+        } else {
+          if ((con.productTypeList && con.productTypeList.length > 0) || (con.productBrandList && con.productBrandList.length > 0)) {
+            return false
+          } else {
+            return true
+          }
+        }
+      })
+      return flag
+    },
     // 重置表格
     resetSearchForm () {
       this.form = {

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

@@ -44,7 +44,7 @@
               placeholder="请选择"
               allowClear></v-select>
             <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-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
               </a-tooltip>
@@ -72,7 +72,13 @@
               </a-select-option>
             </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
               v-model="form.promotionQty"
@@ -84,7 +90,7 @@
             个促销产品
           </div>
           <div class="ruleDescList">
-            <a-checkbox size="small" @change="onChange">
+            <a-checkbox :checked="form.restrictFlag === '1'" size="small" @change="onChange">
               限制正价产品款数
             </a-checkbox>
             <a-input-number
@@ -248,7 +254,7 @@ export default {
         regularSameFlag: '1', // 满赠规则  不同款商品
         regularQty: undefined,
         promotionQty: undefined,
-        restrictFlag: undefined, // 限制正价产品款数
+        restrictFlag: '0', // 限制正价产品款数
         restrictCategory: '',
         accrualFlag: undefined, // 数量叠加
         minOrderFlag: '0', // 起订金额
@@ -334,7 +340,7 @@ export default {
             _this.$message.warning('满赠规则条件不能为空!')
             return
           }
-          if (_this.form.restrictFlag && !_this.form.restrictCategory) {
+          if (_this.form.restrictFlag === '1' && !_this.form.restrictCategory) {
             _this.$message.warning('请输入限制正价产品款数个数!')
             return
           }
@@ -349,9 +355,15 @@ export default {
           }
 
           const form = JSON.parse(JSON.stringify(_this.form))
+          let rowFlag1, rowFlag2, rowFlag3
           if (form.gateFlag == '1') {
             form.gateProductList = this.$refs.cillProduct.getResultVal()
             form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
+            if (form.gateProductList.length == 0) {
+              _this.$message.warning('请添加门槛产品!')
+              return
+            }
+            rowFlag1 = _this.isJudge(form.gateProductList)
           } else {
             form.gateProductList = []
             form.gateAmount = ''
@@ -360,10 +372,26 @@ export default {
           }
           if (form.regularPromotionSameFlag == '0') {
             form.giftProductList = this.$refs.offerProduct.getResultVal()
+            if (form.giftProductList.length == 0) {
+              _this.$message.warning('请添加促销产品!')
+              return
+            }
+            rowFlag2 = _this.isJudge(form.giftProductList)
           } else {
             form.giftProductList = []
           }
           form.regularProductList = this.$refs.normalPriceProduct.getResultVal()
+          // 判断表格必填
+          if (form.regularProductList.length == 0) {
+            _this.$message.warning('请添加正价产品!')
+            return
+          } else {
+            rowFlag3 = _this.isJudge(form.regularProductList)
+          }
+          if (rowFlag1 || rowFlag2 || rowFlag3) {
+            _this.$message.warning('请选择产品分类、品牌或产品!')
+            return
+          }
           form.promotionSn = _this.promotionSn
           _this.spinning = true
           promotionSave(form).then(res => {
@@ -383,6 +411,29 @@ export default {
         }
       })
     },
+    // 判断品牌,分类,产品其中一个必填
+    isJudge (list) {
+      const flag = list.forEach(con => {
+        if (con.productThisList) {
+          if (con.productThisList.length > 0) {
+            return false
+          } else {
+            if ((con.productTypeList && con.productTypeList.length > 0) || (con.productBrandList && con.productBrandList.length > 0)) {
+              return false
+            } else {
+              return true
+            }
+          }
+        } else {
+          if ((con.productTypeList && con.productTypeList.length > 0) || (con.productBrandList && con.productBrandList.length > 0)) {
+            return false
+          } else {
+            return true
+          }
+        }
+      })
+      return flag
+    },
     // 重置表格
     resetSearchForm () {
       this.form = {
@@ -395,7 +446,7 @@ export default {
         regularSameFlag: '1', // 满赠规则  不同款商品
         regularQty: undefined,
         promotionQty: undefined,
-        restrictFlag: undefined, // 限制正价产品款数
+        restrictFlag: '0', // 限制正价产品款数
         restrictCategory: '',
         accrualFlag: '1', // 数量叠加
         minOrderFlag: '0', // 起订金额

+ 121 - 37
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -1,12 +1,13 @@
 <template>
-  <a-drawer
-    title="规则设置"
+  <a-modal
+    centered
     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="83%">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
         id="promotionList-basicInfo-form"
@@ -43,13 +44,13 @@
               placeholder="请选择"
               allowClear></v-select>
             <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-icon type="question-circle" theme="filled" :style="{ fontSize: '14px', color: 'gray' }"/>
               </a-tooltip>
             </div>
             <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 class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
               购买满
@@ -60,13 +61,7 @@
             </div>
           </div>
         </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-option value="0">
               不限
@@ -86,13 +81,7 @@
             :precision="2"
             placeholder="请输入金额"/>
         </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-option value="0">
               不限
@@ -138,7 +127,7 @@
               type="link"
               class="button-error"
               id="promotionList-edit-btn"
-              @click="openProductsModal = true">+新增产品</a-button>
+              @click="addProducts">+新增产品</a-button>
           </div>
         </div>
         <div v-show="chooseVal=='a'"><tableType1 ref="cillProduct"></tableType1></div>
@@ -152,13 +141,14 @@
     <!-- 选择产品 -->
     <chooseProductsModal
       type="dealership"
+      ref="productBox"
       :openModal="openProductsModal"
       :chooseData="chooseProducts"
       @close="openProductsModal=false"
       @ok="handleProductsOk" />
     <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
-  </a-drawer>
+    <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
+  </a-modal>
 </template>
 
 <script>
@@ -264,6 +254,16 @@ export default {
           const form = JSON.parse(JSON.stringify(_this.form))
           if (form.gateFlag == '1') {
             form.gateProductList = _this.$refs.cillProduct.getResultVal()
+            form.gateAmount = form.gateType === 'RATIO_AMOUNT' ? form.gateAmount / 100 : form.gateAmount
+            if (form.gateProductList.length == 0) {
+              _this.$message.warning('请添加门槛产品!')
+              return
+            }
+            const rowFlag = _this.isJudge(form.gateProductList)
+            if (rowFlag) {
+              _this.$message.warning('请选择产品分类、品牌或产品!')
+              return
+            }
           } else {
             form.gateProductList = []
             form.gateAmount = ''
@@ -271,6 +271,10 @@ export default {
             form.gateType = undefined
           }
           form.specialProductList = _this.$refs.specialProduct.getResultVal()
+          if (form.specialProductList.length == 0) {
+            _this.$message.warning('请添加特价产品!')
+            return
+          }
           form.promotionSn = _this.promotionSn
           _this.spinning = true
           promotionSave(form).then(res => {
@@ -290,6 +294,29 @@ export default {
         }
       })
     },
+    // 判断门槛产品中品牌,分类,产品其中一个必填
+    isJudge (list) {
+      const flag = list.some(con => {
+        if (con.productThisList) {
+          if (con.productThisList.length > 0) {
+            return false
+          } else {
+            if ((con.productTypeList && con.productTypeList.length > 0) || (con.productBrandList && con.productBrandList.length > 0)) {
+              return false
+            } else {
+              return true
+            }
+          }
+        } else {
+          if ((con.productTypeList && con.productTypeList.length > 0) || (con.productBrandList && con.productBrandList.length > 0)) {
+            return false
+          } else {
+            return true
+          }
+        }
+      })
+      return flag
+    },
     // 重置表格
     resetSearchForm () {
       this.form = {
@@ -389,14 +416,68 @@ export default {
       })
       return list
     },
+    // 导入
     hanldeOk (arr) {
+      // 门槛产品导入
       const resultArr = []
-      arr.forEach(item => {
-        item = { ...item, ...item.product }
-        item.code = item.productCode
-        resultArr.push(item)
+      if (this.chooseVal == 'a') {
+        arr.forEach(item => {
+          const obj = {
+            productCode: item.productCode,
+            productSn: item.product.productSn
+          }
+          resultArr.push(obj)
+        })
+        const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
+        this.$refs[name + 'Product'].importRow(resultArr)
+      } else {
+        // 特价产品导入
+        const dataList = this.setShowData('This')
+        arr.forEach(item => {
+          item = { ...item, ...item.product }
+          item.code = item.productCode
+          if (item.provincePrice) {
+            item.provinceDiscountRate = Math.floor(((item.provinceDiscountPriceText / item.provincePrice) * 100).toFixed(2))
+          }
+          if (item.cityPrice) {
+            item.cityDiscountRate = Math.floor(((item.cityDiscountPriceText / item.cityPrice) * 100).toFixed(2))
+          }
+          if (item.specialPrice) {
+            item.specialDiscountRate = Math.floor(((item.specialDiscountPriceText / item.specialPrice) * 100).toFixed(2))
+          }
+          const flag = dataList.includes(item.productSn)
+          if (!flag) {
+            resultArr.push(item)
+          }
+        })
+        if (resultArr.length > 0) {
+          this.handleProductsOk(resultArr)
+        } else {
+          this.$message.warning('请勿添加重复数据!')
+        }
+      }
+    },
+    // 打开新增产品弹窗(禁用已选)
+    addProducts () {
+      this.chooseProducts = []
+      this.openProductsModal = true
+      const dataList = this.setShowData('This')
+      this.$refs.productBox.handleDisabled(dataList)
+    },
+    // 获取回显禁用数据
+    setShowData (name) {
+      const _this = this
+      const snArr = []
+      const valList = _this.$refs.specialProduct.getResultVal()
+      valList.forEach(item => {
+        if (item['product' + name + 'List'] && item['product' + name + 'List'].length > 0) {
+          item['product' + name + 'List'].forEach(con => {
+            const newName = name === 'This' ? '' : name
+            snArr.push(con['product' + newName + 'Sn'])
+          })
+        }
       })
-      this.handleProductsOk(resultArr)
+      return snArr
     },
     // +新增产品
     handleProductsOk (con) {
@@ -410,8 +491,8 @@ export default {
             dataSourceOrigin: '1',
             productTypeArr: [],
             productTypeList: [],
-            productBrandArr: [{ brandSn: item.productBrandSn, brandName: item.productBrandName }],
-            productBrandList: [{ brandSn: item.productBrandSn }],
+            productBrandArr: [{ productBrandSn: item.productBrandSn, brandName: item.productBrandName }],
+            productBrandList: [{ productBrandSn: item.productBrandSn }],
             productThisList: [{
               productSn: item.productSn,
               productCode: item.code
@@ -423,17 +504,20 @@ export default {
             cityDiscountPrice: item.cityDiscountPriceText,
             specialDiscountPrice: item.specialDiscountPriceText,
             unitType: 'SL',
-            unitQty: 1
+            unitQty: 1,
+            provinceDiscountRate: item.provinceDiscountRate ? item.provinceDiscountRate : undefined,
+            cityDiscountRate: item.cityDiscountRate ? item.cityDiscountRate : undefined,
+            specialDiscountRate: item.specialDiscountRate ? item.specialDiscountRate : undefined
           }
           const obj = {}
           if (item.productTypeSn1) {
-            obj.productType1 = item.productTypeSn1
+            obj.productTypeSn1 = item.productTypeSn1
           }
           if (item.productTypeSn2) {
-            obj.productType2 = item.productTypeSn2
+            obj.productTypeSn2 = item.productTypeSn2
           }
           if (item.productTypeSn3) {
-            obj.productType3 = item.productTypeSn3
+            obj.productTypeSn3 = item.productTypeSn3
           }
           const newObj = { ...obj, ...{} }
           if (Object.keys(obj).length == 1) {

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

@@ -107,24 +107,21 @@
       </template>
       <!-- 设置起订量 -->
       <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>
       <span slot="action" slot-scope="text,record">
         <a-button
@@ -182,10 +179,10 @@ export default {
     return {
       spinning: false,
       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' }
       ],
       dataSource: [],
@@ -246,6 +243,8 @@ export default {
             _this.spinning = false
           }
         })
+      } else {
+        _this.$message.warning('请勿导入重复数据!')
       }
     },
     // 删除一行

+ 2 - 0
src/views/promotionRulesManagement/dealerPromotions/tableType2.vue

@@ -220,6 +220,8 @@ export default {
             _this.spinning = false
           }
         })
+      } else {
+        _this.$message.warning('请勿导入重复数据!')
       }
     },
     // 删除一行

+ 58 - 56
src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

@@ -15,11 +15,11 @@
       <template slot="productType" slot-scope="text, record,index">
         <div style="max-height:126px;width:100%;overflow-y:scroll;" v-if="record.dataSourceOrigin=='0'">
           <a-row v-if="record.productTypeArr && record.productTypeArr.length>0">
-            <a-col :span="16">
+            <a-col :span="17">
               <div v-for="con in record.productTypeArr" :key="con.id">
-                <a-tooltip v-if="con.title&&con.title.length > 3" :title="con.title">
+                <a-tooltip v-if="con.title&&con.title.length > 7" :title="con.title">
                   <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
-                    {{ `${con.title.slice(0, 3)}...` }}
+                    {{ `${con.title.slice(0, 7)}...` }}
                   </a-tag>
                 </a-tooltip>
                 <a-tag v-else style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
@@ -27,7 +27,7 @@
                 </a-tag>
               </div>
             </a-col>
-            <a-col :span="4" style="text-align:right;">
+            <a-col :span="6" style="text-align:right;">
               <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
@@ -47,11 +47,11 @@
       <template slot="productBrand" slot-scope="text, record,index">
         <div style="max-height:126px;overflow-y:scroll;" v-if="record.dataSourceOrigin=='0'">
           <a-row v-if="record.productBrandArr && record.productBrandArr.length>0">
-            <a-col :span="16">
+            <a-col :span="17">
               <div v-for="item in record.productBrandArr" :key="item.brandSn">
-                <a-tooltip v-if="item.brandName&&item.brandName.length > 3" :title="item.brandName">
+                <a-tooltip v-if="item.brandName&&item.brandName.length > 7" :title="item.brandName">
                   <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
-                    {{ `${item.brandName.slice(0, 3)}...` }}
+                    {{ `${item.brandName.slice(0, 7)}...` }}
                   </a-tag>
                 </a-tooltip>
                 <a-tag v-else style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
@@ -60,7 +60,7 @@
               </div>
             </a-col>
 
-            <a-col :span="4" style="text-align:right;">
+            <a-col :span="6" style="text-align:right;">
               <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
@@ -86,13 +86,13 @@
         <div v-if="record.dataSourceOrigin=='1'">
           <a-input-number
             size="small"
-            style="width:75%;"
+            style="width:90%;"
             v-model="record.provinceDiscountPrice"
             :min="0"
             :step="1"
             :precision="2"
             placeholder="请输入"
-            :max="record.provincePrice"
+            :max="999999"
             @blur="e=>calculatePrice(e.target.value,record.productScopeSn,'province')"/>
         </div>
         <span v-else>--</span>
@@ -101,29 +101,30 @@
       <template slot="provinceDiscount" slot-scope="text, record">
         <div v-if="record.dataSourceOrigin=='0'">
           <a-input-number
+            style="width:80%;"
             size="small"
-            style="width:75%;"
             v-model="record.provinceDiscountRate"
             :min="0"
             :step="1"
-            :max="100"
+            :max="999999"
+            :precision="2"
             placeholder="请输入"
           />%
         </div>
-        <span v-else>{{ record.provinceDiscountRate?record.provinceDiscountRate+'%':'--' }}</span>
+        <span v-else>{{ (record.provinceDiscountRate||record.provinceDiscountRate==0)?record.provinceDiscountRate+'%':'--' }}</span>
       </template>
       <!-- 市价特价 -->
       <template slot="cityPrice" slot-scope="text, record">
         <div v-if="record.dataSourceOrigin=='1'">
           <a-input-number
             size="small"
-            style="width:75%;"
+            style="width:90%;"
             v-model="record.cityDiscountPrice"
             :min="0"
             :step="1"
             :precision="2"
             placeholder="请输入"
-            :max="record.cityPrice"
+            :max="999999"
             @blur="e=>calculatePrice(e.target.value,record.productScopeSn,'city')"/>
         </div>
         <span v-else>--</span>
@@ -133,27 +134,28 @@
         <div v-if="record.dataSourceOrigin=='0'">
           <a-input-number
             size="small"
-            style="width:75%;"
+            style="width:80%;"
             v-model="record.cityDiscountRate"
             :min="0"
             :step="1"
-            :max="100"
+            :max="999999"
+            :precision="2"
             placeholder="请输入"/>%
         </div>
-        <span v-else>{{ record.cityDiscountRate?record.cityDiscountRate+'%':'--' }}</span>
+        <span v-else>{{ (record.cityDiscountRate||record.cityDiscountRate==0)?record.cityDiscountRate+'%':'--' }}</span>
       </template>
       <!-- 特约特价 -->
       <template slot="specialPrice" slot-scope="text, record">
         <div v-if="record.dataSourceOrigin=='1'">
           <a-input-number
             size="small"
-            style="width:75%;"
+            style="width:90%;"
             v-model="record.specialDiscountPrice"
             :min="0"
             :step="1"
             :precision="2"
             placeholder="请输入"
-            :max="record.specialPrice"
+            :max="999999"
             @blur="e=>calculatePrice(e.target.value,record.productScopeSn,'special')"/>
         </div>
         <span v-else>--</span>
@@ -163,35 +165,34 @@
         <div v-if="record.dataSourceOrigin=='0'">
           <a-input-number
             size="small"
-            style="width:75%;"
+            style="width:80%;"
             v-model="record.specialDiscountRate"
             :min="0"
             :step="1"
-            :max="100"
-            placeholder="请输入"/>
+            :precision="2"
+            :max="999999"
+            placeholder="请输入"/>%
         </div>
-        <span v-else>{{ record.specialDiscountRate ? record.specialDiscountRate+'%':'--' }}</span>
+        <span v-else>{{ (record.specialDiscountRate||record.specialDiscountRate==0) ? record.specialDiscountRate+'%':'--' }}</span>
       </template>
       <!-- 设置起订量 -->
       <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"
+          :max="999999"
+          placeholder="请输入"/>
       </template>
       <span slot="action" slot-scope="text,record">
         <a-button
@@ -247,20 +248,20 @@ export default {
     return {
       spinning: false,
       columns: [
-        { title: '产品分类', width: '11%', scopedSlots: { customRender: 'productType' }, align: 'center' },
-        { title: '品牌', width: '11%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
-        { title: '产品', scopedSlots: { customRender: 'product' }, width: '8%', align: 'center' },
-        { title: '省级原价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '省级特价', scopedSlots: { customRender: 'provincePrice' }, width: '6%', align: 'center' },
-        { title: '省级折扣', scopedSlots: { customRender: 'provinceDiscount' }, width: '6%', align: 'center' },
-        { title: '市级原价', dataIndex: 'cityPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '市级特价', scopedSlots: { customRender: 'cityPrice' }, width: '6%', align: 'center' },
-        { title: '市级折扣', scopedSlots: { customRender: 'cityDiscount' }, width: '6%', align: 'center' },
-        { title: '特约原价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '特约特价', scopedSlots: { customRender: 'specialPrice' }, width: '6%', align: 'center' },
-        { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' }, width: '6%', align: 'center' },
-        { title: '设置起订量', width: '12%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '产品分类', width: '16%', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '品牌', width: '16%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
+        { title: '产品', scopedSlots: { customRender: 'product' }, width: '10%', align: 'center' },
+        { title: '省级原价', dataIndex: 'provincePrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '省级特价', scopedSlots: { customRender: 'provincePrice' }, width: '5%', align: 'center' },
+        { title: '省级折扣', scopedSlots: { customRender: 'provinceDiscount' }, width: '5%', align: 'center' },
+        { title: '市级原价', dataIndex: 'cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '市级特价', scopedSlots: { customRender: 'cityPrice' }, width: '5%', align: 'center' },
+        { title: '市级折扣', scopedSlots: { customRender: 'cityDiscount' }, width: '5%', align: 'center' },
+        { title: '特约原价', dataIndex: 'specialPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约特价', scopedSlots: { customRender: 'specialPrice' }, width: '5%', align: 'center' },
+        { title: '特约折扣', scopedSlots: { customRender: 'specialDiscount' }, width: '5%', align: 'center' },
+        { title: '设置起订量', width: '7%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ],
       dataSource: [],
       openBrandModal: false,
@@ -452,6 +453,7 @@ export default {
       })
       return snArr
     },
+    // 获取最后结果
     getResultVal () {
       const resultObj = JSON.parse(JSON.stringify(this.dataSource))
       resultObj.map(item => {