浏览代码

添加id和注释

chenrui 11 月之前
父节点
当前提交
7f1df078ee
共有 20 个文件被更改,包括 452 次插入253 次删除
  1. 12 4
      src/views/basicData/transferTypeManagement/editModal.vue
  2. 9 3
      src/views/basicData/transferTypeManagement/list.vue
  3. 18 12
      src/views/basicData/warehouse/editModal.vue
  4. 8 2
      src/views/basicData/warehouse/list.vue
  5. 7 1
      src/views/basicData/warehouse/storingLocation/editModal.vue
  6. 14 7
      src/views/basicData/warehouse/storingLocation/list.vue
  7. 6 5
      src/views/promotionRulesManagement/dealerPromotions/chooseImportDealerModal.vue
  8. 8 5
      src/views/promotionRulesManagement/dealerPromotions/chooseImportModal.vue
  9. 16 8
      src/views/promotionRulesManagement/dealerPromotions/chooseProductsModal.vue
  10. 32 26
      src/views/promotionRulesManagement/dealerPromotions/detail.vue
  11. 36 27
      src/views/promotionRulesManagement/dealerPromotions/detailModal.vue
  12. 19 8
      src/views/promotionRulesManagement/dealerPromotions/editActiveEndTime.vue
  13. 4 3
      src/views/promotionRulesManagement/dealerPromotions/importDealerModa.vue
  14. 5 4
      src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue
  15. 40 27
      src/views/promotionRulesManagement/dealerPromotions/list.vue
  16. 38 29
      src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue
  17. 15 7
      src/views/promotionRulesManagement/dealerPromotions/productPreviewModal.vue
  18. 94 45
      src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue
  19. 42 17
      src/views/promotionRulesManagement/dealerPromotions/tableType1.vue
  20. 29 13
      src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

+ 12 - 4
src/views/basicData/transferTypeManagement/editModal.vue

@@ -33,8 +33,8 @@
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button id="storeTransferOut-type-edit-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-          <a-button type="primary" id="storeTransferOut-type-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="transferTypeManagementEdit-cancel" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+          <a-button type="primary" id="transferTypeManagementEdit-save" @click="handleSave">保存</a-button>
         </div>
       </a-spin>
     </div>
@@ -43,9 +43,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
-import { allocateTypeSave } from '@/api/allocateType'
 import allocateType from '@/views/common/allocateType'
+// 接口
+import { allocateTypeSave } from '@/api/allocateType'
 export default {
   name: 'TransferTypeManagementEditModal',
   mixins: [commonMixin],
@@ -65,6 +67,7 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemSn ? '编辑' : '新增') + '调拨类型'
     }
@@ -73,16 +76,19 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form 表单
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
-      allocateType: [],
+      allocateType: [], // 调拨类别
+      // 提交参数
       form: {
         name: '', // 调拨类型名称
         allocateCategory: undefined, //  调拨类别
         treeLevel: 3
       },
