chenrui 1 anno fa
parent
commit
97c3e2bfd5

+ 18 - 0
src/components/index.less

@@ -99,6 +99,24 @@
     border-color: #c8c9cc;
   }
 }
+.ant-btn-primary.button-gray {
+  background-color: #eee;
+  border-color: #eee;
+  color:#39f;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #e0e0e0;
+     color:#39f;
+    border-color: #e0e0e0;
+  }
+ 
+  &:active, &.active {
+  background-color: #e0e0e0;
+   color:#39f;
+  border-color: #e0e0e0;
+  }
+}
 
 // btn-link
 .ant-btn-link.button-primary,.ant-btn-link.button-info,.ant-btn-link.button-warning,.ant-btn-link.button-purple,.ant-btn-link.button-geekblue {

+ 23 - 5
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -86,6 +86,12 @@
     <brandCategoryModal :openType="openType" :openModal="openModal" @close="openModal = false"></brandCategoryModal>
     <!-- 详情 -->
     <detailModal :openModal="openDetailModal" @close="openDetailModal = false"></detailModal>
+    <!-- 买产品送产品  弹窗 -->
+    <sendProductsModal :openModal="openSendProductsModal" @close="openSendProductsModal = false"></sendProductsModal>
+    <!-- 买产品送采购额 弹窗 -->
+    <sendAmountModal :openModal="openSendAmountModal" @close="openSendAmountModal = false"></sendAmountModal>
+    <!-- 特价产品  弹窗 -->
+    <specialOfferModal :openModal="openSpecialOfferModal" @close="openSpecialOfferModal = false"></specialOfferModal>
   </div>
 </template>
 
@@ -95,11 +101,14 @@ import { STable } from '@/components'
 import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
 import brandCategoryModal from './brandCategoryModal'
 import detailModal from './detailModal'
+import sendProductsModal from './sendProductsModal'
+import sendAmountModal from './sendAmountModal'
+import specialOfferModal from './specialOfferModal'
 import { queryPageForWarehouseDetail, salesDetailBySn } from '@/api/sales'
 export default {
   name: 'SalesOrderWarehouseDetail',
   mixins: [commonMixin],
-  components: { STable, lookUpCustomersModal, brandCategoryModal, detailModal },
+  components: { STable, lookUpCustomersModal, brandCategoryModal, detailModal, sendProductsModal, sendAmountModal, specialOfferModal },
   data () {
     return {
       disabled: false,
@@ -128,7 +137,10 @@ export default {
       isShowBisiceInfo: false,
       openCustomerModal: false,
       openType: undefined,
-      openDetailModal: false
+      openDetailModal: false,
+      openSendProductsModal: false,
+      openSendAmountModal: false,
+      openSpecialOfferModal: false
     }
   },
   computed: {
@@ -171,11 +183,17 @@ export default {
       this.openModal = true
     },
     // 买产品送产品
-    handleProduct () {},
+    handleProduct () {
+      this.openSendProductsModal = true
+    },
     // 买产品送采购额
-    handleAmount () {},
+    handleAmount () {
+      this.openSendAmountModal = true
+    },
     // 特价产品
-    handleSpecialProduct () {},
+    handleSpecialProduct () {
+      this.openSpecialOfferModal = true
+    },
     // 查看客户
     handleSee () {
       this.openCustomerModal = true

+ 354 - 0
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -0,0 +1,354 @@
+<template>
+  <a-modal
+    centered
+    class="promotionList-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="规则设置"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="promotionList-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="规则门槛" prop="supplierSn">
+          <a-radio-group v-model="form.supplierSn" button-style="solid" size="small">
+            <a-radio-button value="a">
+              有
+            </a-radio-button>
+            <a-radio-button value="b">
+              无
+            </a-radio-button>
+          </a-radio-group>
+          <div class="ruleDescList">
+            购买满
+            <a-input-number v-model="form.starAmount" :min="0" :precision="2" size="small"/>
+            元门槛产品,可使用
+            <a-input-number v-model="form.endAmount" :min="0" :precision="2" size="small"/>
+            元配额,采购规则中的正价商品(配额算销售额)
+          </div>
+        </a-form-model-item>
+        <a-form-model-item label="满赠规则" prop="supplierSn">
+          <div class="ruleDescList">
+            <a-select default-value="a" style="width: 100px" size="small">
+              <a-select-option value="a">
+                同款
+              </a-select-option>
+              <a-select-option value="b">
+                不同款
+              </a-select-option>
+            </a-select>
+            产品购买满
+            <a-input-number v-model="form.starAmount" :min="0" :step="1" :precision="0" size="small"/>
+            元正价产品,送
+            <a-input-number v-model="form.endAmount" :min="0" :step="1" :precision="0" size="small"/>
+            元%促销品采购额
+          </div>
+          <div class="ruleDescList">
+            <a-checkbox size="small">
+              限制正价产品款数
+            </a-checkbox>
+            <a-input-number v-model="form.endAmount" :min="0" :step="1" :precision="0" size="small"/>
+          </div>
+        </a-form-model-item>
+        <a-form-model-item label="金额叠加" prop="returnReason">
+          <a-radio-group v-model="form.supperSn" button-style="solid" size="small">
+            <a-radio-button value="a">
+              是
+            </a-radio-button>
+            <a-radio-button value="b">
+              否
+            </a-radio-button>
+          </a-radio-group>
+          <span style="color:gray;">(如:满1000送200,金额叠加则:满2000送400,以此类推)</span>
+        </a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            订单起订金额
+          </span>
+          <a-select default-value="b" style="width: 160px" size="small">
+            <a-select-option value="a">
+              不限
+            </a-select-option>
+            <a-select-option value="b">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:300px;"
+            v-model="form.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入金额"/>
+        </a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            活动经费上限
+          </span>
+          <a-select default-value="b" style="width: 160px" size="small">
+            <a-select-option value="a">
+              不限
+            </a-select-option>
+            <a-select-option value="b">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:300px;"
+            v-model="form.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入金额"/>
+        </a-form-model-item>
+        <a-form-model-item label="采购额适用范围" prop="returnReason">
+          <a-radio-group v-model="form.supplier" button-style="solid" size="small">
+            <a-radio-button value="a">
+              部分产品
+            </a-radio-button>
+            <a-radio-button value="b">
+              全部产品
+            </a-radio-button>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <div class="flex">
+          <a-radio-group v-model="chooseVal" button-style="solid" size="small">
+            <a-radio-button value="a">
+              门槛产品
+            </a-radio-button>
+            <a-radio-button value="b">
+              正价产品
+            </a-radio-button>
+            <a-radio-button value="c">
+              促销产品
+            </a-radio-button>
+          </a-radio-group>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            id="promotionList-edit-btn">+导入产品</a-button>
+        </div>
+        <tableType1></tableType1>
+      </a-card>
+      <div class="btn-cont">
+        <a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button style="margin-left: 15px;" type="primary" id="promotionList-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import tableType1 from './tableType1.vue'
+import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+export default {
+  name: 'PromotionListBasicInfoModal',
+  mixins: [commonMixin],
+  components: { VSelect, tableType1 },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 17 }
+      },
+      form: {
+        promotionName: '',
+        activeDate: undefined,
+        supplierSn: 'b', // 供应商
+        returnReason: '', // 退货原因
+        explainInfo: '', // 补充说明
+        warehouseSn: undefined,
+        attachmentList: ''
+      },
+      openDealerModal: false,
+      chooseDealerList: [],
+      attachList: [], // 附件
+      dateFormat: 'YYYY-MM-DD',
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商名称', trigger: 'change' }
+        ],
+        returnReason: [
+          { required: true, message: '请选择退货原因', trigger: 'change' }
+        ],
+        warehouseSn: [{ required: true, message: '请选择退货仓库', trigger: 'change' }]
+      },
+      chooseVal: 'a',
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo'
+    }
+  },
+  methods: {
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
+    // 选择参与客户
+    handleDealerModal () {
+      this.openDealerModal = true
+      const _this = this
+      if (_this.chooseDealerList.length == 0) {
+        _this.form.promoBuyerList = []
+      }
+      const arr = _this.chooseDealerList.map(item => {
+        return item.buyerSn
+      })
+      // 选择经销商回显
+      _this.$nextTick(() => {
+        _this.$refs.dealerChoose.pageInit(arr)
+      })
+    },
+    // 添加经销商
+    handleAddDealer (list) {
+      this.chooseDealerList = list.map(con => {
+        return {
+          buyerSn: con.dealerSn,
+          buyerName: con.dealerName
+        }
+      })
+      this.openDealerModal = false
+      // 移除表单必填项
+      this.$refs.ruleForm.clearValidate('promoBuyerList')
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = _this.attachList
+          _this.spinning = true
+          sparePartsReturnSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 获取编辑详情
+    getDetail () {
+      sparePartsReturnInfo({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const resultObj = res.data
+          this.attachList = resultObj.attachmentList
+          const obj = {
+            supplierSn: resultObj.supplierSn,
+            returnReason: resultObj.returnReason, // 退货原因
+            explainInfo: resultObj.explainInfo, // 补充说明
+            warehouseSn: resultObj.warehouseSn,
+            sparePartsReturnSn: this.itemSn
+          }
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+          this.form = { ...this.form, ...obj }
+        } else {
+          this.detailsData = null
+        }
+      })
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.attachList = []
+        this.supplierName = null
+        this.$nextTick(() => {
+          this.$refs.attachList.setFileList('')
+          this.$refs.ruleForm.resetFields()
+        })
+      } else {
+        if (this.itemSn) {
+          this.getDetail()
+        } else {
+          // 默认仓库
+          this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse && this.defWarehouse.warehouseSn
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotionList-basicInfo-modal{
+    /deep/.ant-modal-body {
+      padding: 40px 40px 24px;
+      max-height: 745px !important;
+      overflow-y: scroll !important;
+    }
+    .ant-radio-button-wrapper{
+      width:80px;
+      text-align: center;
+    }
+    .ant-form-item{
+      margin-bottom:5px;
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;margin-top:10px;border-radius:4px;padding:4px 10px;background:#f2f2f2;max-height:130px;overflow-y:scroll;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .flex{
+      display:flex;
+      align-items:center;
+      justify-content:space-between;
+    }
+  }
+
+</style>

+ 354 - 0
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -0,0 +1,354 @@
+<template>
+  <a-modal
+    centered
+    class="promotionList-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="规则设置"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="promotionList-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="规则门槛" prop="supplierSn">
+          <a-radio-group v-model="form.supplierSn" button-style="solid" size="small">
+            <a-radio-button value="a">
+              有
+            </a-radio-button>
+            <a-radio-button value="b">
+              无
+            </a-radio-button>
+          </a-radio-group>
+          <div class="ruleDescList">
+            购买满
+            <a-input-number v-model="form.starAmount" :min="0" :precision="2" size="small"/>
+            元门槛产品,可使用
+            <a-input-number v-model="form.endAmount" :min="0" :precision="2" size="small"/>
+            元配额,采购规则中的正价商品(配额算销售额)
+          </div>
+        </a-form-model-item>
+        <a-form-model-item label="满赠规则" prop="supplierSn">
+          <div class="ruleDescList">
+            <a-select default-value="a" style="width: 100px" size="small">
+              <a-select-option value="a">
+                同款
+              </a-select-option>
+              <a-select-option value="b">
+                不同款
+              </a-select-option>
+            </a-select>
+            产品购买满
+            <a-input-number v-model="form.starAmount" :min="0" :step="1" :precision="0" size="small"/>
+            个正价产品,送
+            <a-input-number v-model="form.endAmount" :min="0" :step="1" :precision="0" size="small"/>
+            个促销产品
+          </div>
+          <div class="ruleDescList">
+            <a-checkbox size="small">
+              限制正价产品款数
+            </a-checkbox>
+            <a-input-number v-model="form.endAmount" :min="0" :step="1" :precision="0" size="small"/>
+          </div>
+        </a-form-model-item>
+        <a-form-model-item label="数量叠加" prop="returnReason">
+          <a-radio-group v-model="form.supperSn" button-style="solid" size="small">
+            <a-radio-button value="a">
+              是
+            </a-radio-button>
+            <a-radio-button value="b">
+              否
+            </a-radio-button>
+          </a-radio-group>
+          <span style="color:gray;">(如:满10送2,数量叠加则:满20送4,满30送6)</span>
+        </a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            订单起订金额
+          </span>
+          <a-select default-value="b" style="width: 160px" size="small">
+            <a-select-option value="a">
+              不限
+            </a-select-option>
+            <a-select-option value="b">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:300px;"
+            v-model="form.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入金额"/>
+        </a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            活动经费上限
+          </span>
+          <a-select default-value="b" style="width: 160px" size="small">
+            <a-select-option value="a">
+              不限
+            </a-select-option>
+            <a-select-option value="b">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:300px;"
+            v-model="form.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入金额"/>
+        </a-form-model-item>
+        <a-form-model-item label="促销品与正品一致" prop="returnReason">
+          <a-radio-group v-model="form.supplier" button-style="solid" size="small">
+            <a-radio-button value="a">
+              是
+            </a-radio-button>
+            <a-radio-button value="b">
+              否
+            </a-radio-button>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <div class="flex">
+          <a-radio-group v-model="chooseVal" button-style="solid" size="small">
+            <a-radio-button value="a">
+              门槛产品
+            </a-radio-button>
+            <a-radio-button value="b">
+              正价产品
+            </a-radio-button>
+            <a-radio-button value="c">
+              促销产品
+            </a-radio-button>
+          </a-radio-group>
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            id="promotionList-edit-btn">+导入产品</a-button>
+        </div>
+        <tableType1></tableType1>
+      </a-card>
+      <div class="btn-cont">
+        <a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button style="margin-left: 15px;" type="primary" id="promotionList-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import tableType1 from './tableType1.vue'
+import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+export default {
+  name: 'PromotionListBasicInfoModal',
+  mixins: [commonMixin],
+  components: { VSelect, tableType1 },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 17 }
+      },
+      form: {
+        promotionName: '',
+        activeDate: undefined,
+        supplierSn: 'b', // 供应商
+        returnReason: '', // 退货原因
+        explainInfo: '', // 补充说明
+        warehouseSn: undefined,
+        attachmentList: ''
+      },
+      openDealerModal: false,
+      chooseDealerList: [],
+      attachList: [], // 附件
+      dateFormat: 'YYYY-MM-DD',
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商名称', trigger: 'change' }
+        ],
+        returnReason: [
+          { required: true, message: '请选择退货原因', trigger: 'change' }
+        ],
+        warehouseSn: [{ required: true, message: '请选择退货仓库', trigger: 'change' }]
+      },
+      chooseVal: 'a',
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo'
+    }
+  },
+  methods: {
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
+    // 选择参与客户
+    handleDealerModal () {
+      this.openDealerModal = true
+      const _this = this
+      if (_this.chooseDealerList.length == 0) {
+        _this.form.promoBuyerList = []
+      }
+      const arr = _this.chooseDealerList.map(item => {
+        return item.buyerSn
+      })
+      // 选择经销商回显
+      _this.$nextTick(() => {
+        _this.$refs.dealerChoose.pageInit(arr)
+      })
+    },
+    // 添加经销商
+    handleAddDealer (list) {
+      this.chooseDealerList = list.map(con => {
+        return {
+          buyerSn: con.dealerSn,
+          buyerName: con.dealerName
+        }
+      })
+      this.openDealerModal = false
+      // 移除表单必填项
+      this.$refs.ruleForm.clearValidate('promoBuyerList')
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = _this.attachList
+          _this.spinning = true
+          sparePartsReturnSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 获取编辑详情
+    getDetail () {
+      sparePartsReturnInfo({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const resultObj = res.data
+          this.attachList = resultObj.attachmentList
+          const obj = {
+            supplierSn: resultObj.supplierSn,
+            returnReason: resultObj.returnReason, // 退货原因
+            explainInfo: resultObj.explainInfo, // 补充说明
+            warehouseSn: resultObj.warehouseSn,
+            sparePartsReturnSn: this.itemSn
+          }
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+          this.form = { ...this.form, ...obj }
+        } else {
+          this.detailsData = null
+        }
+      })
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.attachList = []
+        this.supplierName = null
+        this.$nextTick(() => {
+          this.$refs.attachList.setFileList('')
+          this.$refs.ruleForm.resetFields()
+        })
+      } else {
+        if (this.itemSn) {
+          this.getDetail()
+        } else {
+          // 默认仓库
+          this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse && this.defWarehouse.warehouseSn
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotionList-basicInfo-modal{
+    /deep/.ant-modal-body {
+      padding: 40px 40px 24px;
+      max-height: 745px !important;
+      overflow-y: scroll !important;
+    }
+    .ant-radio-button-wrapper{
+      width:80px;
+      text-align: center;
+    }
+    .ant-form-item{
+      margin-bottom:5px;
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;margin-top:10px;border-radius:4px;padding:4px 10px;background:#f2f2f2;max-height:130px;overflow-y:scroll;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .flex{
+      display:flex;
+      align-items:center;
+      justify-content:space-between;
+    }
+  }
+
+</style>

+ 315 - 0
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -0,0 +1,315 @@
+<template>
+  <a-modal
+    centered
+    class="promotionList-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="规则设置"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="80%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="promotionList-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="规则门槛" prop="supplierSn">
+          <a-radio-group v-model="form.supplierSn" button-style="solid" size="small">
+            <a-radio-button value="a">
+              有
+            </a-radio-button>
+            <a-radio-button value="b">
+              无
+            </a-radio-button>
+          </a-radio-group>
+          <div class="ruleDescList">
+            购买满
+            <a-input-number v-model="form.starAmount" :min="0" :precision="2" size="small"/>
+            元门槛产品,可使用
+            <a-input-number v-model="form.endAmount" :min="0" :precision="2" size="small"/>
+            元配额,采购规则中的特价商品(配额算销售额)
+          </div>
+        </a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            订单起订金额
+          </span>
+          <a-select default-value="b" style="width: 160px" size="small">
+            <a-select-option value="a">
+              不限
+            </a-select-option>
+            <a-select-option value="b">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:300px;"
+            v-model="form.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入金额"/>
+        </a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            活动经费上限
+          </span>
+          <a-select default-value="b" style="width: 160px" size="small">
+            <a-select-option value="a">
+              不限
+            </a-select-option>
+            <a-select-option value="b">
+              限制
+            </a-select-option>
+          </a-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:300px;"
+            v-model="form.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入金额"/>
+        </a-form-model-item>
+      </a-form-model>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <div class="flex">
+          <a-radio-group v-model="chooseVal" button-style="solid" size="small">
+            <a-radio-button value="a">
+              门槛产品
+            </a-radio-button>
+            <a-radio-button value="c">
+              促销产品
+            </a-radio-button>
+          </a-radio-group>
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              id="promotionList-edit-btn">+导入产品</a-button>
+            <a-button
+              style="margin-left:10px;"
+              size="small"
+              type="link"
+              class="button-error"
+              id="promotionList-edit-btn">+新增产品</a-button>
+          </div>
+        </div>
+        <tableType3></tableType3>
+      </a-card>
+      <div class="btn-cont">
+        <a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button style="margin-left: 15px;" type="primary" id="promotionList-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import tableType3 from './tableType3.vue'
+import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+export default {
+  name: 'PromotionListBasicInfoModal',
+  mixins: [commonMixin],
+  components: { VSelect, tableType3 },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 17 }
+      },
+      form: {
+        promotionName: '',
+        activeDate: undefined,
+        supplierSn: 'b', // 供应商
+        returnReason: '', // 退货原因
+        explainInfo: '', // 补充说明
+        warehouseSn: undefined,
+        attachmentList: ''
+      },
+      openDealerModal: false,
+      chooseDealerList: [],
+      attachList: [], // 附件
+      dateFormat: 'YYYY-MM-DD',
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商名称', trigger: 'change' }
+        ],
+        returnReason: [
+          { required: true, message: '请选择退货原因', trigger: 'change' }
+        ],
+        warehouseSn: [{ required: true, message: '请选择退货仓库', trigger: 'change' }]
+      },
+      chooseVal: 'a',
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo'
+    }
+  },
+  methods: {
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
+    // 选择参与客户
+    handleDealerModal () {
+      this.openDealerModal = true
+      const _this = this
+      if (_this.chooseDealerList.length == 0) {
+        _this.form.promoBuyerList = []
+      }
+      const arr = _this.chooseDealerList.map(item => {
+        return item.buyerSn
+      })
+      // 选择经销商回显
+      _this.$nextTick(() => {
+        _this.$refs.dealerChoose.pageInit(arr)
+      })
+    },
+    // 添加经销商
+    handleAddDealer (list) {
+      this.chooseDealerList = list.map(con => {
+        return {
+          buyerSn: con.dealerSn,
+          buyerName: con.dealerName
+        }
+      })
+      this.openDealerModal = false
+      // 移除表单必填项
+      this.$refs.ruleForm.clearValidate('promoBuyerList')
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = _this.attachList
+          _this.spinning = true
+          sparePartsReturnSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 获取编辑详情
+    getDetail () {
+      sparePartsReturnInfo({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const resultObj = res.data
+          this.attachList = resultObj.attachmentList
+          const obj = {
+            supplierSn: resultObj.supplierSn,
+            returnReason: resultObj.returnReason, // 退货原因
+            explainInfo: resultObj.explainInfo, // 补充说明
+            warehouseSn: resultObj.warehouseSn,
+            sparePartsReturnSn: this.itemSn
+          }
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+          this.form = { ...this.form, ...obj }
+        } else {
+          this.detailsData = null
+        }
+      })
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.attachList = []
+        this.supplierName = null
+        this.$nextTick(() => {
+          this.$refs.attachList.setFileList('')
+          this.$refs.ruleForm.resetFields()
+        })
+      } else {
+        if (this.itemSn) {
+          this.getDetail()
+        } else {
+          // 默认仓库
+          this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse && this.defWarehouse.warehouseSn
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotionList-basicInfo-modal{
+    /deep/.ant-modal-body {
+      padding: 40px 40px 24px;
+      max-height: 745px !important;
+      overflow-y: scroll !important;
+    }
+    .ant-radio-button-wrapper{
+      width:80px;
+      text-align: center;
+    }
+    .ant-form-item{
+      margin-bottom:5px;
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;margin-top:10px;border-radius:4px;padding:4px 10px;background:#f2f2f2;max-height:130px;overflow-y:scroll;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .flex{
+      display:flex;
+      align-items:center;
+      justify-content:space-between;
+    }
+  }
+
+</style>

+ 222 - 0
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -0,0 +1,222 @@
+<template>
+  <div class="pages-wrap">
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      style="margin-top:10px;"
+      ref="table"
+      size="small"
+      :showPagination="false"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productTypeList && record.productTypeList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="(con,i) in record.productTypeList" :key="i">
+                {{ con.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 品牌 -->
+      <template slot="productBrand" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productBrandList && record.productBrandList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="(item,j) in record.productBrandList" :key="j">
+                {{ item.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 产品 -->
+      <template slot="product" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productList && record.productList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'productList')" v-for="(item,j) in record.productList" :key="j">
+                {{ item.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addProductTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addProductTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 设置起订量 -->
+      <template slot="setNum" slot-scope="text, record">
+        <div>
+          <v-select
+            v-model="record.returnReason"
+            size="small"
+            style="width:55%;"
+            ref="returnReason"
+            code="SPARE_PARTS_RETURN_REASON"
+            placeholder="请选择"
+            allowClear></v-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:30%;"
+            v-model="record.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入"/>
+        </div>
+      </template>
+      <span slot="action" slot-scope="text,record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+        >
+          删除
+        </a-button>
+      </span>
+    </s-table>
+    <div class="btn-cont">
+      <a-button id="tableType1-add" type="primary" class="button-gray" @click="handleAddRow">+新增一行</a-button>
+    </div>
+    <!-- 选择产品品牌 -->
+    <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
+    <!-- 选择产品分类 -->
+    <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
+    <!-- 选择产品 -->
+    <chooseProductsModal
+      type="dealership"
+      :openModal="openProductsModal"
+      :chooseData="chooseProducts"
+      @close="openProductsModal=false"
+      @ok="handleProductsOk" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect, STable } from '@/components'
+import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
+import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
+import chooseProductsModal from '@/views/common/chooseProductsModal.vue'
+
+import { sparePartsReturnList } from '@/api/sparePartsReturn'
+export default {
+  name: 'TableType1',
+  mixins: [commonMixin],
+  components: { VSelect, STable, ChooseBrandModal, ChooseTypeModal, chooseProductsModal },
+  props: {
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      columns: [
+        { title: '产品分类', width: '20%', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '品牌', width: '20%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
+        { title: '产品', width: '25%', scopedSlots: { customRender: 'product' }, align: 'center' },
+        { title: '设置起订量', width: '25%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      queryParam: {},
+      dataSource: [],
+      openBrandModal: false,
+      openTypeModal: false,
+      openProductsModal: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return sparePartsReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.dataSource = data.list
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 新增一行
+    handleAddRow () {
+      const _this = this
+      const newData = {
+        productTypeList: [],
+        productBrandList: [],
+        productList: []
+      }
+      _this.dataSource.push(newData)
+    },
+    // 添加产品分类
+    addClassifyTag (pos, row) {
+      this.openTypeModal = true
+    },
+    // 添加产品品牌
+    addBrandTag (pos, row) {
+      this.openBrandModal = true
+    },
+    // 添加产品
+    addProductTag () {
+      this.openProductsModal = true
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .pages-wrap{
+    .btn-cont {
+      text-align: center;
+      margin: 10px 0;
+    }
+  }
+
+</style>

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

@@ -0,0 +1,221 @@
+<template>
+  <div class="pages-wrap">
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      style="margin-top:10px;"
+      ref="table"
+      size="small"
+      :showPagination="false"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productTypeList && record.productTypeList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="(con,i) in record.productTypeList" :key="i">
+                {{ con.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 品牌 -->
+      <template slot="productBrand" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productBrandList && record.productBrandList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="(item,j) in record.productBrandList" :key="j">
+                {{ item.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 产品 -->
+      <template slot="product" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productList && record.productList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'productList')" v-for="(item,j) in record.productList" :key="j">
+                {{ item.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addProductTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addProductTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 设置起订量 -->
+      <template slot="setNum" slot-scope="text, record">
+        <div>
+          <v-select
+            v-model="record.returnReason"
+            size="small"
+            style="width:55%;"
+            ref="returnReason"
+            code="SPARE_PARTS_RETURN_REASON"
+            placeholder="请选择"
+            allowClear></v-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:30%;"
+            v-model="record.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入"/>
+        </div>
+      </template>
+      <span slot="action" slot-scope="text,record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+        >
+          删除
+        </a-button>
+      </span>
+    </s-table>
+    <div class="btn-cont">
+      <a-button id="tableType1-add" type="primary" class="button-gray" @click="handleAddRow">+新增一行</a-button>
+    </div>
+    <!-- 选择产品品牌 -->
+    <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
+    <!-- 选择产品分类 -->
+    <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
+    <!-- 选择产品 -->
+    <chooseProductsModal
+      type="dealership"
+      :openModal="openProductsModal"
+      :chooseData="chooseProducts"
+      @close="openProductsModal=false"
+      @ok="handleProductsOk" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect, STable } from '@/components'
+import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
+import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
+import chooseProductsModal from '@/views/common/chooseProductsModal.vue'
+
+import { sparePartsReturnList } from '@/api/sparePartsReturn'
+export default {
+  name: 'TableType1',
+  mixins: [commonMixin],
+  components: { VSelect, STable, ChooseBrandModal, ChooseTypeModal, chooseProductsModal },
+  props: {
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      columns: [
+        { title: '产品分类', width: '20%', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '品牌', width: '30%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
+        { title: '产品', width: '35%', scopedSlots: { customRender: 'product' }, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+      ],
+      queryParam: {},
+      dataSource: [],
+      openBrandModal: false,
+      openTypeModal: false,
+      openProductsModal: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return sparePartsReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.dataSource = data.list
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 新增一行
+    handleAddRow () {
+      const _this = this
+      const newData = {
+        productTypeList: [],
+        productBrandList: [],
+        productList: []
+      }
+      _this.dataSource.push(newData)
+    },
+    // 添加产品分类
+    addClassifyTag (pos, row) {
+      this.openTypeModal = true
+    },
+    // 添加产品品牌
+    addBrandTag (pos, row) {
+      this.openBrandModal = true
+    },
+    // 添加产品
+    addProductTag () {
+      this.openProductsModal = true
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .pages-wrap{
+    .btn-cont {
+      text-align: center;
+      margin: 10px 0;
+    }
+  }
+
+</style>

+ 209 - 0
src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

@@ -0,0 +1,209 @@
+<template>
+  <div class="pages-wrap">
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      style="margin-top:10px;width:100%;"
+      ref="table"
+      size="small"
+      :showPagination="false"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      bordered>
+      <!-- 产品分类 -->
+      <template slot="productType" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productTypeList && record.productTypeList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="(con,i) in record.productTypeList" :key="i">
+                {{ con.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 品牌 -->
+      <template slot="productBrand" slot-scope="text, record">
+        <div style="max-height:64px;overflow-y:scroll;">
+          <a-row v-if="record.productBrandList && record.productBrandList.length>0">
+            <a-col :span="20">
+              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="(item,j) in record.productBrandList" :key="j">
+                {{ item.dataName }}
+              </a-tag>
+            </a-col>
+            <a-col :span="4" style="text-align:right;">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+          <a-row v-else>
+            <a-col :span="24">
+              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                <a-icon type="plus" /> 选择
+              </a-tag>
+            </a-col>
+          </a-row>
+        </div>
+      </template>
+      <!-- 设置起订量 -->
+      <template slot="setNum" slot-scope="text, record">
+        <div>
+          <v-select
+            v-model="record.returnReason"
+            size="small"
+            style="width:55%;"
+            ref="returnReason"
+            code="SPARE_PARTS_RETURN_REASON"
+            placeholder="请选择"
+            allowClear></v-select>
+          <a-input-number
+            size="small"
+            style="margin-left:10px;width:30%;"
+            v-model="record.endAmount"
+            :min="0"
+            :step="1"
+            :precision="2"
+            placeholder="请输入"/>
+        </div>
+      </template>
+      <span slot="action" slot-scope="text,record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-error"
+          @click="handleDel(record)"
+        >
+          删除
+        </a-button>
+      </span>
+    </s-table>
+    <div class="btn-cont">
+      <a-button id="tableType1-add" type="primary" class="button-gray" @click="handleAddRow">+新增一行</a-button>
+    </div>
+    <!-- 选择产品品牌 -->
+    <chooseBrandModal :openModal="openBrandModal" :chooseData="chooseBrand" @close="openBrandModal=false" @ok="handleBrandOk" />
+    <!-- 选择产品分类 -->
+    <chooseTypeModal :openModal="openTypeModal" :chooseData="chooseType" @close="openTypeModal=false" @ok="handleTypeOk" />
+    <!-- 选择产品 -->
+    <chooseProductsModal
+      type="dealership"
+      :openModal="openProductsModal"
+      :chooseData="chooseProducts"
+      @close="openProductsModal=false"
+      @ok="handleProductsOk" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect, STable } from '@/components'
+import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
+import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
+import chooseProductsModal from '@/views/common/chooseProductsModal.vue'
+
+import { sparePartsReturnList } from '@/api/sparePartsReturn'
+export default {
+  name: 'TableType3',
+  mixins: [commonMixin],
+  components: { VSelect, STable, ChooseBrandModal, ChooseTypeModal, chooseProductsModal },
+  props: {
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      columns: [
+        { title: '产品分类', width: '10%', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '品牌', width: '10%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
+        { title: '产品', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省价原价', dataIndex: 'cityPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '省价特价', dataIndex: 'cityPrice1', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '省价折扣', dataIndex: 'cityPrice2', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '市价原价', dataIndex: 'cityPrice3', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '市价特价', dataIndex: 'cityPrice4', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '市价折扣', dataIndex: 'cityPrice5', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约原价', dataIndex: 'cityPrice6', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约特价', dataIndex: 'cityPrice7', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约折扣', dataIndex: 'cityPrice8', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约原价', dataIndex: 'cityPrice9', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '设置起订量', width: '10%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ],
+      queryParam: {},
+      dataSource: [],
+      openBrandModal: false,
+      openTypeModal: false,
+      openProductsModal: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return sparePartsReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.dataSource = data.list
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 新增一行
+    handleAddRow () {
+      const _this = this
+      const newData = {
+        productTypeList: [],
+        productBrandList: [],
+        productList: []
+      }
+      _this.dataSource.push(newData)
+    },
+    // 添加产品分类
+    addClassifyTag (pos, row) {
+      this.openTypeModal = true
+    },
+    // 添加产品品牌
+    addBrandTag (pos, row) {
+      this.openBrandModal = true
+    },
+    // 添加产品
+    addProductTag () {
+      this.openProductsModal = true
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .pages-wrap{
+    .btn-cont {
+      text-align: center;
+      margin: 10px 0;
+    }
+  }
+
+</style>