+      // 表单验证规则
       rules: {
         allocateCategory: [
           { required: true, message: '请选择调拨类别', trigger: 'change' }
@@ -94,6 +100,7 @@ export default {
     }
   },
   methods: {
+    // 调拨类型名称 去空格
     filterEmpty () {
       let str = this.form.name
       str = str.replace(/\ +/g, '')
@@ -101,6 +108,7 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    // 调拨类别 change
     changeCategory (v, opt) {
       this.form.allocateCategory = v && v[1] ? v[1] : ''
     },

+ 9 - 3
src/views/basicData/transferTypeManagement/list.vue

@@ -30,14 +30,14 @@
             class="button-info"
             @click="handleEdit(record)"
             v-if="$hasPermissions('B_transferTypeManagement_edit')"
-            id="transferTypeManagementList-edit-btn">编辑</a-button>
+            :id="'transferTypeManagementList-edit-btn-'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             class="button-error"
             @click="handleDel(record)"
             v-if="$hasPermissions('B_transferTypeManagement_del')"
-            id="transferTypeManagementList-del-btn">删除</a-button>
+            :id="'transferTypeManagementList-del-btn-'+record.id">删除</a-button>
           <span v-if="!$hasPermissions('B_transferTypeManagement_del') &&!$hasPermissions('B_transferTypeManagement_edit')">--</span>
         </template>
       </s-table>
@@ -49,8 +49,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import transferTypeManagementEditModal from './editModal.vue'
+// 接口
 import { allocateTypeList, allocateTypeDel } from '@/api/allocateType'
 export default {
   name: 'TransferTypeManagementList',
@@ -59,7 +61,7 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -71,10 +73,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据 有分页
         return allocateTypeList(Object.assign(parameter, {})).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
@@ -123,12 +127,14 @@ export default {
       this.openModal = false
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 185

+ 18 - 12
src/views/basicData/warehouse/editModal.vue

@@ -48,7 +48,7 @@
             <v-select
               v-model="form.warehouseType"
               ref="state"
-              id="allocateBillList-state"
+              id="warehouseEdit-state"
               code="WAREHOUSE_TYPE"
               placeholder="请选择仓库类型"
               allowClear
@@ -73,9 +73,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { warehouseSave } from '@/api/warehouse'
 import AreaList from '@/views/common/areaList.js'
+// 接口
+import { warehouseSave } from '@/api/warehouse'
 export default {
   name: 'WarehouseEditModal',
   mixins: [commonMixin],
@@ -103,22 +105,24 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // 表单 label 布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      // 提交参数
       form: {
         name: '', // 仓库名称
-        address: '',
-        addressInfo: undefined,
-        provinceSn: undefined,
-        provinceName: undefined,
-        citySn: undefined,
-        cityName: undefined,
-        districtSn: undefined,
-        districtName: undefined,
+        address: '', // 详细地址
+        addressInfo: undefined, // 选择省市区
+        provinceSn: undefined, // 省份sn
+        provinceName: undefined, // 省份名称
+        citySn: undefined, // 市sn
+        cityName: undefined, // 市名称
+        districtSn: undefined, // 区sn
+        districtName: undefined, // 区名称
         erpWarehouseCode: undefined, // ERP仓库编码
-        warehouseType: undefined
+        warehouseType: undefined// 仓库类型
       },
       rules: {
         name: [
@@ -140,6 +144,7 @@ export default {
     }
   },
   methods: {
+    // 仓库名称 去除空格
     filterEmpty () {
       let str = this.form.name
       str = str.replace(/\ +/g, '')
@@ -147,6 +152,7 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    // 地区
     areaChange (val, row) {
       this.form.addressInfo = val
       this.form.provinceSn = val[0] ? val[0] : ''
@@ -170,7 +176,7 @@ export default {
           districtSn: this.nowData.districtSn ? this.nowData.districtSn : '',
           districtName: this.nowData.districtName ? this.nowData.districtName : '',
           erpWarehouseCode: this.nowData.erpWarehouseCode ? this.nowData.erpWarehouseCode : '', // ERP仓库编码
-          warehouseType:this.nowData.warehouseType ? this.nowData.warehouseType : '',
+          warehouseType: this.nowData.warehouseType ? this.nowData.warehouseType : '',
           addressInfo: addressVal
         }
       }

+ 8 - 2
src/views/basicData/warehouse/list.vue

@@ -71,9 +71,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { warehouseList, warehouseDel } from '@/api/warehouse'
+// 组件
 import { STable } from '@/components'
 import warehouseEditModal from './editModal.vue'
+// 接口
+import { warehouseList, warehouseDel } from '@/api/warehouse'
 export default {
   name: 'WarehouseList',
   mixins: [commonMixin],
@@ -84,7 +86,7 @@ export default {
       queryParam: { //  查询条件
         name: '' //  仓库名称
       },
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
@@ -96,10 +98,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return warehouseList(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
@@ -164,12 +168,14 @@ export default {
     goStoringLocation (row) {
       this.$router.push({ path: `/basicData/storingLocation/${row.warehouseSn}`, query: { name: row.name } })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250

+ 7 - 1
src/views/basicData/warehouse/storingLocation/editModal.vue

@@ -29,7 +29,7 @@
           </a-form-model-item>
           <a-form-model-item label="所属仓库" prop="warehouseSn">
             <a-select id="storingLocationEdit-warehouseSn" disabled placeholder="请选择所属仓库" allowClear v-model="form.warehouseSn">
-              <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+              <a-select-option :id="'storingLocationEdit-warehouseSn-'+item.id" v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
             </a-select>
           </a-form-model-item>
         </a-form-model>
@@ -44,7 +44,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+// 接口
 import { warehouseLocSave, warehouseAllList } from '@/api/warehouse'
 export default {
   name: 'StoringLocationEditModal',
@@ -65,6 +67,7 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemSn ? '编辑' : '新增') + '仓位'
     }
@@ -73,14 +76,17 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单 label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      // 提交参数
       form: {
         name: '', // 仓位名称
         warehouseSn: undefined //  所属仓库
       },
+      // 表单验证规则
       rules: {
         name: [
           { required: true, message: '请输入仓位名称', trigger: 'blur' }

+ 14 - 7
src/views/basicData/warehouse/storingLocation/list.vue

@@ -11,7 +11,7 @@
       <a-card size="small" :bordered="false" class="storingLocationList-cont">
         <!-- 搜索条件 -->
         <div ref="tableSearch" class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="storingLocationList-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="仓位名称">
@@ -49,14 +49,14 @@
               class="button-info"
               v-if="record.defaultFlag!='1'"
               @click="handleEdit(record)"
-              id="storingLocationList-edit-btn">编辑</a-button>
+              :id="'storingLocationList-edit-btn-'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
               v-if="record.defaultFlag!='1'"
               @click="handleDel(record)"
-              id="storingLocationList-del-btn">删除</a-button>
+              :id="'storingLocationList-del-btn-'+record.id">删除</a-button>
             <span v-if="record.defaultFlag=='1'">--</span>
           </template>
         </s-table>
@@ -69,9 +69,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { warehouseLocList, warehouseLocDel } from '@/api/warehouse'
+// 组件
 import { STable } from '@/components'
 import storingLocationEditModal from './editModal.vue'
+// 接口
+import { warehouseLocList, warehouseLocDel } from '@/api/warehouse'
 export default {
   name: 'StoringLocationList',
   mixins: [commonMixin],
@@ -79,12 +81,13 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
         warehouseSn: this.$route.params.sn, //  仓库sn
         name: '' //  仓位名称
       },
-      disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '仓位名称', dataIndex: 'name', align: 'center', width: '45%', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -94,10 +97,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return warehouseLocList(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
@@ -168,12 +173,14 @@ export default {
     handleBack () {
       this.$router.push({ path: '/basicData/warehouse/list', query: { closeLastOldTab: true } })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 295

+ 6 - 5
src/views/promotionRulesManagement/dealerPromotions/chooseImportDealerModal.vue

@@ -1,6 +1,7 @@
 <template>
   <a-modal
     centered
+    id="chooseImport-modal"
     class="chooseImport-modal"
     :footer="null"
     :maskClosable="false"
@@ -68,6 +69,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { downDealerFail } from '@/api/promotion'
 export default {
   name: 'ChooseImportModal',
@@ -87,14 +89,13 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      loadData: [],
-      unLoadData: [],
-      loading: false
+      loadData: [], // 可导入数据
+      unLoadData: [], // 不可导入数据
+      loading: false// 表格加载状态
     }
   },
   computed: {
     nowColumns () {
-      const _this = this
       const columnsArr = [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '经销商名称', dataIndex: 'dealerName', width: '90%', align: 'center', customRender: function (text) { return text || '--' } }
@@ -102,7 +103,6 @@ export default {
       return columnsArr
     },
     nowUnColumns () {
-      const _this = this
       const unColumnsArr = [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '经销商名称', dataIndex: 'dealerName', width: '50%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -112,6 +112,7 @@ export default {
     }
   },
   methods: {
+    // 获取导入数据
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []

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

@@ -84,6 +84,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { downNormalFail, downSpecialFail } from '@/api/promotion'
 export default {
   name: 'ChooseImportModal',
@@ -103,11 +104,11 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      loadData: [],
-      unLoadData: [],
-      loading: false,
-      goodsFlag: '',
-      discountType: ''
+      loadData: [], // 可导入数据
+      unLoadData: [], // 不可导入数据
+      loading: false, // 列表加载状态
+      goodsFlag: '', // 1特价产品商品 0买产品送产品 买产品送采购额页面
+      discountType: ''// 折扣类型
     }
   },
   computed: {
@@ -149,10 +150,12 @@ export default {
     }
   },
   methods: {
+    // 判断页面来源
     setFlag (val) {
       this.goodsFlag = val.goodFlag
       this.discountType = val.discountType
     },
+    // 获取导入数据
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []

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

@@ -47,8 +47,9 @@
             </a-row>
           </a-form-model>
         </div>
+        <!-- 操作按钮 -->
         <div style="margin-bottom: 10px">
-          <a-button type="primary" ghost :loading="loading" @click="handleSave">批量添加</a-button>
+          <a-button type="primary" ghost id="chooseProducts-add" :loading="loading" @click="handleSave">批量添加</a-button>
           <span style="margin-left: 5px">
             <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
           </span>
@@ -89,10 +90,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
-import { productList } from '@/api/product'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
+// 接口
+import { productList } from '@/api/product'
 export default {
   name: 'ChooseProductsModal',
   components: { STable, ProductBrand, productTypeAll },
@@ -113,23 +116,25 @@ export default {
     const _this = this
     return {
       spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
       isShow: this.openModal, //  是否打开弹框
+      // form表单label 布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
-      queryParam: { //  查询条件
+      //  查询条件
+      queryParam: {
         name: '', // 产品名称
         code: '', //  产品编码
         productBrandSn: undefined, //  产品品牌
-        productType: [],
+        productType: [], // 产品分类
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
-      chooseDataList: [],
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false, //  表格加载中
+      chooseDataList: [], // 已选择被禁用的数据
       columns: [
         { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
         { title: '产品编码', dataIndex: 'code', align: 'center' },
@@ -148,10 +153,12 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        // 获取列表数据 有分页
         return productList(params).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
@@ -162,10 +169,11 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 表格选中项
     }
   },
   computed: {
+    // 计算表格选中条数
     selectCount () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }

+ 32 - 26
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -1,17 +1,17 @@
 <template>
-  <div class="salesDetail-wrap">
+  <div class="promotionDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" style="padding:16px 24px;">
+      <a-page-header :ghost="false" :backIcon="false" class="promotionDetail-cont" style="padding:16px 24px;">
         <template slot="subTitle">
-          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+          <a href="javascript:;" id="promotionDetail-back" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
           <span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">促销名称:{{ detailData&&detailData.title||'--' }}</span>
-          <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
+          <a-button type="link" class="button-default" id="promotionDetail-showInfo" @click="isShowBisiceInfo=!isShowBisiceInfo">
             <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
           </a-button>
         </template>
       </a-page-header>
       <!-- 基础信息 -->
-      <a-card size="small" title="基础信息" :bordered="false" v-show="!isShowBisiceInfo" class="salesDetail-cont">
+      <a-card size="small" title="基础信息" :bordered="false" v-show="!isShowBisiceInfo" class="promotionDetail-cont">
         <a-descriptions size="small" v-if="detailData">
           <a-descriptions-item label="促销名称">{{ detailData.title || '--' }}</a-descriptions-item>
           <a-descriptions-item label="促销简称">{{ detailData.description || '--' }}</a-descriptions-item>
@@ -29,6 +29,7 @@
           <a-descriptions-item label="附件" :span="3">
             <div class="attachmentBox" v-if="detailData.attachmentList&&detailData.attachmentList.length>0">
               <a
+                id="promotionDetail-downloadFile"
                 class="link-bule"
                 target="downloadFile"
                 :href="item.filePath"
@@ -42,9 +43,9 @@
       </a-card>
       <a-card size="small" title="规则设置" :bordered="false" class="pages-wrap">
         <div class="btnGroup" v-if="$hasPermissions('B_rulesAddEdit')&&$route.query.type=='rule'">
-          <a-button type="primary" class="button-info" @click="openBtnModal('SendProducts')" :disabled="disabled">买产品送产品</a-button>
-          <a-button type="primary" class="button-info" @click="openBtnModal('SendAmount')" :disabled="disabled">买产品送采购额</a-button>
-          <a-button type="primary" style="margin-left:5px;" @click="openBtnModal('SpecialOffer')" :disabled="disabled">特价产品</a-button>
+          <a-button type="primary" class="button-info" id="promotionDetail-sendProducts" @click="openBtnModal('SendProducts')" :disabled="disabled">买产品送产品</a-button>
+          <a-button type="primary" class="button-info" id="promotionDetail-sendAmount" @click="openBtnModal('SendAmount')" :disabled="disabled">买产品送采购额</a-button>
+          <a-button type="primary" style="margin-left:5px;" id="promotionDetail-specialOffer" @click="openBtnModal('SpecialOffer')" :disabled="disabled">特价产品</a-button>
         </div>
         <!-- 列表 -->
         <s-table
@@ -112,21 +113,21 @@
               type="link"
               @click="handleEdit(record)"
               class="button-info"
-              id="promotionList-edit-btn">编辑</a-button>
+              :id="'promotionDetail-edit-btn-'+record.id">编辑</a-button>
             <a-button
               v-if="$hasPermissions('B_rulesDel')&&$route.query.type=='rule'"
               size="small"
               type="link"
               @click="handleDel(record)"
               class="button-error"
-              id="promotionList-del-btn">删除</a-button>
+              :id="'promotionDetail-del-btn-'+record.id">删除</a-button>
             <a-button
               v-if="$hasPermissions('B_dealerPromotionDetail')&&!$route.query.type"
               size="small"
               type="link"
               @click="handleDetail(record)"
               class="button-info"
-              id="promotionList-edit-btn">详情</a-button>
+              :id="'promotionDetail-info-btn-'+record.id">详情</a-button>
           </template>
         </s-table>
       </a-card>
@@ -135,6 +136,7 @@
       <a-button
         type="primary"
         class="button-info"
+        id="promotionDetail-submit"
         size="large"
         style="padding:0 40px;"
         @click="handleSubmit"
@@ -158,6 +160,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
 import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
 import brandCategoryModal from './brandCategoryModal'
@@ -165,31 +168,33 @@ import detailModal from './detailModal'
 import sendProductsModal from './sendProductsModal'
 import sendAmountModal from './sendAmountModal'
 import specialOfferModal from './specialOfferModal'
+// 接口
 import { getRuleQueryList, dealerPromotionInfo, promotionRulesDel, promotionSubmit } from '@/api/promotion'
 export default {
-  name: 'SalesOrderWarehouseDetail',
+  name: 'DealerPromotionsDetail',
   mixins: [commonMixin],
   components: { STable, lookUpCustomersModal, brandCategoryModal, detailModal, sendProductsModal, sendAmountModal, specialOfferModal },
   data () {
     return {
-      disabled: false,
       spinning: false,
+      fromRouter: null,
+      disabled: false, // 提交按钮是否可操作
       detailData: null, //  详情数据
       countData: null, // 数量数据
-      fromRouter: null,
-      openModal: false,
-      isShowBisiceInfo: false,
-      openCustomerModal: false,
-      openType: undefined,
-      openDetailModal: false,
-      openSendProductsModal: false,
-      openSendAmountModal: false,
-      openSpecialOfferModal: false,
+      openModal: false, // 促销品费用归属品牌/促销品费用归属品类弹窗
+      openType: undefined, // 打开弹窗类型
+      isShowBisiceInfo: false, // 显示隐藏基础信息
+      openCustomerModal: false, // 查看客户弹窗
+      openDetailModal: false, // 详情弹窗
+      openSendProductsModal: false, // 买产品送产品弹窗
+      openSendAmountModal: false, // 买产品送采购额弹窗
+      openSpecialOfferModal: false, // 特价产品弹窗
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const dataAjax = Object.assign(parameter, { promotionSn: this.$route.query.sn })
+        // 获取列表数据 无分页
         return getRuleQueryList(dataAjax).then(res => {
           let data
           if (res.status == 200) {
@@ -204,8 +209,8 @@ export default {
           return data
         })
       },
-      detailSn: null,
-      mainContentList: [],
+      detailSn: null, // 当前sn
+      mainContentList: [], // 列表数据
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
         { title: '促销类型', dataIndex: 'promotionRuleTypeDictValue', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -293,6 +298,7 @@ export default {
         _this.disabled = false
       })
     },
+    // 编辑
     handleEdit (row) {
       this.detailSn = row.promotionRuleSn
       if (row.promotionRuleType === 'BUY_PROD_GIVE_PROD') {
@@ -324,13 +330,13 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .salesDetail-wrap{
+  .promotionDetail-wrap{
    position: relative;
    height: 100%;
    padding-bottom: 71px;
    box-sizing: border-box;
    transform: translateZ(0);
-    .salesDetail-cont{
+    .promotionDetail-cont{
       margin-bottom: 6px;
     }
     .btnGroup{

+ 36 - 27
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -77,7 +77,7 @@
       </a-form-model>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <div class="flex">
-          <a-radio-group v-model="chooseVal" button-style="solid" @change="onChange">
+          <a-radio-group v-model="chooseVal" button-style="solid" id="dealerPromotions-basicInfo-radio" @change="onChange">
             <a-radio-button value="a" v-show="form.gateFlag==='1'">
               门槛产品
             </a-radio-button>
@@ -94,7 +94,7 @@
               特价产品
             </a-radio-button>
           </a-radio-group>
-          <a-button type="link" v-show="isShowPreview" class="button-info" @click="handlePreview">预览</a-button>
+          <a-button type="link" v-show="isShowPreview" class="button-info" id="dealerPromotions-basicInfo-preview" @click="handlePreview">预览</a-button>
         </div>
         <!-- 列表 -->
         <div v-show="chooseVal==='a'||chooseVal==='b'||chooseVal==='c'">
@@ -218,7 +218,7 @@
         </div>
       </a-card>
       <div class="btn-cont">
-        <a-button id="dealerPromotions-basicInfo-modal-back" @click="isShow = false">关闭</a-button>
+        <a-button id="dealerPromotions-basicInfo-back" @click="isShow = false">关闭</a-button>
       </div>
     </a-spin>
     <!-- 预览弹窗 -->
@@ -228,8 +228,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { getRuleDetail } from '@/api/promotion'
+// 组件
 import productPreviewModal from './productPreviewModal'
+// 接口
+import { getRuleDetail } from '@/api/promotion'
 export default {
   name: 'DetailModal',
   mixins: [commonMixin],
@@ -243,45 +245,46 @@ export default {
       type: String,
       default: ''
     },
-    pageType:{
+    pageType: {
       type: String,
       default: 'promotionsPage'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // form表单 label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
+      // 提交参数
       form: {
-        promotionRuleType: undefined,
-        gateFlag: undefined, // 门槛
-        gateValue: undefined,
-        quotaAmount: undefined,
+        promotionRuleType: undefined, // 规则类型  BUY_PROD_GIVE_PROD 买产品送产品 BUY_PROD_GIVE_MONEY 买产品送采购额 PROMO_PROD特价产品
+        gateFlag: undefined, // 是否有门槛产品
+        gateValue: undefined, // 门槛产品值
+        quotaAmount: undefined, // 门槛产品配额值
         regularSameFlag: undefined, // 满赠规则  不同款商品
         regularQty: undefined,
         promotionQty: undefined,
         regularAmount: undefined,
         giveAmount: undefined,
-        restrictFlag: undefined, // 限制正价产品款数
-        restrictCategory: undefined,
-        accrualFlag: undefined, // 数量叠加
+        restrictFlag: undefined, // 是否限制正价产品款数
+        restrictCategory: undefined, // 正价产品限制款数
+        accrualFlag: undefined, // 是否数量叠加
         minOrderFlag: undefined, // 起订金额
         minOrderAmount: undefined,
         upperLimitFlag: undefined, // 活动经费上限
         upperLimitAmount: undefined,
-        regularPromotionSameFlag: undefined,
-        productTypeArr: [],
-        productTypeList: [],
-        productBrandArr: [],
-        productBrandList: [],
-        productThisList: []
+        regularPromotionSameFlag: undefined, // 促销品是否与正品一致 1是 0否
+        productTypeArr: [], // 所选产品分类(渲染)
+        productTypeList: [], // 所选产品分类(后台所需数据)
+        productBrandArr: [], // 所选产品品牌(渲染)
+        productBrandList: [], // 所选产品品牌(后台所需数据)
+        productThisList: []// 所选产品
       },
-
-      chooseVal: 'a',
+      chooseVal: 'a', // tab所选列表值
       columns: [
         { title: '产品分类', width: '30%', scopedSlots: { customRender: 'productType' }, align: 'center' },
         { title: '品牌', width: '35%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
@@ -294,10 +297,12 @@ export default {
     }
   },
   computed: {
+    // 计算满赠规则  配额比例
     perCentNum () {
       const val = (this.form.giveRuleList[0].regularValue && this.form.giveRuleList[0].regularValue != 0) ? ((this.form.giveRuleList[0].promotionValue / this.form.giveRuleList[0].regularValue) * 100).toFixed(2) : '0.00'
       return val
     },
+    // 特价产品 判断不同折扣类型显示不同表头
     setColumns () {
       const _this = this
       var arr = []
@@ -316,6 +321,7 @@ export default {
       }
       return arr
     },
+    // 特加产品表格表头
     specialColumns () {
       const _this = this
       const arr = [
@@ -375,17 +381,17 @@ export default {
           const resultObj = res.data
           if (resultObj.gateFlag == '1') {
             this.chooseVal = 'a'
-            this.isShowPreview =this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.gateProductList)
+            this.isShowPreview = this.pageType === 'salesPage' ? false : this.judgeBtnShow(res.data.gateProductList)
           } else {
             if (resultObj.promotionRuleType == 'BUY_PROD_GIVE_PROD') {
               this.chooseVal = 'b'
-              this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.regularProductList)
+              this.isShowPreview = this.pageType === 'salesPage' ? false : this.judgeBtnShow(res.data.regularProductList)
             } else if (resultObj.promotionRuleType == 'BUY_PROD_GIVE_MONEY') {
               this.chooseVal = 'b'
-              this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.regularProductList)
+              this.isShowPreview = this.pageType === 'salesPage' ? false : this.judgeBtnShow(res.data.regularProductList)
             } else {
               this.chooseVal = 'd'
-              this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(res.data.specialProductList)
+              this.isShowPreview = this.pageType === 'salesPage' ? false : this.judgeBtnShow(res.data.specialProductList)
             }
           }
           this.form = { ...this.form, ...resultObj }
@@ -402,6 +408,7 @@ export default {
       const hasData = conData.some(item => item.productThisList)
       return hasData
     },
+    // 获取预览数据
     getPreviewList (dataList) {
       let newList = []
       dataList.forEach(con => {
@@ -447,19 +454,21 @@ export default {
       }
       this.openProductModal = true
     },
+    // 关闭产品弹窗
     closeProductModal () {
       this.previewList = []
       this.openProductModal = false
     },
+    // 处理阶梯显示数据
     onChange () {
       const dataName = this.chooseVal === 'a' ? 'gate' : this.chooseVal === 'b' ? 'regular' : this.chooseVal === 'c' ? 'gift' : this.chooseVal === 'd' ? 'special' : 'giftGroup'
       if (dataName != 'giftGroup') {
-        this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(this.form[dataName + 'ProductList'])
+        this.isShowPreview = this.pageType === 'salesPage' ? false : this.judgeBtnShow(this.form[dataName + 'ProductList'])
       } else {
         // 阶梯数据处理
         const pos = this.chooseVal.split('')[1]
         if (this.form.giftProductMap && Object.keys(this.form.giftProductMap).length > 0) {
-          this.isShowPreview = this.pageType==='salesPage'? false:this.judgeBtnShow(this.form.giftProductMap['GIFT' + (pos * 1 + 1)])
+          this.isShowPreview = this.pageType === 'salesPage' ? false : this.judgeBtnShow(this.form.giftProductMap['GIFT' + (pos * 1 + 1)])
         }
       }
     }

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

@@ -1,6 +1,7 @@
 <template>
   <a-modal
     centered
+    id="editActiveEndTime-basicInfo-modal"
     class="editActiveEndTime-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
@@ -21,11 +22,17 @@
           <span>{{ form.timeEnd }}</span>
         </a-form-model-item>
         <a-form-model-item label="变更后结束日期" prop="newTimeEnd">
-          <a-date-picker style="width:90%" v-model="form.newTimeEnd" @change="onChange" :format="dateFormat" :disabled-date="disabledDate"/>
+          <a-date-picker
+            id="editActiveEndTime-basicInfo-newTimeEnd"
+            style="width:90%"
+            v-model="form.newTimeEnd"
+            @change="onChange"
+            :format="dateFormat"
+            :disabled-date="disabledDate"/>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="editActiveEndTime-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button id="editActiveEndTime-modal-back" @click="isShow = false">取消</a-button>
         <a-button style="margin-left: 15px;" type="primary" id="editActiveEndTime-modal-save" @click="handleSave">确定</a-button>
       </div>
     </a-spin>
@@ -35,6 +42,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+// 接口
 import { promotionDateModify } from '@/api/promotion'
 export default {
   name: 'EditActiveEndTimeModal',
@@ -46,19 +54,21 @@ export default {
     } },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // form表单 label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
       form: {
-        name: '',
-        timeStart: '',
-        timeEnd: '',
-        newTimeEnd: undefined
+        name: '', // 促销规则名称
+        timeStart: '', // 开始时间
+        timeEnd: '', // 结束时间
+        newTimeEnd: undefined// 新变更时间
       },
-      dateFormat: 'YYYY-MM-DD',
+      dateFormat: 'YYYY-MM-DD', // 时间显示格式
+      // 表单规则验证
       rules: {
         newTimeEnd: [
           { required: true, message: '请选择变更的结束时间', trigger: 'change' }
@@ -67,6 +77,7 @@ export default {
     }
   },
   methods: {
+    // 选择变更时间
     onChange (date, dateString) {
       if (date) {
         this.form.newTimeEnd = dateString + ' 23:59:59'

+ 4 - 3
src/views/promotionRulesManagement/dealerPromotions/importDealerModa.vue

@@ -18,7 +18,7 @@
             <li>1)请先下载导入模板,模板中已标示出必填项 </li>
             <li>2) “经销商名称”具有唯一性,需输入完整经销商名称,不能为空,不可重复,需是系统中已存在的经销商</li>
             <li>
-              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+              <a :href="filePath" style="margin: 5px 0 0;display: block;" id="importGuide-download">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
               </a>
             </li>
@@ -66,6 +66,7 @@
 </template>
 
 <script>
+// 组件
 import ChooseImportModal from './chooseImportDealerModal.vue'
 import { Upload } from '@/components'
 export default {
@@ -86,8 +87,8 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
       attachAction: process.env.VUE_APP_API_BASE_URL + '/promotion/dealer/importDealer', // 导入门槛、正价、促销产品
-      paramsData: null,
-      filePath: ''
+      paramsData: null, // 上传参数
+      filePath: ''// 上传文件路径
     }
   },
   methods: {

+ 5 - 4
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -21,7 +21,7 @@
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
             <li>3)起订类型和起订数量非必填:起订类型为空则默认为“按数量设置”,起订数量为空则默认为“1”。</li>
             <li>
-              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+              <a :href="filePath" style="margin: 5px 0 0;display: block;" id="importGuide-download">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
               </a>
             </li>
@@ -70,6 +70,7 @@
 </template>
 
 <script>
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
 export default {
@@ -99,9 +100,9 @@ export default {
       openImportModal: false, //  导入
       attachAction: process.env.VUE_APP_API_BASE_URL + '/promotion/rule/importNormalProduct', // 导入门槛、正价、促销产品
       attachAction1: process.env.VUE_APP_API_BASE_URL + '/promotion/rule/importSpecialProduct', // 导入特价产品
-      paramsData: null,
-      filePath: '',
-      uploadData: null
+      paramsData: null, // 上传参数
+      filePath: '', // 上传文件路径
+      uploadData: null// 上传数据
     }
   },
   methods: {

+ 40 - 27
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -3,11 +3,11 @@
     <a-card size="small" :bordered="false" class="promotionList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="promotionList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate ref="rangeDate" @change="dateChange" id="promotionList-rangeDate" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -83,6 +83,7 @@
           :style="{ height: tableHeight+70+'px' }"
           size="small"
           :rowKey="(record) => record.sparePartsReturnNo"
+          rowKeyName="sparePartsReturnNo"
           :columns="columns"
           :data="loadData"
           :scroll="{ y: tableHeight }"
@@ -90,7 +91,7 @@
           bordered>
           <!-- 促销名称 -->
           <template slot="promotionName" slot-scope="text, record">
-            <div v-if="$hasPermissions('B_dealerPromotionDetail')" class="link-bule nameBox text-overflows2" @click="handleDetail(record)">{{ record.title }}</div>
+            <div :id="'promotionList-info-'+record.sparePartsReturnNo" v-if="$hasPermissions('B_dealerPromotionDetail')" class="link-bule nameBox text-overflows2" @click="handleDetail(record)">{{ record.title }}</div>
             <div v-else class="nameBox text-overflows2">{{ record.title }}</div>
           </template>
           <!-- 促销时间-->
@@ -99,15 +100,15 @@
           </template>
           <!-- 参与客户 -->
           <template slot="joinCustomers" slot-scope="text, record">
-            <span class="joinCustomer" v-if="record.dealerScope ==='ALL_DEALER'" @click="handleCustomers(record)">全部客户</span>
-            <span class="joinCustomer" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerQty ||0 }}</span>个客户</span>
+            <span class="joinCustomer" :id="'promotionList-customers-'+record.sparePartsReturnNo" v-if="record.dealerScope ==='ALL_DEALER'" @click="handleCustomers(record)">全部客户</span>
+            <span class="joinCustomer" :id="'promotionList-customers-'+record.sparePartsReturnNo" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerQty ||0 }}</span>个客户</span>
             <a-badge count="审" v-show="record.dealerAuditFlag == 1 &&(record.state==='NOT_START'||record.state==='RUNNING') " :number-style="{ backgroundColor: '#F5222D', zoom:'80%' }" />
           </template>
           <!-- 发布状态 -->
           <template slot="releaseStatus" slot-scope="text, record">
             <a-switch
               v-if="$hasPermissions('B_dealerPromotionStatus')"
-              id="promotionList-enable"
+              :id="'promotionList-enable-'+record.sparePartsReturnNo"
               @change="changeStatus(record)"
               :disabled="record.state!='NOT_START' && record.state!='RUNNING'"
               :checked="record.enabledFlag == 1 ? true : false"></a-switch>
@@ -122,49 +123,49 @@
               class="button-warning"
               @click="handleSetRules(record)"
               v-if="$hasPermissions('B_dealerPromotionRules')&&(record.state =='WAIT_SUBMIT'||record.state == 'AUDIT_REJECT')"
-              id="allocateBillList-examine-btn">规则设置</a-button>
+              :id="'promotionList-examine-btn'+record.sparePartsReturnNo">规则设置</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_dealerPromotionEdit')&&(record.state == 'WAIT_SUBMIT' ||record.state == 'AUDIT_REJECT')"
               @click="handleEdit(record)"
               class="button-info"
-              id="promotionList-edit-btn">编辑</a-button>
+              :id="'promotionList-edit-btn'+record.sparePartsReturnNo">编辑</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_dealerPromotionAudit')&&record.state == 'WAIT_AUDIT'"
               @click="handleCheck(record)"
               class="button-info"
-              id="promotionList-edit-btn">审核</a-button>
+              :id="'promotionList-audit-btn'+record.sparePartsReturnNo">审核</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_editTime')&&(record.state == 'NOT_START' || record.state=='RUNNING' ||record.state == 'IS_OVER')"
               @click="handleTime(record)"
               class="button-info"
-              id="promotionList-edit-btn">时间变更</a-button>
+              :id="'promotionList-editTime-btn'+record.sparePartsReturnNo">时间变更</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_overActive')&&(record.state == 'NO_START' || record.state=='RUNNING')"
               @click="handleEnd(record)"
               class="button-info"
-              id="promotionList-edit-btn">终止</a-button>
+              :id="'promotionList-edit-btn'+record.sparePartsReturnNo">终止</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_dealerPromotionDel')&&(record.state == 'WAIT_SUBMIT'||record.state == 'AUDIT_REJECT')"
               @click="handleDel(record)"
               class="button-error"
-              id="promotionList-del-btn">删除</a-button>
+              :id="'promotionList-del-btn'+record.sparePartsReturnNo">删除</a-button>
             <a-button
               size="small"
               type="link"
               v-if="record.state != 'AUDIT_REJECT' &&$hasPermissions('B_dealerPromotionCopy')"
               @click="handleCopyModal(record)"
               class="button-info"
-              id="promotionList-edit-btn">复制</a-button>
+              :id="'promotionList-copy-btn'+record.sparePartsReturnNo">复制</a-button>
           </template>
         </s-table>
       </a-spin>
@@ -246,9 +247,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
-import lookUpCustomersModal from './lookUpCustomersModal' 
+import lookUpCustomersModal from './lookUpCustomersModal'
 import rangeDate from '@/views/common/rangeDate.vue'
 import creatorList from '@/views/common/creatorList.vue'
 import editActiveEndTime from './editActiveEndTime.vue'
@@ -256,6 +258,7 @@ import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import custList from '@/views/common/custList.vue'
 import debounce from 'lodash/debounce'
+// 接口
 import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, midwaySubmit, dealerMidwayAudit, updateDealerSnList } from '@/api/promotion'
 export default {
   name: 'PromotionManagementList',
@@ -270,17 +273,17 @@ export default {
       openCustomerModal: false, // 参与客户弹窗
       editEndModal: false, // 更改促销时间
       openDetailModal: false, // 详情弹窗
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       // 查询参数
       queryParam: {
-        beginDate: undefined,
-        endDate: undefined,
-        queryWord: '',
+        beginDate: undefined, // 开始时间
+        endDate: undefined, // 结束时间
+        queryWord: '', // 促销名称/简称
         enabledFlag: undefined, // 发布状态
-        state: undefined,
-        creatorId: undefined,
-        dealerAuditFlag: undefined,
-        dealerSn: undefined
+        state: undefined, // 活动状态
+        creatorId: undefined, // 创建人
+        dealerAuditFlag: undefined, // 审核  0 不通过 1通过
+        dealerSn: undefined// 经销商
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -299,10 +302,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return dealerPromotionList(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
@@ -316,10 +321,10 @@ export default {
       itemSn: null, // 经销商促销活动SN
       openAuditModal: false, // 审核弹窗,
       openCopyModal: false, // 复制弹窗
-      itemPromotionSn: '',
-      itemStatusType: '',
+      itemPromotionSn: '', // 参与客户,当前sn
+      itemStatusType: '', // 按你加载类型 isEdit 编辑 isAudit 审核 isClose关闭
       chooseDealerArr: [], // 所选择经销商列表
-      loadingAudit: false
+      loadingAudit: false// 审核按钮加载状态
     }
   },
   methods: {
@@ -407,13 +412,16 @@ export default {
       _this.itemSn = row.promotionSn
       _this.openAuditModal = true
     },
+    // 打开审核弹窗
     handleAuditModal () {
       this.loadingAudit = true
       this.handleAudit({ promotionSn: this.itemSn, auditFlag: 1 })
     },
+    // 关闭审核弹窗
     closeAuditModal () {
       this.handleAudit({ promotionSn: this.itemSn, auditFlag: 0 })
     },
+    // 审核
     handleAudit (ajaxData) {
       const _this = this
       _this.spinning = true
@@ -428,13 +436,14 @@ export default {
         _this.loadingAudit = false
       })
     },
-    // 复制
+    // 打开复制弹窗
     handleCopyModal (row) {
       this.itemSn = row.promotionSn
       this.$nextTick(() => {
         this.openCopyModal = true
       })
     },
+    // 复制
     handleCopy () {
       const _this = this
       _this.spinning = true
@@ -448,6 +457,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 关闭复制弹窗
     closeCopyModal () {
       this.itemSn = null
       this.openCopyModal = false
@@ -520,6 +530,7 @@ export default {
         }
       })
     },
+    // 参与客户
     auditCustomerOk (con) {
       const _this = this
       dealerMidwayAudit({ promotionSn: _this.itemPromotionSn, dealerAuditStatus: con }).then(res => {
@@ -529,6 +540,7 @@ export default {
         }
       })
     },
+    // 关闭参与客户弹窗
     closeCustomer () {
       this.openCustomerModal = false
       this.itemPromotionSn = ''
@@ -558,7 +570,7 @@ export default {
       this.$refs.rangeDate.resetDate()
       this.$refs.table.refresh(true)
     },
-
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -569,6 +581,7 @@ export default {
       this.itemSn = null
       this.$refs.table.clearTable()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 235

+ 38 - 29
src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue

@@ -12,17 +12,17 @@
       <a-card size="small" :bordered="false">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="lookUpCustomers-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区">
+                <a-form-item label="地区">
                   <AreaList id="lookUpCustomers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="区域/分区">
+                <a-form-item label="区域/分区">
                   <subarea ref="subarea" id="lookUpCustomers-subarea" @change="subareaChange"></subarea>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="经销商名称">
@@ -42,9 +42,10 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="lookUpCustomers-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="lookUpCustomers-reset">重置</a-button>
                 <a-button
+                  id="lookUpCustomers-export"
                   style="margin-left: 10px"
                   type="primary"
                   class="button-warning"
@@ -86,18 +87,23 @@
       </a-card>
       <div style="text-align:right;color:#666;" v-if="showType ==='isEdit' || showType === 'isAudit'"><span v-if="showType === 'isAudit'">待审核,</span>增加的客户显示红色,删除的客户显示绿色</div>
       <div class="btn-cont" v-if="showType ==='isEdit'">
-        <a-button type="primary" class="button-warning" @click="editDealerModal">修改</a-button>
-        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="submitAudit">提交审核</a-button>
+        <a-button type="primary" id="lookUpCustomers-edit-btn" class="button-warning" @click="editDealerModal">修改</a-button>
+        <a-button
+          type="primary"
+          id="lookUpCustomers-save-btn"
+          style="margin-left: 15px;"
+          :loading="spinning"
+          @click="submitAudit">提交审核</a-button>
       </div>
       <div class="btn-cont" v-if="showType === 'isAudit'&& $hasPermissions('B_dealerAudit')">
-        <a-button @click="handleAudit('AUDIT_REJECT')">审核不通过</a-button>
-        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleAudit('AUDIT_PASS')">审核通过</a-button>
+        <a-button id="lookUpCustomers-audit-btn" @click="handleAudit('AUDIT_REJECT')">审核不通过</a-button>
+        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="lookUpCustomers-modal-audit" @click="handleAudit('AUDIT_PASS')">审核通过</a-button>
       </div>
       <div class="btn-cont" v-if="showType === 'isAudit' && !$hasPermissions('B_dealerAudit')">
-        <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
+        <a-button id="lookUpCustomers-modal-close" @click="isShow = false">关闭</a-button>
       </div>
       <div class="btn-cont" v-if="showType === 'isClose'">
-        <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
+        <a-button id="lookUpCustomers-modal-close" @click="isShow = false">关闭</a-button>
       </div>
     </a-spin>
     <!-- 选择参与客户 -->
@@ -119,14 +125,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
+import chooseDealer from './chooseDealer'
+// 接口
 import { dealerExport } from '@/api/promoTerminal'
 import { queryAuditPageList, dealerMidwayUpdate } from '@/api/promotion'
-import chooseDealer from './chooseDealer'
-
 export default {
   name: 'LookUpCustomersModal',
   components: { STable, subarea, AreaList, chooseDealer },
@@ -155,29 +162,32 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      disabled: false,
-      exportLoading: false,
+      disabled: false, // 重置、查询按钮是否可以操作
+      exportLoading: false, // 导出按钮加载状态
+      // 查询参数
       queryParam: {
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        dealerName: '',
-        state: undefined
+        provinceSn: undefined, // 省
+        citySn: undefined, // 市
+        districtSn: undefined, // 区
+        dealerName: '', // 经销商名称
+        state: undefined// 客户状态
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         this.queryParam.promotionSn = this.itemSn
+        // 获取列表数据 有分页
         const params = Object.assign(parameter, this.queryParam)
         return queryAuditPageList(params).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
@@ -199,14 +209,10 @@ export default {
         // { title: '客户状态', scopedSlots: { customRender: 'dealerState' }, width: '10%', align: 'center' }
       ],
       openDealerModal: false, // 修改弹窗
-      updateFlag: false
+      updateFlag: false// 是否刷新页面
     }
   },
   methods: {
-    // 客户状态
-    changeStatus (e) {
-
-    },
     // 修改参与客户
     editDealerModal () {
       const _this = this
@@ -246,11 +252,13 @@ export default {
         }
       })
     },
+    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -291,6 +299,7 @@ export default {
       this.$emit('submitAudit')
       this.isShow = false
     },
+    // 关闭审核弹窗
     handleAudit (statusInfo) {
       this.$emit('handleAudit', statusInfo)
       this.isShow = false

+ 15 - 7
src/views/promotionRulesManagement/dealerPromotions/productPreviewModal.vue

@@ -23,7 +23,13 @@
         <div v-show="newDataList&&newDataList.length==0" class="empty-data" style="height:'300px'"><a-empty description="暂无数据" :image="simpleImage"/></div>
       </div>
       <div class="btn-cont">
-        <a-button type="primary" v-if="resObj&&resObj.promotionRuleSn" style="margin-right:20px;" @click="handleExport" :loading="exportLoading">导出</a-button>
+        <a-button
+          type="primary"
+          id="productPreview-export"
+          v-if="resObj&&resObj.promotionRuleSn"
+          style="margin-right:20px;"
+          @click="handleExport"
+          :loading="exportLoading">导出</a-button>
         <a-button id="productPreview-back" @click="isShow = false">关闭</a-button>
       </div>
     </a-spin>
@@ -33,6 +39,7 @@
 <script>
 import { Empty } from 'ant-design-vue'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { excelProductExcel } from '@/api/promotion'
 export default {
   name: 'ProductPreviewModal',
@@ -50,21 +57,22 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      titName: '',
-      resObj: {},
-      exportLoading: false,
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 空数据图片
+      titName: '', // 弹窗标题
+      resObj: {}, // 预览数据
+      exportLoading: false, // 导出按钮加载状态
       columns: [
         { title: '序号', field: 'no', key: 'a', width: 20, align: 'center', operationColumn: false },
         { title: '产品编码', field: 'productCode', key: 'b', width: '45%', align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
         { title: '起订量', field: 'unitTypeInfo', key: 'c', width: '45%', align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } }
       ],
-      newDataList: this.dataList
+      newDataList: this.dataList// 列表数据
     }
   },
   methods: {
+    // 初始化
     pageInit (obj) {
       this.resObj = obj
     },

+ 94 - 45
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -27,11 +27,11 @@
         </a-form-model-item>
         <a-form-model-item label="规则门槛" prop="gateFlag">
           <div class="fixWidthBox">
-            <a-radio-group v-model="form.gateFlag" button-style="solid" size="small" @change="changeGateFlag">
-              <a-radio-button value="1">
+            <a-radio-group id="promotionList-gateFlag" v-model="form.gateFlag" button-style="solid" size="small" @change="changeGateFlag">
+              <a-radio-button id="promotionList-gateFlag1" value="1">
               </a-radio-button>
-              <a-radio-button value="0">
+              <a-radio-button id="promotionList-gateFlag0" value="0">
               </a-radio-button>
             </a-radio-group>
@@ -47,29 +47,59 @@
               @change="changeGateTypeFlag"
               allowClear></v-select>
             <div v-if="form.gateType==='RATIO_AMOUNT'">
-              购买门槛产品金额 <a-input-number v-model="form.gateValue" :min="0" :max="999999" :precision="2" size="small"/> %作为配额
+              购买门槛产品金额 <a-input-number
+                id="promotionList-gateValue"
+                v-model="form.gateValue"
+                :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.gateValue" :max="999999" :min="0" :precision="2" size="small"/>元,不限制配额。
+              购买门槛产品满最低金额 <a-input-number
+                id="promotionList-gateValue"
+                v-model="form.gateValue"
+                :max="999999"
+                :min="0"
+                :precision="2"
+                size="small"/>元,不限制配额。
             </div>
             <div class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
               购买满
-              <a-input-number v-model="form.gateValue" :min="0" :max="999999" :precision="2" size="small"/>
+              <a-input-number
+                id="promotionList-gateValue"
+                v-model="form.gateValue"
+                :min="0"
+                :max="999999"
+                :precision="2"
+                size="small"/>
               元门槛产品,可使用
-              <a-input-number v-model="form.quotaAmount" :min="0" :max="999999" :precision="2" size="small"/>
+              <a-input-number
+                v-model="form.quotaAmount"
+                id="promotionList-quotaAmount"
+                :min="0"
+                :max="999999"
+                :precision="2"
+                size="small"/>
               元配额,采购规则中的正价商品(配额算销售额)
             </div>
           </div>
         </a-form-model-item>
         <a-form-model-item label="满赠规则" prop="giveRuleType">
-          <a-select default-value="SUM_MONEY" v-model="form.giveRuleType" style="width: 160px" size="small" @change="handleRuleType">
-            <a-select-option value="SUM_MONEY">
+          <a-select
+            default-value="SUM_MONEY"
+            id="promotionList-giveRuleType"
+            v-model="form.giveRuleType"
+            style="width: 160px"
+            size="small"
+            @change="handleRuleType">
+            <a-select-option id="promotionList-giveRuleType1" value="SUM_MONEY">
               金额叠加
             </a-select-option>
-            <a-select-option value="RATIO">
+            <a-select-option id="promotionList-giveRuleType2" value="RATIO">
               按比例
             </a-select-option>
           </a-select>
@@ -84,6 +114,7 @@
             <a-input-number
               v-model="fullGiftRuleList[0].regularValue"
               @blur="calculatePrice"
+              id="promotionList-regularValue"
               :max="99999999"
               :step="1"
               :precision="form.regularUnit==='YUAN'?2:0"
@@ -93,12 +124,13 @@
               default-value="YUAN"
               v-model="form.regularUnit"
               style="width: 50px;margin-left:5px;"
+              id="promotionList-regularUnit"
               size="small"
               @change="handleUnit">
-              <a-select-option value="YUAN">
+              <a-select-option value="YUAN" id="promotionList-yuan">
               </a-select-option>
-              <a-select-option value="GE">
+              <a-select-option value="GE" id="promotionList-ge">
               </a-select-option>
             </a-select>
@@ -106,6 +138,7 @@
             <a-input-number
               v-model="fullGiftRuleList[0].promotionValue"
               @blur="calculatePrice"
+              id="promotionList-promotionValue"
               :min="0"
               :step="1"
               :max="99999999"
@@ -122,19 +155,21 @@
                 :min="i!=0?fullGiftRuleList[i-1].regularValue:0"
                 :step="1"
                 :max="99999999"
+                id="promotionList-regularValue1"
                 :precision="form.regularUnit==='YUAN'?2:0"
                 size="small"/>
               <a-select
                 default-value="YUAN"
                 v-model="form.regularUnit"
+                id="promotionList-regularUnit1"
                 @change="handleChangeUnit"
                 style="width: 50px;margin-left:5px;"
                 size="small"
                 :disabled="i!=0">
-                <a-select-option value="YUAN">
+                <a-select-option value="YUAN" id="promotionList-yuan1">
                 </a-select-option>
-                <a-select-option value="GE">
+                <a-select-option value="GE" id="promotionList-ge1">
                 </a-select-option>
               </a-select>
@@ -145,20 +180,21 @@
                 :step="1"
                 :precision="2"
                 :max="99999999"
+                id="promotionList-promotionValue1"
                 size="small"/>
               %为促销品采购额
-              <a-button type="link" v-if="i==0&&fullGiftRuleList&&fullGiftRuleList.length<5" class="button-info" @click="addFullGiftRule">+新增</a-button>
-              <a-button type="link" v-if="i!=0" class="button-error" @click="delFullGiftRule(i)">删除</a-button>
+              <a-button type="link" id="promotionList-add" v-if="i==0&&fullGiftRuleList&&fullGiftRuleList.length<5" class="button-info" @click="addFullGiftRule">+新增</a-button>
+              <a-button type="link" id="promotionList-del" v-if="i!=0" class="button-error" @click="delFullGiftRule(i)">删除</a-button>
             </div>
           </div>
         </a-form-model-item>
         <a-form-model-item label="采购额适用范围" prop="scopeFlag">
           <div class="fixWidthBox">
-            <a-radio-group v-model="form.scopeFlag" button-style="solid" size="small">
-              <a-radio-button value="0">
+            <a-radio-group id="promotionList-scopeFlag" v-model="form.scopeFlag" button-style="solid" size="small">
+              <a-radio-button value="0" id="promotionList-scopeFlag0">
                 部分产品
               </a-radio-button>
-              <a-radio-button value="1">
+              <a-radio-button value="1" id="promotionList-scopeFlag1">
                 全部产品
               </a-radio-button>
             </a-radio-group>
@@ -167,14 +203,14 @@
       </a-form-model>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <div class="flex" style="margin-bottom:10px;">
-          <a-radio-group v-model="chooseVal" button-style="solid">
-            <a-radio-button value="a" v-show="form.gateFlag==='1'">
+          <a-radio-group id="promotionList-chooseVal" v-model="chooseVal" button-style="solid">
+            <a-radio-button value="a" id="promotionList-chooseVal-a" v-show="form.gateFlag==='1'">
               门槛产品
             </a-radio-button>
-            <a-radio-button value="b">
+            <a-radio-button value="b" id="promotionList-chooseVal-b">
               正价产品
             </a-radio-button>
-            <a-radio-button value="c" v-show="form.scopeFlag==='0'">
+            <a-radio-button value="c" id="promotionList-chooseVal-c" v-show="form.scopeFlag==='0'">
               促销产品
             </a-radio-button>
           </a-radio-group>
@@ -184,8 +220,8 @@
               type="link"
               class="button-info"
               @click="openGuideModal=true"
-              id="promotionList-edit-btn">+导入产品</a-button>
-            <a-button type="link" class="button-error" @click="handlePreview">预览</a-button>
+              id="promotionList-import-btn">+导入产品</a-button>
+            <a-button type="link" id="promotionList-preview-btn" class="button-error" @click="handlePreview">预览</a-button>
           </div>
         </div>
         <div v-show="chooseVal=='a'"><tableType1 :unitTypeList="unitTypeDataList" ref="cillProduct"></tableType1></div>
@@ -193,7 +229,7 @@
         <div v-show="chooseVal=='c'"><tableType1 :unitTypeList="unitTypeDataList" ref="offerProduct"></tableType1></div>
       </a-card>
       <div class="btn-cont">
-        <a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button id="promotionList-basicInfo-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>
@@ -206,14 +242,17 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
 import tableType1 from './tableType1.vue'
-import { promotionSave, getRuleDetail } from '@/api/promotion'
 import ImportGuideModal from './importGuideModal.vue'
-import { getLookUpData } from '@/api/data'
 import productPreviewModal from './productPreviewModal'
+// 接口
+import { getLookUpData } from '@/api/data'
+import { promotionSave, getRuleDetail } from '@/api/promotion'
+
 export default {
-  name: 'PromotionListBasicInfoModal',
+  name: 'SendAmountModal',
   mixins: [commonMixin],
   components: { VSelect, tableType1, ImportGuideModal, productPreviewModal },
   props: {
@@ -232,43 +271,47 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 17 }
       },
+      // 提交参数
       form: {
         promotionRuleType: 'BUY_PROD_GIVE_MONEY', // 买产品送采购额
         accrualFlag: 1,
-        description: '',
+        description: '', // 规则简称
         gateFlag: '0', // 门槛
-        gateType: undefined,
-        gateValue: undefined,
-        quotaAmount: undefined,
-        giveRuleType: 'SUM_MONEY',
-        regularUnit: 'YUAN',
+        gateType: undefined, // 页面类型
+        gateValue: undefined, // 门槛产品有效值
+        quotaAmount: undefined, // 可使用门槛产品配额
+        giveRuleType: 'SUM_MONEY', // 满赠规则
+        regularUnit: 'YUAN', // 单位
         scopeFlag: '1',
-        gateInfo: undefined,
-        ruleInfo: undefined,
-        gateUnit: undefined,
-        quotaUnit: undefined
+        gateInfo: undefined, // 门槛规则描述
+        ruleInfo: undefined, // 规则详情描述
+        gateUnit: undefined, // 单位
+        quotaUnit: undefined//  单位类型 yuan  ge
       },
+      // 表单验证规则
       rules: {
         description: [ { required: true, message: '请输入规则简称', trigger: 'blur' } ],
         gateFlag: [ { required: true, message: '请选择规则门槛', trigger: 'change' } ],
         giveRuleType: [{ required: true, message: '请选择满赠规则', trigger: 'change' }],
         scopeFlag: [{ required: true, message: '请选择采购额适用范围', trigger: 'change' }]
       },
-      chooseVal: 'a',
-      scaleNum: 0,
-      openGuideModal: false,
+      chooseVal: 'a', // 当前页面展示值
+      scaleNum: 0, // 促销品采购额比例
+      openGuideModal: false, // 打开导入产品弹窗
+      // 列表数据
       fullGiftRuleList: [{
         regularValue: undefined,
         promotionValue: undefined
       }],
       code: 'SCOPE_UNIT_TYPE', // 起订类型数据字典
-      unitTypeDataList: [],
+      unitTypeDataList: [], // 起订量数据
       openProductModal: false, // 预览弹窗
       previewList: []// 预览值
     }
@@ -287,6 +330,7 @@ export default {
       this.form.regularUnit = val
       this.fullGiftRuleList[0].regularValue = undefined
     },
+    // 单位选择
     handleChangeUnit (e) {
       this.form.regularUnit = e
       this.fullGiftRuleList.forEach(item => {
@@ -310,6 +354,7 @@ export default {
     closeGuideModel () {
       this.openGuideModal = false
     },
+    // 导入成功
     hanldeOk (arr) {
       const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
       this.$refs[name + 'Product'].importRow(arr)
@@ -334,6 +379,7 @@ export default {
         this.chooseVal = 'a'
       }
     },
+    // 选择门槛与配额设置要求
     changeGateTypeFlag (val) {
       this.form.gateType = val
       this.form.gateValue = undefined
@@ -519,7 +565,7 @@ export default {
         promotionRuleType: 'BUY_PROD_GIVE_MONEY', // 买产品送采购额
         description: '',
         gateFlag: '0', // 门槛
-        gateType: undefined,
+        gateType: undefined, //
         gateValue: undefined,
         quotaAmount: undefined,
         giveRuleType: 'SUM_MONEY',
@@ -585,6 +631,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 根绝要求重组数据
     newData (list) {
       list.forEach(con => {
         // 品牌
@@ -643,6 +690,7 @@ export default {
       })
       return list
     },
+    // 获取起订类型数据字典
     getUnitTypeList () {
       const _this = this
       getLookUpData({
@@ -700,6 +748,7 @@ export default {
         this.openProductModal = true
       })
     },
+    // 关闭产品弹窗
     closeProductModal () {
       this.previewList = []
       this.openProductModal = false

+ 42 - 17
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -18,24 +18,24 @@
             <a-col :span="18">
               <div v-for="con in record.productTypeArr" :key="con.id">
                 <a-tooltip v-if="con.title&&con.title.length > 12" :title="con.title">
-                  <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
+                  <a-tag style="margin-bottom:10px;" closable :id="'tableType-delType'+record.productScopeSn" @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
                     {{ `${con.title.slice(0, 12)}...` }}
                   </a-tag>
                 </a-tooltip>
-                <a-tag v-else style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
+                <a-tag v-else style="margin-bottom:10px;" :id="'tableType-delType'+record.productScopeSn" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
                   {{ con.title }}
                 </a-tag>
               </div>
             </a-col>
             <a-col :span="6" style="text-align:right;">
-              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+              <a-tag style="background: #fff; borderStyle: dashed;" :id="'tableType-addType'+record.productScopeSn" @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-tag style="background: #fff; borderStyle: dashed;" :id="'tableType-addType'+record.productScopeSn" @click="addClassifyTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
             </a-col>
@@ -52,19 +52,25 @@
         <div style="max-height:126px;overflow-y:scroll;" v-if="!record.productThisList || record.productThisList.length==0">
           <a-row v-if="record.productBrandArr && record.productBrandArr.length>0">
             <a-col :span="18">
-              <a-tag v-for="item in record.productBrandArr" :key="item.brandSn" style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
+              <a-tag
+                v-for="item in record.productBrandArr"
+                :key="item.brandSn"
+                style="margin-bottom:10px;"
+                :id="'tableType-delBrand'+record.productScopeSn"
+                closable
+                @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
                 {{ item.brandName }}
               </a-tag>
             </a-col>
             <a-col :span="6" style="text-align:right;">
-              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+              <a-tag style="background: #fff; borderStyle: dashed;" :id="'tableType-addBrand'+record.productScopeSn" @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-tag style="background: #fff; borderStyle: dashed;" :id="'tableType-addBrand'+record.productScopeSn" @click="addBrandTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
             </a-col>
@@ -86,19 +92,25 @@
         <div style="max-height:126px;overflow-y:scroll;" v-else>
           <a-row v-if="record.productThisList && record.productThisList.length>0">
             <a-col :span="18">
-              <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.productScopeSn,item,'productList')" v-for="item in record.productThisList" :key="item.productSn">
+              <a-tag
+                style="margin-bottom:10px;"
+                closable
+                :id="'tableType-delProduct'+record.productScopeSn"
+                @close.prevent="delLabel(record.productScopeSn,item,'productList')"
+                v-for="item in record.productThisList"
+                :key="item.productSn">
                 {{ item.productCode }}
               </a-tag>
             </a-col>
             <a-col :span="6" style="text-align:right;">
-              <a-tag style="background: #fff; borderStyle: dashed;" @click="addProductTag(index, record)" color="blue">
+              <a-tag style="background: #fff; borderStyle: dashed;" :id="'tableType-addProduct'+record.productScopeSn" @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-tag style="background: #fff; borderStyle: dashed;" :id="'tableType-addProduct'+record.productScopeSn" @click="addProductTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
             </a-col>
@@ -113,6 +125,7 @@
           size="small"
           style="width:100%;"
           placeholder="请选择"
+          :id="'tableType-unitType'+record.productScopeSn"
           allowClear>
           <a-select-option :value="con.code" v-for="con in unitTypeList" :key="con.id">
             {{ con.dispName }}
@@ -122,6 +135,7 @@
           size="small"
           style="margin-top:8px;width:100%;"
           v-model="record.unitQty"
+          :id="'tableType-unitQty'+record.productScopeSn"
           :min="0"
           :step="1"
           :max="99999999"
@@ -133,6 +147,7 @@
           size="small"
           type="link"
           class="button-error"
+          :id="'tableType-del-btn'+record.productScopeSn"
           @click="handleDel(record)"
         >
           删除
@@ -171,6 +186,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
 import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
@@ -195,19 +211,20 @@ export default {
         { title: '设置起订量', width: '11%', scopedSlots: { customRender: 'setNum' }, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
-      dataSource: [],
-      openBrandModal: false,
-      openTypeModal: false,
-      openProductsModal: false,
-      chooseBrand: [],
-      chooseType: [],
+      dataSource: [], // 列表数据
+      openBrandModal: false, // 打开产品品牌弹窗
+      openTypeModal: false, // 打开产品分类弹窗
+      openProductsModal: false, // 打开产品弹窗
+      chooseBrand: [], // 品牌数据
+      chooseType: [], // 分类数据
       brandTagIndex: null, // 所选品牌位置
       classifyTagIndex: null, // 所选分类位置
       productTagIndex: null, // 所选产品位置
-      chooseProducts: []
+      chooseProducts: []// 所选产品数据
     }
   },
   methods: {
+    // 关闭产品弹窗
     closeProductModal () {
       this.chooseProducts = []
       this.openProductsModal = false
@@ -311,6 +328,7 @@ export default {
         }
       }
     },
+    // 添加分类成功,重组数据
     handleTypeOk (mainArr) {
       const classifyArr = []
       const newClassifyArr = []
@@ -401,6 +419,7 @@ export default {
         }
       }
     },
+    // 添加品牌成功,重组数据
     handleBrandOk (conList) {
       const newConList = conList.map(con => {
         return {
@@ -419,6 +438,7 @@ export default {
       const dataList = this.setShowData('This')
       this.$refs.productBox.handleDisabled(dataList)
     },
+    // 添加产品成功,重组数据
     handleProductsOk (arr) {
       const newArr = []
       arr.forEach(item => {
@@ -484,6 +504,7 @@ export default {
       })
       return snArr
     },
+    // 筛选code和goodsSn值
     handleEchoData (name, conArr) {
       if (conArr) {
         conArr.map(item => {
@@ -499,6 +520,7 @@ export default {
       }
       return conArr
     },
+    // 灰选已选分类
     handleRowData (row) {
       const echoData = []
       row.productTypeList.forEach(item => {
@@ -516,6 +538,7 @@ export default {
       })
       return echoData
     },
+    // 禁用行中产品品牌或者产品数据
     setTypeShowData () {
       const _this = this
       const snArr = []
@@ -548,6 +571,7 @@ export default {
       })
       return resultObj
     },
+    // 表格数据赋值
     setTabVal (formData) {
       this.dataSource = formData
     },
@@ -608,6 +632,7 @@ export default {
       })
       return { list: c_typeArr, flag: flag, noTypeFlag: noTypeFlag }
     },
+    // 判断分类是否重复
     isRepeatType (row) {
       var flag = false
       var noTypeFlag = false

+ 29 - 13
src/views/promotionRulesManagement/dealerPromotions/tableType3.vue

@@ -18,24 +18,24 @@
             <a-col :span="17">
               <div v-for="con in record.productTypeArr" :key="con.id">
                 <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')">
+                  <a-tag style="margin-bottom:10px;" :id="'tableaaType-delType'+record.productScopeSn" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
                     {{ `${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')">
+                <a-tag v-else style="margin-bottom:10px;" :id="'tableaaType-delType'+record.productScopeSn" closable @close.prevent="delLabel(record.productScopeSn,con,'typeList')">
                   {{ con.title }}
                 </a-tag>
               </div>
             </a-col>
             <a-col :span="6" style="text-align:right;">
-              <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+              <a-tag style="background: #fff; borderStyle: dashed;" :id="'tableaaType-addType'+record.productScopeSn" @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-tag style="background: #fff; borderStyle: dashed;" :id="'tableaaType-addType'+record.productScopeSn" @click="addClassifyTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
             </a-col>
@@ -50,25 +50,25 @@
             <a-col :span="17">
               <div v-for="item in record.productBrandArr" :key="item.brandSn">
                 <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')">
+                  <a-tag style="margin-bottom:10px;" :id="'tableaaType-delBrand'+record.productScopeSn" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
                     {{ `${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')">
+                <a-tag v-else style="margin-bottom:10px;" :id="'tableaaType-delBrand'+record.productScopeSn" closable @close.prevent="delLabel(record.productScopeSn,item,'brandList')">
                   {{ item.brandName }}
                 </a-tag>
               </div>
             </a-col>
 
             <a-col :span="6" style="text-align:right;">
-              <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+              <a-tag style="background: #fff; borderStyle: dashed;" :id="'tableaaType-addBrand'+record.productScopeSn" @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-tag style="background: #fff; borderStyle: dashed;" :id="'tableaaType-addBrand'+record.productScopeSn" @click="addBrandTag(index, record)" color="blue">
                 <a-icon type="plus" />
               </a-tag>
             </a-col>
@@ -89,6 +89,7 @@
               size="small"
               style="width:90%;"
               v-model="record.provinceDiscountPrice"
+              :id="'tableaaType-provinceDiscountPrice'+record.productScopeSn"
               :min="0"
               :step="1"
               :precision="2"
@@ -114,6 +115,7 @@
               size="small"
               style="width:80%;"
               v-model="record.provinceDiscountRate"
+              :id="'tableaaType-provinceDiscountRate'+record.productScopeSn"
               :min="0"
               :step="1"
               :precision="2"
@@ -138,6 +140,7 @@
               :min="record.provinceDiscountPrice || 0"
               :step="1"
               :precision="2"
+              :id="'tableaaType-cityDiscountPrice'+record.productScopeSn"
               placeholder="请输入"
               :max="99999999"
               :disabled="rulesType!='0'"
@@ -162,6 +165,7 @@
               style="width:80%;"
               v-model="record.cityDiscountRate"
               :min="record.provinceDiscountRate ||0"
+              :id="'tableaaType-cityDiscountRate'+record.productScopeSn"
               :step="1"
               :precision="2"
               placeholder="请输入"
@@ -183,6 +187,7 @@
               style="width:90%;"
               v-model="record.specialDiscountPrice"
               :min="record.cityDiscountPrice ||0"
+              :id="'tableaaType-specialDiscountPrice'+record.productScopeSn"
               :step="1"
               :precision="2"
               placeholder="请输入"
@@ -209,6 +214,7 @@
               style="width:80%;"
               v-model="record.specialDiscountRate"
               :min="record.cityDiscountRate ||0"
+              :id="'tableaaType-specialDiscountRate'+record.productScopeSn"
               :step="1"
               :precision="2"
               placeholder="请输入"
@@ -229,6 +235,7 @@
           size="small"
           style="width:100%;"
           placeholder="请选择"
+          :id="'tableaaType-unitType'+record.productScopeSn"
           allowClear>
           <a-select-option :value="con.code" v-for="con in unitTypeList" :key="con.id">
             {{ con.dispName }}
@@ -241,6 +248,7 @@
           :min="0"
           :step="1"
           :precision="0"
+          :id="'tableType-unitQty'+record.productScopeSn"
           :max="99999999"
           placeholder="请输入"/>
       </template>
@@ -249,6 +257,7 @@
           size="small"
           type="link"
           class="button-error"
+          :id="'tableType-del-btn'+record.productScopeSn"
           @click="handleDel(record)"
         >
           删除
@@ -279,6 +288,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
 import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
@@ -307,11 +317,11 @@ export default {
   data () {
     return {
       spinning: false,
-      dataSource: [],
-      openBrandModal: false,
-      openTypeModal: false,
-      chooseBrand: [],
-      chooseType: [],
+      dataSource: [], // 列表数据
+      openBrandModal: false, // 打开产品品牌弹窗
+      openTypeModal: false, // 打开产品分类弹窗
+      chooseBrand: [], // 品牌数据
+      chooseType: [], // 分类数据
       val: '',
       brandTagIndex: null, // 所选品牌位置
       classifyTagIndex: null, // 所选分类位置
@@ -446,6 +456,7 @@ export default {
         }
       }
     },
+    // 选择品牌后重组数据
     handleTypeOk (mainArr) {
       const classifyArr = []
       const newClassifyArr = []
@@ -536,6 +547,7 @@ export default {
         }
       }
     },
+    // 添加品牌后重组数据
     handleBrandOk (conList) {
       const newConList = conList.map(con => {
         return {
@@ -603,6 +615,7 @@ export default {
       })
       return snArr
     },
+    // 筛选选中数据中的code和goodsn值
     handleEchoData (name, conArr) {
       conArr.map(item => {
         if (name === 'This') {
@@ -614,6 +627,7 @@ export default {
       })
       return conArr
     },
+    // 回显禁用列表
     handleRowData (row) {
       const echoData = []
       row.productTypeList.forEach(item => {
@@ -631,6 +645,7 @@ export default {
       })
       return echoData
     },
+    // 禁用行中产品品牌或者产品数据
     setTypeShowData () {
       const _this = this
       const snArr = []
@@ -751,6 +766,7 @@ export default {
       })
       return { list: c_typeArr, flag: flag, noTypeFlag: noTypeFlag }
     },
+    // 判断分类是否重复
     isRepeatType (row) {
       var flag = false
       var noTypeFlag = false