瀏覽代碼

添加注释和id

chenrui 11 月之前
父節點
當前提交
5121e68320
共有 29 個文件被更改,包括 534 次插入370 次删除
  1. 68 67
      src/views/dealerManagement/businessOwnerSettings/supplierSet.vue
  2. 23 21
      src/views/dealerManagement/dealerZoneSearch/list.vue
  3. 19 11
      src/views/dealerManagement/rebateBinding/categoryList.vue
  4. 21 14
      src/views/dealerManagement/rebateBinding/categoryTree.vue
  5. 35 21
      src/views/dealerManagement/rebateBinding/list.vue
  6. 33 15
      src/views/dealerManagement/rebateBinding/priceDiffModal.vue
  7. 36 28
      src/views/promotionRulesManagement/dealerPromotions/addModal.vue
  8. 8 4
      src/views/promotionRulesManagement/dealerPromotions/brandCategoryModal.vue
  9. 34 27
      src/views/promotionRulesManagement/dealerPromotions/chooseDealer.vue
  10. 11 6
      src/views/promotionRulesManagement/promotionManagement/addModal.vue
  11. 15 12
      src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue
  12. 11 5
      src/views/promotionRulesManagement/promotionManagement/editModal.vue
  13. 26 21
      src/views/promotionRulesManagement/promotionManagement/list.vue
  14. 16 13
      src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue
  15. 1 1
      src/views/promotionRulesManagement/promotionManagement/promotionDescModal.vue
  16. 13 11
      src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue
  17. 17 10
      src/views/supplierManagement/associatedProduct/add.vue
  18. 6 4
      src/views/supplierManagement/associatedProduct/chooseImportModal.vue
  19. 8 5
      src/views/supplierManagement/associatedProduct/importGuideModal.vue
  20. 10 5
      src/views/supplierManagement/associatedProduct/settingCost.vue
  21. 14 5
      src/views/supplierManagement/associatedProductDetails/list.vue
  22. 20 14
      src/views/supplierManagement/costSetRecord/list.vue
  23. 21 15
      src/views/supplierManagement/costSetting/addProductModal.vue
  24. 5 2
      src/views/supplierManagement/costSetting/chooseImportModal.vue
  25. 5 2
      src/views/supplierManagement/costSetting/importGuideModal.vue
  26. 20 13
      src/views/supplierManagement/costSetting/list.vue
  27. 9 5
      src/views/supplierManagement/costSetting/settingCost.vue
  28. 10 6
      src/views/supplierManagement/supplierInfo/edit.vue
  29. 19 7
      src/views/supplierManagement/supplierInfo/list.vue

+ 68 - 67
src/views/dealerManagement/businessOwnerSettings/supplierSet.vue

@@ -1,47 +1,49 @@
 <template>
-  <div class="categorySet-wrap">
+  <div class="supplierSet-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-        <div class="areaSet-wrap">
-          <div class="table-page-search-wrapper flex-center" style="width:100%;justify-content: space-between;margin-bottom:10px">
-            <div class="areaSet-btnGroup">
-              <a-button type="primary" @click="openSupplierModal">新增</a-button>
-            </div>
-            <div>
-              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-                <a-input style="width:300px;" id="areaSet-dealerName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
-                <a-button style="margin-left: 15px" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="areaSet-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="areaSet-reset">重置</a-button>
-              </a-form>
-            </div>
-          </div>
-          <a-spin :spinning="spinning" tip="Loading...">
-            <!-- 列表 -->
-            <s-table
-              class="sTable fixPagination"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.no"
-              rowKeyName="no"
-              :columns="columns"
-              :data="loadData"
-              :defaultLoadData="false"
-              :style="{ height: tableHeight + 70 +'px' }"
-              :scroll="{ y: tableHeight }"
-              bordered>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button
-                  size="small"
-                  type="link"
-                  class="button-error"
-                  @click="handleDel(record)"
-                >
-                  删除
-                </a-button>
-              </template>
-            </s-table>
-          </a-spin>
+      <div class="supplierSetCon-wrap">
+        <!-- 操作按钮 -->
+        <div class="table-page-search-wrapper flex-center" style="width:100%;justify-content: space-between;margin-bottom:10px">
+          <div class="supplierSet-btnGroup">
+            <a-button type="primary" id="supplierSet-add" @click="openSupplierModal">新增</a-button>
+          </div>
+          <!-- 搜索条件 -->
+          <div>
+            <a-form layout="inline" id="supplierSet-form" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-input style="width:300px;" id="supplierSet-dealerName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
+              <a-button style="margin-left: 15px" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="supplierSet-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="supplierSet-reset">重置</a-button>
+            </a-form>
+          </div>
         </div>
+        <a-spin :spinning="spinning" tip="Loading...">
+          <!-- 列表 -->
+          <s-table
+            class="sTable fixPagination"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :defaultLoadData="false"
+            :style="{ height: tableHeight + 70 +'px' }"
+            :scroll="{ y: tableHeight }"
+            bordered>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button
+                size="small"
+                type="link"
+                :id="'supplierSet-del-btn'+record.id"
+                class="button-error"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+            </template>
+          </s-table>
+        </a-spin>
+      </div>
     </a-spin>
     <!-- 选择供应商 -->
     <a-drawer
@@ -60,15 +62,16 @@
 </template>
 
 <script>
-import { commonMixin } from '@/utils/mixin'
-import chooseSupplier from './chooseSupplier.vue'
-import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
+import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+import chooseSupplier from './chooseSupplier.vue'
+// 接口
 import { querySupplierScopePage, querySupplierScope, saveSupplierList, bizuserScopeDelete } from '@/api/bizuser'
 export default {
-  name: 'CategorySet',
+  name: 'SupplierSet',
   mixins: [commonMixin],
-  components: { chooseSupplier, ChooseTypeModal, STable },
+  components: { chooseSupplier, STable },
   props: {
     bizUserSn: {
       type: String,
@@ -78,7 +81,7 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -88,29 +91,23 @@ export default {
         // { title: '联系手机', dataIndex: 'subareaAreaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
-      openChooseSupplier: false,
+      openChooseSupplier: false, // 选择供应商弹窗
+      // 查询参数
       queryParam: {
-        supplierName: ''
+        supplierName: ''// 供应商名称
       },
-      dataSource: [],
-      openModal: false, //  新增编辑产品品牌  弹框
-      itemSn: '', //  当前sn
-      nowData: null, //  当前记录数据
-      openBrandModal: false,
-      openChooseDealer: true,
-      openTypeModal: false,
-      chooseBrand: [],
-      chooseType: [],
-      chooseObj: null, // 选择品牌 内容
+      dataSource: [], // 列表数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // this.spinning = true
+        this.spinning = true
         this.queryParam.userSn = this.$route.query.sn
-        this.queryParam.bizUserSn = this.bizUserSn
+        this.queryParam.bizUserSn = this.bizUserSn
+        // 获取列表数据  有分页
         return querySupplierScopePage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
-          data = res.data
+          data = res.data
+          // 计算列表序号
           const no = (data.pageNo - 1) * data.pageSize
           this.total = data.count || 0
           for (var i = 0; i < data.list.length; i++) {
@@ -118,7 +115,7 @@ export default {
           }
           this.dataSource = data.list
           this.disabled = false
-          // this.spinning = false
+          this.spinning = false
           return data
         })
       }
@@ -153,6 +150,7 @@ export default {
         obj.userSn = this.$route.query.sn
         obj.bizUserSn = this.bizUserSn
        obj.bizType = 'supplier'
        obj.bizSn = con
        newData.push(obj)
      })
      this.saveChooseDealer(newData)
     },
+    // 保存所选供应商
     saveChooseDealer (list) {
       const _this = this
       const ajaxData = {}
@@ -181,19 +179,22 @@ export default {
         }
       })
     },
+    // 重置
     resetSearchForm () {
       this.queryParam = {
         supplierName: ''
       }
       this.$refs.table.refresh(true)
-    },
+    },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.$refs.table.refresh()
-    },
+    },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - 345
     }
@@ -210,7 +211,7 @@ export default {
 </script>
 
 <style lang="less">
-  .categorySet-wrap{
-    
+  .supplierSet-wrap{
+
   }
 </style>

+ 23 - 21
src/views/dealerManagement/dealerZoneSearch/list.vue

@@ -6,9 +6,9 @@
         <a-form layout="inline" @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="所属区域/分区">
                 <subarea id="dealerZoneSearch-subareaSn" ref="subarea" @change="subareaChange"></subarea>
-              </a-form-model-item>
+              </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="经销商">
@@ -17,7 +17,7 @@
             </a-col>
             <a-col :md="7" :sm="24">
               <a-form-item label="客服/区域负责人/销售总监">
-                <a-input id="dealerZoneSearch-dealerName" v-model.trim="queryParam.bizUserName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
+                <a-input id="dealerZoneSearch-bizUserName" v-model.trim="queryParam.bizUserName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
               </a-form-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -43,8 +43,7 @@
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
-          :rowKey="(record) => record.no"
-          rowKeyName="no"
+          :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
           :pageSize="30"
@@ -52,7 +51,7 @@
           :defaultLoadData="false"
           bordered>
           <template slot="kf" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.userNameKfs">
+            <a-tooltip placement="top" :id="'dealerZoneSearch-userNameKfs'+record.id" v-if="record.userNameKfs">
               <template slot="title">
                 {{ record.userNameKfs }}
               </template>
@@ -61,7 +60,7 @@
             <span v-else>--</span>
           </template>
           <template slot="qyfzr" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.userNameQyfzrs">
+            <a-tooltip placement="top" :id="'dealerZoneSearch-userNameQyfzrs'+record.id" v-if="record.userNameQyfzrs">
               <template slot="title">
                 {{ record.userNameQyfzrs }}
               </template>
@@ -70,7 +69,7 @@
             <span v-else>--</span>
           </template>
           <template slot="xszj" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.userNameXszjs">
+            <a-tooltip placement="top" :id="'dealerZoneSearch-userNameXszjs'+record.id" v-if="record.userNameXszjs">
               <template slot="title">
                 {{ record.userNameXszjs }}
               </template>
@@ -86,11 +85,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { exportExcel } from '@/libs/JGPrint.js'
+// 组件
 import { STable } from '@/components'
 import subarea from '@/views/common/subarea.js'
-import { exportExcel } from '@/libs/JGPrint.js'
-import { queryDealerWithBizuser, exportDealerWithBizuser } from '@/api/dealerRelation'
 import custList from '@/views/common/custList.vue'
+// 接口
+import { queryDealerWithBizuser, exportDealerWithBizuser } from '@/api/dealerRelation'
 export default {
   name: 'DealerZoneSearch',
   mixins: [commonMixin],
@@ -99,17 +100,18 @@ export default {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      exportLoading: false, // 导出loading
+      // 查询条件
       queryParam: {
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
+        subareaSn: undefined, // 区域
+        subareaAreaSn: undefined, // 分区
         dealer: {
-          dealerSn: '',
-          dealerName: ''
+          dealerSn: '', // 经销商sn
+          dealerName: ''// 经销商名称
         },
-        bizUserName: ''
+        bizUserName: ''// 客服/区域负责人/销售总监
       },
-      exportLoading: false, // 导出loading
       columns: [
         { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '所属区域', dataIndex: 'subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -122,14 +124,11 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return queryDealerWithBizuser(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            const no = 0
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
             this.disabled = false
           }
           this.spinning = false
@@ -150,6 +149,7 @@ export default {
         _this.exportLoading = false
       })
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
@@ -170,6 +170,7 @@ export default {
       this.queryParam.dealer.dealerSn = val.key
       this.queryParam.dealer.dealerName = val.key ? (val.label.replace('\n', '')).trim() : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -177,6 +178,7 @@ export default {
       })
       this.$refs.table.refresh()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 19 - 11
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -21,9 +21,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { Empty } from 'ant-design-vue'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { dealerUpsList, dealerUpsDelete } from '@/api/dealer'
-import { Empty } from 'ant-design-vue'
 // 子表格
 const ChildTableComp = {
   name: 'ChildTableComp',
@@ -48,7 +50,7 @@ const ChildTableComp = {
   },
   data () {
     return {
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 为空 图片地址
       columns: [
         { title: '序号', field: 'no', key: 'a', width: 40, align: 'center', operationColumn: false },
         { title: '品牌', field: 'productBrandName', key: 'b', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
@@ -75,13 +77,13 @@ export default {
   },
   data () {
     return {
-      disabled: false, //  查询、重置按钮是否可操作
       spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
       simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      dataSource: [],
-      list: [],
-      tableHeight: this.maxHeight,
-      columnWidthResizeOption: {
+      dataSource: [], // 列表数据
+      list: [], // 重组后适合的列表数据
+      tableHeight: this.maxHeight, // 表格高度
+      columnWidthResizeOption: {// 表格列宽设置
         // default false
         enable: true,
         // column resize min width
@@ -98,9 +100,9 @@ export default {
           this.changeExpandedRowKeys(afterExpandedRowKeys)
         }
       },
-      showEmpty: true,
-      checkedDealerSn: [],
-      isTeyue: false
+      showEmpty: true, // 是否显示空页面
+      checkedDealerSn: [], // 选中的经销商sn集合
+      isTeyue: false// 是否显示删除按钮
     }
   },
   computed: {
@@ -149,7 +151,7 @@ export default {
           </div>
         )
       }
-
+      // 表格展开收起功能
       const expendFormat = function (record, data, h) {
         if (_this.isTeyue) {
           return (<span>-</span>)
@@ -213,7 +215,9 @@ export default {
       const no = 0
       for (let i = 0; i < listData.length; i++) {
         const item = listData[i]
+        // 筛选品牌 一级、二级、三级分类数据 渲染展开表格
         const rebateScopeList = item.rebateScopeList ? this.filterData(item.rebateScopeList, queryParam) : [{ productBrandName: null, productTypeName1: null, productTypeName2: null, productTypeName3: null }]
+        // SUPERIORS 上级经销商    HEAD 总部经销商    ASSIGN 指定经销商
         const supDealerList = item.rebateDealerList.find(b => b.rebateParentType == 'SUPERIORS')
         const headDealerList = item.rebateDealerList.find(b => b.rebateParentType == 'HEAD')
         const zdDealerList = item.rebateDealerList.filter(b => b.rebateParentType == 'ASSIGN')
@@ -247,6 +251,7 @@ export default {
 
       return ret.filter(item => item.childData.length > 0)
     },
+    // 列表数据查询
     searchTable (queryParam) {
       if (this.dataSource.length) {
         this.$emit('loaded', this.dataSource)
@@ -270,12 +275,14 @@ export default {
         })
       }
     },
+    // 编辑
     handleEdit (record, e) {
       console.log(e)
       e.stopPropagation()
       const row = this.dataSource.find(item => item.dealerUpsSn == record.dealerUpsSn && item.dealerSn == record.dealerSn)
       this.$emit('edit', row)
     },
+    // 删除
     handleDel (record, e) {
       e.stopPropagation()
       const _this = this
@@ -298,6 +305,7 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit (queryParam, isTeyue) {
       this.isTeyue = isTeyue
       // 获取列表

+ 21 - 14
src/views/dealerManagement/rebateBinding/categoryTree.vue

@@ -33,11 +33,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { VSelect } from '@/components'
-import { dealerUpsPlTree } from '@/api/dealer'
 import { Empty } from 'ant-design-vue'
+// 组件
+import { VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
+// 接口
+import { dealerUpsPlTree } from '@/api/dealer'
 export default {
   name: 'DetailProductList',
   mixins: [commonMixin],
@@ -59,27 +61,29 @@ export default {
   data () {
     return {
       spinning: false,
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      dataSource: [],
-      showEmpty: true,
-      dealerSn: undefined,
-      parentDealerSn: undefined,
-      checkedKeys: [],
-      halfCheckedKeys: [],
-      allLeafKeys: [],
-      allBrands: [],
-      check1: false,
-      check2: false,
-      check3: false
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 为空显示的图片
+      dataSource: [], // 树数据
+      showEmpty: true, // 是否显示为空图片
+      dealerSn: undefined, // 经销商sn
+      parentDealerSn: undefined, // 上级经销商sn
+      checkedKeys: [], // 选中数据
+      halfCheckedKeys: [], // 选中孩子节点数据
+      allLeafKeys: [], // 所有子节点数据
+      allBrands: [], // 所有品牌数据
+      check1: false, // 全选
+      check2: false, // 自主品牌
+      check3: false// 代理品牌
     }
   },
   computed: {
 
   },
   methods: {
+    // 树 check 事件
     onCheck (checkedKeys, info) {
       // console.log('onCheck', checkedKeys, info)
       this.checkedKeys = checkedKeys
+      // 选中孩子节点数据
       this.halfCheckedKeys = info.halfCheckedKeys
       if (this.check1) {
         this.check1 = false
@@ -91,6 +95,7 @@ export default {
         this.check3 = false
       }
     },
+    // 获取选中数据,重组所选数据结构
     getResult () {
       // 所有已选叶子节点
       const ret = this.allLeafKeys.filter(item => this.checkedKeys.includes(item.sn))
@@ -176,6 +181,7 @@ export default {
         this.$message.info('请选择上级经销商')
       }
     },
+    // 获取树数据
     async getTreeData () {
       this.dataSource = []
       this.allLeafKeys = []
@@ -195,6 +201,7 @@ export default {
       }
       this.spinning = false
     },
+    // 初始化
     pageInit (detailData, parentDealerSn, dealerSn) {
       this.detailData = detailData
       this.parentDealerSn = parentDealerSn

+ 35 - 21
src/views/dealerManagement/rebateBinding/list.vue

@@ -22,12 +22,12 @@
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="品牌">
-                  <ProductBrand v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="rebateBinding-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类">
-                  <ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                  <ProductType id="rebateBinding-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-model-item>
               </a-col>
               <!-- <a-col :md="6" :sm="24" v-if="!isTeyue">
@@ -42,7 +42,13 @@
               </a-col> -->
               <a-col :md="6" :sm="24" v-show="false">
                 <a-form-model-item label="差价归属方">
-                  <v-select code="REBATE_PARENT_TYPE" ref="rpType" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属方"></v-select>
+                  <v-select
+                    id="rebateBinding-rebateParentType"
+                    code="REBATE_PARENT_TYPE"
+                    ref="rpType"
+                    v-model="queryParam.rebateParentType"
+                    allowClear
+                    placeholder="请选择差价归属方"></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -56,14 +62,13 @@
         <div class="table-operator" style="display: flex;align-items: center;justify-content: space-between;" v-if="showBtns">
           <a-button id="rebateBinding-brand" type="primary" class="button-error" @click="openGlModal">差价设置</a-button>
           <div v-if="!isTeyue && hasData">
-            <a-button type="default" @click="expandAllRow">{{ expandAll?'收起全部':'展开全部' }}</a-button>
+            <a-button id="rebateBinding-isTeyue" type="default" @click="expandAllRow">{{ expandAll?'收起全部':'展开全部' }}</a-button>
           </div>
         </div>
         <!-- 列表 -->
         <categoryList ref="categoryList" @loaded="loadList" @del="delOk" @edit="handleEdit" :maxHeight="tableHeight"></categoryList>
       </a-card>
     </a-spin>
-
     <!-- 差价设置 -->
     <priceDiffModal ref="priceDiffModal" :openModal="openModal" @ok="resetGetData" @close="openModal=false"></pricediffmodal>
   </div>
@@ -71,12 +76,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { dealerDetailBySn } from '@/api/dealer'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import priceDiffModal from './priceDiffModal.vue'
 import categoryList from './categoryList'
+// 接口
+import { dealerDetailBySn } from '@/api/dealer'
 export default {
   name: 'RebateBinding',
   mixins: [commonMixin],
@@ -84,27 +91,29 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, //  表格加载中
-      openModal: false,
-      detail: null,
-      productType: [],
-      queryParam: { //  查询条件
-        rebateParentType: undefined,
-        priceLevel: undefined,
-        productBrandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        dealerName: ''
+      openModal: false, // 差价设置弹窗
+      detail: null, // 详情数据
+      productType: [], // 产品分类查询数据
+      //  查询条件
+      queryParam: {
+        rebateParentType: undefined, // 差价归属方
+        priceLevel: undefined, // 价格级别
+        productBrandSn: undefined, // 品牌
+        productTypeSn1: undefined, // 产品一级分类
+        productTypeSn2: undefined, // 产品二级分类
+        productTypeSn3: undefined, // 产品三级分类
+        dealerName: ''// 经销商名称
       },
-      showBtns: true,
-      expandAll: false,
-      hasData: false
+      showBtns: true, // 是否显示操作按钮
+      expandAll: false, // 显示展开全部  收起全部按钮
+      hasData: false // 列表数据是否为空
     }
   },
   computed: {
+    // 判断是否显示特约经销商内容
     isTeyue () {
       return this.detail && this.detail.dealerLevel == 'SPECIAL'
     }
@@ -114,6 +123,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'merchantInfoManagementList', query: { closeLastOldTab: true } })
     },
+    // 获取列表数据
     loadList (list) {
       this.showBtns = this.isTeyue ? list.length == 0 : true
       this.hasData = list.length > 0
@@ -140,6 +150,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : undefined
       this.queryParam.productTypeSn3 = val[2] ? val[2] : undefined
     },
+    // 收起全部 展开全部 事件
     expandAllRow () {
       if (this.expandAll) {
         this.$refs.categoryList.foldAll()
@@ -148,6 +159,7 @@ export default {
       }
       this.expandAll = !this.expandAll
     },
+    // 差价设置成功,关闭弹窗,初始化弹窗所需数据
     resetGetData () {
       this.expandAll = false
       this.$refs.categoryList.dataSource = []
@@ -192,6 +204,7 @@ export default {
         this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.getDetail()
@@ -199,6 +212,7 @@ export default {
         _this.setTableH()
       })
     },
+    // 获取表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - (!this.showBtns ? 50 : 205)

+ 33 - 15
src/views/dealerManagement/rebateBinding/priceDiffModal.vue

@@ -12,7 +12,7 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div style="min-height:100px;">
         <a-form-model
-          id="dealerAccountEdit-form"
+          id="priceDifference-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -26,19 +26,21 @@
             <a-row :gutter="10">
               <a-col :span="17">
                 <custList
+                  id="priceDifference-custList"
                   v-if="!form.dealerUpsSn || isSpecial"
                   ref="custList"
                   :notDealerSn="notDealer"
                   :notDealerType="['SPECIAL']"
                   @change="custSupChange"
                   placeholder="请输入经销商名称搜索"></custList>
-                <a-input v-else :value="superDealerName" disabled />
+                <a-input id="priceDifference-superDealerName" v-else :value="superDealerName" disabled />
               </a-col>
               <a-col :span="4" v-if="!isSpecial">
                 <a-input-number
                   :precision="2"
                   :min="0"
                   :max="100"
+                  id="priceDifference-parentAllotRate"
                   v-model="parentAllotRate"
                   @change="rateSupChange"
                   placeholder="请输入比例"/> %
@@ -47,6 +49,7 @@
                 <a-button
                   type="primary"
                   ghost
+                  id="priceDifference-zdDealearList"
                   @click="addItem()"
                 >添加指定</a-button>
               </a-col>
@@ -55,13 +58,14 @@
           <a-form-model-item label="指定经销商" v-if="zdDealearList.length">
             <a-row :gutter="10" v-for="(item,index) in zdDealearList" :key="item.id">
               <a-col :span="17">
-                <custList :ref="'custList-'+item.id" :notDealerSn="notZdDealer" @change="(v,r)=>custChange(v,r,index)" placeholder="请输入经销商名称搜索"></custList>
+                <custList id="priceDifference-notZdDealer" :ref="'custList-'+item.id" :notDealerSn="notZdDealer" @change="(v,r)=>custChange(v,r,index)" placeholder="请输入经销商名称搜索"></custList>
               </a-col>
               <a-col :span="4">
                 <a-input-number
                   :precision="2"
                   :min="0"
                   :max="100"
+                  id="priceDifference-allotRate"
                   v-model="item.allotRate"
                   @change="(v)=>rateChange(v,index)"
                   placeholder="请输入比例"/> %
@@ -80,6 +84,7 @@
                   type="primary"
                   title="删除"
                   size="small"
+                  id="priceDifference-del"
                   shape="circle"
                   ghost
                   icon="minus"/>
@@ -89,13 +94,14 @@
           <a-form-model-item label="箭冠总公司" v-if="!isSpecial">
             <a-row :gutter="10">
               <a-col :span="17">
-                <a-input value="箭冠总公司" disabled />
+                <a-input id="priceDifference-headOffice" value="箭冠总公司" disabled />
               </a-col>
               <a-col :span="4">
                 <a-input-number
                   :precision="2"
                   :min="0"
                   :max="100"
+                  id="priceDifference-hAllotRate"
                   v-model="hAllotRate"
                   @change="rateHChange"
                   placeholder="请输入比例"/> %
@@ -108,9 +114,10 @@
         <categoryTree v-if="showTable&&!isSpecial&&!form.dealerUpsSn" ref="categoryTree"></categoryTree>
       </div>
       <div class="btn-cont">
-        <a-button @click="isShow = false" style="font-size: 12px;">取消</a-button>
+        <a-button id="priceDifference-cancel-btn" @click="isShow = false" style="font-size: 12px;">取消</a-button>
         <a-button
           type="primary"
+          id="priceDifference-save-btn"
           style="margin-left: 20px;"
           @click="handleSave"
         >确定</a-button>
@@ -121,10 +128,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import custList from '@/views/common/custList.vue'
 import { VSelect } from '@/components'
-import { dealerUpsCreate, dealerUpsUpdate } from '@/api/dealer'
 import categoryTree from './categoryTree'
+// 接口
+import { dealerUpsCreate, dealerUpsUpdate } from '@/api/dealer'
 export default {
   name: 'PriceDiffModal',
   mixins: [commonMixin],
@@ -139,38 +148,44 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      title: '差价设置',
+      title: '差价设置', // 标题
+      // 表单label布局设置
       formItemLayout: {
         labelCol: { span: 3 },
         wrapperCol: { span: 20 }
       },
+      // 提交参数
       form: {
-        dealerSn: undefined,
-        dealerUpsSn: undefined,
+        dealerSn: undefined, // 经销商sn
+        dealerUpsSn: undefined, // 上级经销商
         rebateParentType: [], // 差价归属
         rebateDealerList: [], // 经销商列表
         rebateScopeList: [] // 品类列表
       },
       parentAllotRate: '', // 上级经销商分配比例
       hAllotRate: '', // 总部分配比例
+      // 表单规则验证
       rules: {
         rebateParentType: [{ required: true, message: '请选择差价归属方', trigger: 'change' }]
       },
-      cjgsfList: [],
-      zdDealearList: [],
-      detailData: null,
-      superDealerName: '',
-      checkedDealerSn: [],
-      showTable: false
+      cjgsfList: [], // 箭冠总公司列表
+      zdDealearList: [], // 指定经销商列表
+      detailData: null, // 详情数据
+      superDealerName: '', // 经销商数据
+      checkedDealerSn: [], // 选中经销商sn
+      showTable: false// 是否显示品牌分类列表
     }
   },
   computed: {
+    // 是否是特约经销商
     isSpecial () {
       return this.detailData && this.detailData.dealerLevel == 'SPECIAL'
     },
+    // 上级经销商数据
     notDealer () {
       return this.form.rebateDealerList.concat(this.zdDealearList).concat([{ 'parentDealerSn': this.form.dealerSn }])
     },
+    // 指定经销商列表数据
     notZdDealer () {
       return this.form.rebateDealerList.concat(this.zdDealearList)
     }
@@ -254,6 +269,7 @@ export default {
         })
       }
     },
+    // 上级经销商 比例 change
     rateSupChange (val) {
       this.form.rebateDealerList[0]['allotRate'] = val
     },
@@ -265,6 +281,7 @@ export default {
         this.$refs.categoryTree.pageInit(this.detailData, parentDealerSn, this.form.dealerSn)
       }
     },
+    // 箭冠总公司  比例
     rateHChange (val) {
       this.form.rebateDealerList[1]['allotRate'] = val
     },
@@ -273,6 +290,7 @@ export default {
       console.log(val, index)
       this.zdDealearList[index]['parentDealerSn'] = val.key
     },
+    // 指定经销商  比例
     rateChange (val, index) {
       console.log(val, index)
       this.zdDealearList[index]['allotRate'] = val

+ 36 - 28
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -2,6 +2,7 @@
   <a-modal
     centered
     class="promotionList-basicInfo-modal"
+    id="promotionList-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
     :title="itemSn?'编辑':'新增'"
@@ -26,7 +27,7 @@
         <a-form-model-item label="促销时间" prop="activeDate">
           <a-range-picker
             style="width:100%"
-            id="promotionList-basicInfo-activeDate"
+            id="promotionList-activeDate"
             :disabledDate="disabledDate"
             v-model="form.activeDate"
             :format="dateFormat"
@@ -39,23 +40,23 @@
         <a-form-model-item label="参与客户" prop="dealerScope">
           <a-row :gutter="15">
             <a-col :md="12" :sm="24">
-              <a-select v-model="form.dealerScope" placeholder="请选择参与客户" @change="changeDealerScope" allowClear>
-                <a-select-option value="ALL_DEALER">全部客户</a-select-option>
-                <a-select-option value="SOME_DEALER">部分客户</a-select-option>
+              <a-select id="promotionList-dealerScope" v-model="form.dealerScope" placeholder="请选择参与客户" @change="changeDealerScope" allowClear>
+                <a-select-option id="promotionList-dealerScope-all" value="ALL_DEALER">全部客户</a-select-option>
+                <a-select-option id="promotionList-dealerScope-some" value="SOME_DEALER">部分客户</a-select-option>
               </a-select>
             </a-col>
             <a-col :md="3" :sm="24" v-show="form.dealerScope && form.dealerScope!='ALL_DEALER' ">
-              <a-button type="primary" :loading="spinning" @click="handleDealerModal">选择</a-button>
+              <a-button id="promotionList-basicInfo-dealerScope" type="primary" :loading="spinning" @click="handleDealerModal">选择</a-button>
             </a-col>
             <a-col :md="4" :sm="24" v-show="form.dealerScope && form.dealerScope!='ALL_DEALER' ">
-              <a-button type="primary" :loading="spinning" @click="openGuideModal=true" ghost>导入客户</a-button>
+              <a-button id="promotionList-basicInfo-import" type="primary" :loading="spinning" @click="openGuideModal=true" ghost>导入客户</a-button>
             </a-col>
             <a-col :md="5" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
               已{{ chooseDealerList.length }}选项
             </a-col>
             <a-col :md="24" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
               <div class="buyerBox">
-                <a-tag closable v-for="con in chooseDealerList" :key="con.dealerSn" @close="delBuyerName(con)">
+                <a-tag closable v-for="con in chooseDealerList" id="promotionList-dealerSn" :key="con.dealerSn" @close="delBuyerName(con)">
                   {{ con.dealerName }}
                 </a-tag>
               </div>
@@ -63,11 +64,11 @@
           </a-row>
         </a-form-model-item>
         <a-form-model-item label="订单起订金额" prop="minOrderFlag">
-          <a-select default-value="0" v-model="form.minOrderFlag" style="width: 180px" placeholder="请选择">
-            <a-select-option value="0">
+          <a-select default-value="0" id="promotionList-minOrderFlag" v-model="form.minOrderFlag" style="width: 180px" placeholder="请选择">
+            <a-select-option value="0" id="promotionList-minOrderFlag0">
               不限
             </a-select-option>
-            <a-select-option value="1">
+            <a-select-option value="1" id="promotionList-minOrderFlag1">
               限制
             </a-select-option>
           </a-select>
@@ -75,6 +76,7 @@
             v-show="form.minOrderFlag && form.minOrderFlag=='1'"
             style="margin-left:10px;width:300px;"
             v-model="form.minOrderAmount"
+            id="promotionList-minOrderAmount"
             :min="0"
             :step="1"
             :max="99999999"
@@ -82,11 +84,11 @@
             placeholder="请输入金额"/>
         </a-form-model-item>
         <a-form-model-item label="活动经费上限" prop="upperLimitFlag">
-          <a-select default-value="0" v-model="form.upperLimitFlag" style="width: 180px" placeholder="请选择">
-            <a-select-option value="0">
+          <a-select default-value="0" id="promotionList-upperLimitFlag" v-model="form.upperLimitFlag" style="width: 180px" placeholder="请选择">
+            <a-select-option value="0" id="promotionList-upperLimitFlag0">
               不限
             </a-select-option>
-            <a-select-option value="1">
+            <a-select-option value="1" id="promotionList-upperLimitFlag1">
               限制
             </a-select-option>
           </a-select>
@@ -94,6 +96,7 @@
             v-show="form.upperLimitFlag&&form.upperLimitFlag=='1'"
             style="margin-left:10px;width:300px;"
             v-model="form.upperLimitAmount"
+            id="promotionList-upperLimitAmount"
             :min="0"
             :step="1"
             :max="99999999"
@@ -112,7 +115,7 @@
         <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)">
           <Upload
             style="height: 100%;"
-            id="allocateBill-attachList"
+            id="promotionList-attachList"
             v-model="form.attachmentList"
             ref="attachList"
             :fileSize="10"
@@ -125,7 +128,7 @@
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="promotionList-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button id="promotionList-modal-cancel" @click="isShow = false">取消</a-button>
         <a-button style="margin-left: 15px;" type="primary" id="promotionList-modal-save" :loading="loadingSave" @click="handleSave">确定</a-button>
       </div>
     </a-spin>
@@ -150,12 +153,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+// 组件
 import { Upload } from '@/components'
 import department from '@/views/expenseManagement/expenseReimbursement/department.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import moment from 'moment'
 import chooseDealer from './chooseDealer'
 import importDealerModa from './importDealerModa.vue'
+// 接口
 import { dealerPromotionSave, dealerPromotionInfo, dealerPromotionEdit } from '@/api/promotion'
 export default {
   name: 'PromotionListBasicInfoModal',
@@ -173,30 +178,33 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单label布局
       formItemLayout: {
         labelCol: { span: 5 },
         wrapperCol: { span: 16 }
       },
+      // 提交参数
       form: {
-        title: '',
-        activeDate: undefined,
+        title: '', // 促销名称
+        activeDate: undefined, // 促销时间
         expenseDepartmentSn: undefined, // 费用所属部门
         description: '', // 活动简称
         content: '', // 活动描述
         attachmentList: '', // 附件
         promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER', // 全部客户   部分客户
-        minOrderFlag: '0', // 订单起订金额
-        minOrderAmount: undefined,
+        minOrderFlag: '0', // 订单起订
+        minOrderAmount: undefined, // 订单起订金额
         upperLimitFlag: '0', // 活动经费上限
-        upperLimitAmount: undefined
+        upperLimitAmount: undefined// 活动经费上限金额
       },
-      openDealerModal: false,
-      chooseDealerList: [],
+      openDealerModal: false, // 打开参与客户弹窗
+      chooseDealerList: [], // 所选参与客户数据
       attachList: [], // 附件
-      dateFormat: 'YYYY-MM-DD',
+      dateFormat: 'YYYY-MM-DD', // 时间显示格式
+      // 表单验证规则
       rules: {
         title: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
         activeDate: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
@@ -207,9 +215,9 @@ export default {
         upperLimitFlag: [{ required: true, message: '请选择活动经费上限', trigger: 'change' }],
         content: [{ required: true, message: '请输入促销描述', trigger: 'blur' }]
       },
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
-      openGuideModal: false,
-      loadingSave: false
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo', // 上传附件地址
+      openGuideModal: false, // 导入参与客户弹窗
+      loadingSave: false// 保存按钮加载状态
     }
   },
   methods: {

+ 8 - 4
src/views/promotionRulesManagement/dealerPromotions/brandCategoryModal.vue

@@ -1,6 +1,7 @@
 <template>
   <a-modal
     centered
+    id="brand-category-modal"
     class="brand-category-modal"
     :footer="null"
     :maskClosable="false"
@@ -26,12 +27,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect, Upload } from '@/components'
 import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+// 接口
+import { sparePartsReturnInfo } from '@/api/sparePartsReturn'
 export default {
-  name: 'PurchaseReturnBasicInfoModal',
+  name: 'BrandCategoryModal',
   mixins: [commonMixin],
   components: { VSelect, Upload, supplier, warehouse },
   props: {
@@ -46,8 +49,9 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
-      spinning: false
+      spinning: false,
+      isShow: this.openModal //  是否打开弹框
+
     }
   },
   methods: {

+ 34 - 27
src/views/promotionRulesManagement/dealerPromotions/chooseDealer.vue

@@ -2,12 +2,12 @@
   <a-spin :spinning="spinning" tip="Loading...">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" id="chooseDealer-form" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="8" :sm="24">
-            <a-form-model-item label="地区">
-              <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-            </a-form-model-item>
+            <a-form-item label="地区">
+              <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-item label="经销商名称/别名">
@@ -20,9 +20,9 @@
             </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
-            <a-form-model-item label="商户级别" prop="dealerLevel">
-              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-            </a-form-model-item>
+            <a-form-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="chooseDealer-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-item label="所在区域/分区">
@@ -35,7 +35,7 @@
           </a-col>
         </a-row>
       </a-form>
-      <!-- 列表 -->
+      <!-- 操作按钮 -->
       <div style="margin-bottom: 10px">
         <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
         <span style="margin-left: 5px">
@@ -43,6 +43,7 @@
         </span>
       </div>
     </div>
+    <!-- 列表 -->
     <a-table
       style="height: 420px;"
       :scroll="{ y: 330 }"
@@ -52,6 +53,7 @@
       :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
       :columns="columns"
       :data-source="dealerList"
+      id="chooseDealer-table"
       @change="handlePage"
       :loading="spinning"
     >
@@ -64,12 +66,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
+import dealerType from '@/views/common/dealerType.js'
+// 接口
 import { queryDealerPage } from '@/api/promotion'
 import { getDealerListInfo } from '@/api/dealer'
-import dealerType from '@/views/common/dealerType.js'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
@@ -89,33 +93,35 @@ export default {
   data () {
     return {
       spinning: false,
-      dealerType: [],
-      queryParam: { //  查询条件
-        nameLike: '',
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading,
+      dealerType: [], // 商户类型
+      //  查询条件
+      queryParam: {
+        nameLike: '', // 经销商名称/别名
         dealerType1: undefined, //  商户类型
         dealerType2: undefined, //  商户类型
-        dealerLevel: null,
+        dealerLevel: null, // 商户级别
         subareaArea: {
           subareaSn: undefined, //  区域
           subareaAreaSn: undefined // 分区
         },
-        auditState: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        auditState: undefined, // 审核状态
+        provinceSn: undefined, // 省
+        citySn: undefined, // 市
+        districtSn: undefined// 区
       },
+      // 表格分页配置
       pagination: {
-        pageSize: 20,
-        showSizeChanger: true,
-        pageSizeOptions: ['20', '50', '100', '200', '500']
+        pageSize: 20, // 每页显示20条
+        showSizeChanger: true, // 显示页面操作按钮
+        pageSizeOptions: ['20', '50', '100', '200', '500']// 每页显示数量
       },
-      pageFlag: false,
-      chooseInfo: [],
-      selectedRowKeys: [],
-      dealerList: [],
-      tableHeight: 0,
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false, // 批量添加loading,
+      pageFlag: false, // 页面锁
+      chooseInfo: [], // 所选列表重组数据
+      selectedRowKeys: [], // 所选列表数据
+      dealerList: [], // 列表数据
+      tableHeight: 0, // 表格高度
       columns: [
         { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '30%', align: 'left', ellipsis: true },
         { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -128,6 +134,7 @@ export default {
     }
   },
   computed: {
+    // 计算所选列表条数
     selectCount () {
       return this.selectedRowKeys && this.selectedRowKeys.length
     }

+ 11 - 6
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="promotion-modal"
+    class="promotion-add-modal"
     :footer="null"
     :maskClosable="false"
     :title="isEdit?'编辑':'新增'"
@@ -10,7 +10,7 @@
     :width="900">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="promotion-form"
+        id="promotion-add-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -67,7 +67,7 @@
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="promotion-add-back" @click="isShow = false" >取消</a-button>
+        <a-button id="promotion-add-cancel" @click="isShow = false" >取消</a-button>
         <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-add-save" @click="handleSave">确定</a-button>
       </div>
     </a-spin>
@@ -91,7 +91,9 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+// 组件
 import chooseDealer from './chooseDealer'
+// 接口
 import { promoTerminalSave, promoTerminalDetail } from '@/api/promoTerminal'
 export default {
   name: 'PromotionAddModal',
@@ -110,13 +112,15 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
       openDealerModal: false, // 选择经销商弹框
-      spinning: false,
+      // 表单label 布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
+      // 提交参数
       form: {
         promoActiveSn: undefined, // 活动sn
         name: '', // 活动名称
@@ -128,7 +132,8 @@ export default {
         description: '', // 活动描述
         promoBuyerList: [] // 参与经销商列表
       },
-      rules: { // 校验规则
+      // 校验规则
+      rules: {
         promoBuyerList: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
         time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
         name: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
@@ -271,7 +276,7 @@ export default {
 </script>
 
 <style lang="less">
-.promotion-modal {
+.promotion-add-modal {
 	.ant-modal-body {
 		padding: 40px 40px 24px;
 	}

+ 15 - 12
src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue

@@ -2,12 +2,12 @@
   <a-spin :spinning="spinning" tip="Loading...">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" id="chooseDealer-form" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="8" :sm="24" v-if="pageType=='dealerPromotion'">
-            <a-form-model-item label="地区">
-              <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-            </a-form-model-item>
+            <a-form-item label="地区">
+              <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-item label="经销商名称/别名">
@@ -20,9 +20,9 @@
             </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
-            <a-form-model-item label="商户级别" prop="dealerLevel">
-              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-            </a-form-model-item>
+            <a-form-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="chooseDealer-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24" v-if="pageType!='viewDealers'">
             <a-form-item label="所在区域/分区">
@@ -32,13 +32,13 @@
           <div v-else>
             <a-col :md="8" :sm="24">
               <a-form-item label="审核状态">
-                <v-select code="AUDIT_STATE" id="viewDealers-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+                <v-select code="AUDIT_STATE" id="chooseDealer-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-model-item label="地区">
-                <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-              </a-form-model-item>
+              <a-form-item label="地区">
+                <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+              </a-form-item>
             </a-col>
           </div>
           <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
@@ -75,10 +75,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
 import dealerType from '@/views/common/dealerType.js'
+// 接口
 import { dealerQueryList, getDealerListInfo } from '@/api/dealer'
 export default {
   name: 'ChooseDealer',
@@ -98,7 +100,8 @@ export default {
     return {
       spinning: false,
       dealerType: [], // 商户类型默认值
-      queryParam: { //  查询条件
+      //  查询条件
+      queryParam: {
         nameLike: '', // 商户名称
         dealerType1: undefined, //  商户类型1
         dealerType2: undefined, //  商户类型2

+ 11 - 5
src/views/promotionRulesManagement/promotionManagement/editModal.vue

@@ -1,6 +1,7 @@
 <template>
   <a-modal
     centered
+    id="promotionEdit-modal"
     class="promotionEdit-modal"
     :footer="null"
     :maskClosable="false"
@@ -136,7 +137,7 @@
         </a-form-model>
       </a-spin>
       <div class="btn-cont">
-        <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-right:15px;">取消</a-button>
+        <a-button id="promotionEdit-cancel" @click="isShow = false" style="margin-right:15px;">取消</a-button>
         <a-button
           style="margin-right:15px;color: #fff;background-color: #39f;border-color: #39f;"
           id="promotionEdit-views"
@@ -152,13 +153,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
 import promotionShowModal from './promotionShowModal'
+// 接口
 import { saveActive, promoTerminalDetail } from '@/api/promoTerminal'
-
 export default {
-  name: 'ProductBrandEditModal',
+  name: 'PromotionEditModal',
   mixins: [commonMixin],
   components: { VSelect, Upload, Editor, promotionShowModal },
   props: {
@@ -176,18 +178,21 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return this.pageType != 'add' ? '发布修改' : '促销发布'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交参数
       form: {
         promoActiveSn: undefined, // 活动sn
         title: '', // 标题
@@ -202,7 +207,8 @@ export default {
       images: [], // 图片
       openShowModal: false, // 预览弹框
       isDisabled: false, // 控制是否能编辑
-      rules: { // 规则校验
+      // 规则校验
+      rules: {
         title: [
           { required: true, message: '请输入标题名称', trigger: 'blur' }
         ],

+ 26 - 21
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -3,27 +3,27 @@
     <a-card size="small" :bordered="false" class="promotion-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 id="promotion-creatDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+                <rangeDate id="promotionList-creatDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="促销名称">
-                <a-input id="promotion-promotionName" v-model.trim="queryParam.name" allowClear placeholder="请输入总部销退单号"/>
+                <a-input id="promotionList-promotionName" v-model.trim="queryParam.name" allowClear placeholder="请输入总部销退单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-item label="显示状态">
                 <a-select
-                  id="promotion-showFlag"
+                  id="promotionList-showFlag"
                   v-model="queryParam.showFlag"
                   placeholder="请选择显示状态"
                 >
-                  <a-select-option :value="1">已显示</a-select-option>
-                  <a-select-option :value="0">未显示</a-select-option>
+                  <a-select-option id="promotionList-showFlag-1" :value="1">已显示</a-select-option>
+                  <a-select-option id="promotionList-showFlag-0" :value="0">未显示</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -32,7 +32,7 @@
                 <v-select
                   v-model="queryParam.state"
                   ref="saleStatus"
-                  id="promotion-saleStatus"
+                  id="promotionList-saleStatus"
                   code="PROMO_STATE"
                   placeholder="请选择促销状态"
                   allowClear></v-select>
@@ -40,8 +40,8 @@
             </a-col>
             <a-col :md="4" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button id="promotion-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-                <a-button id="promotion-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button id="promotionList-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button id="promotionList-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
               </span>
             </a-col>
           </a-row>
@@ -54,11 +54,12 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator" v-if="$hasPermissions('B_promotionManagementAdd')">
-          <a-button id="promotion-add" type="primary" @click="openAddModal = true">新增</a-button>
+          <a-button id="promotionList-add" type="primary" @click="openAddModal = true">新增</a-button>
         </div>
         <s-table
           class="sTable fixPagination"
           ref="table"
+          id="promotionList-table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
           :rowKey="(record) => record.id"
@@ -68,8 +69,8 @@
           :defaultLoadData="false"
           bordered>
           <!-- 自定义表头 -->
-          <template slot="arrowFalgTitle">
-            <a-tooltip placement="top">
+          <template slot="arrowFalgTitle" slot-scope="text, record">
+            <a-tooltip placement="top" :id="'promotionList-showState-'+record.id">
               <template slot="title">
                 <span>易码通轮播促销展示显示状态</span>
               </template>
@@ -81,7 +82,7 @@
             <a-switch
               checkedChildren="显示"
               unCheckedChildren="隐藏"
-              :id="'promotion-isEnable-'+record.id"
+              :id="'promotionList-isEnable-'+record.id"
               v-model="record.isEnable"
               :disabled="record.state!='PUBLISH'"
               @change="changeFlagHandle(record)" />
@@ -92,7 +93,7 @@
           </template>
           <!-- 参与客户 -->
           <template slot="joinCustomers" slot-scope="text, record">
-            <span @click="handleCustomers(record)" v-if="record.promoBuyerSnSet&&record.promoBuyerSnSet.length>0">共有<span class="link-bule">{{ record.promoBuyerSnSet.length }}</span>个客户</span>
+            <span :id="'promotionList-promoBuyerSnSet-'+record.id" @click="handleCustomers(record)" v-if="record.promoBuyerSnSet&&record.promoBuyerSnSet.length>0">共有<span class="link-bule">{{ record.promoBuyerSnSet.length }}</span>个客户</span>
             <span v-else>共有0个客户</span>
           </template>
           <!-- 促销描述 -->
@@ -101,14 +102,14 @@
               <template slot="title">
                 <span>{{ record.description }}</span>
               </template>
-              <div :id="'promotion-description-'+record.id" @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
+              <div :id="'promotionList-description-'+record.id" @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
             </a-tooltip>
             <div v-else-if="!record.description" class="desc">--</div>
-            <div v-else :id="'promotion-description-'+record.id" @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
+            <div v-else :id="'promotionList-description-'+record.id" @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
           </template>
           <!-- 促销展示 -->
           <template slot="salesShow" slot-scope="text, record">
-            <div @click="handleSaleShow(record)" :id="'promotion-imageSet-'+record.id" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
+            <div @click="handleSaleShow(record)" :id="'promotionList-imageSet-'+record.id" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
               <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
             </div>
             <div v-else-if="record.contentType=='LINK'&&record.imageSet && record.imageSet.length>0">
@@ -125,28 +126,28 @@
                 class="button-warning"
                 @click="promotionEdit(record)"
                 v-if="(record.state=='UNPUBLISH' || record.state=='CLOSE') && $hasPermissions('B_promotionManagementAdd')"
-                :id="'promotion-edit-'+record.id" >促销编辑</a-button>
+                :id="'promotionList-edit-'+record.id" >促销编辑</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-warning"
                 @click="handleRelease(record,'edit')"
                 v-if="(record.state=='PUBLISH' || record.state=='CLOSE')&&$hasPermissions('B_promotionManagementContent')"
-                :id="'promotion-pubEdit-'+record.id" >发布修改</a-button>
+                :id="'promotionList-pubEdit-'+record.id" >发布修改</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-info"
                 @click="handleRelease(record,'add')"
                 v-if="record.state=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
-                :id="'promotion-publish-'+record.id" >促销发布</a-button>
+                :id="'promotionList-publish-'+record.id" >促销发布</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-error"
                 v-if="record.state=='UNPUBLISH'&&$hasPermissions('B_promotionManagementDel')"
                 @click="handleDel(record)"
-                :id="'promotion-del-'+record.id" >删除</a-button>
+                :id="'promotionList-del-'+record.id" >删除</a-button>
               <span v-if="record.state=='End'">--</span>
             </div>
           </template>
@@ -168,6 +169,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import lookUpCustomersModal from './lookUpCustomersModal'
@@ -175,6 +177,7 @@ import promotionDescModal from './promotionDescModal'
 import promotionShowModal from './promotionShowModal'
 import addModal from './addModal'
 import promotionEditModal from './editModal'
+// 接口
 import { promoTerminalList, promoTerminalDel, updateShowFlag } from '@/api/promoTerminal'
 export default {
   name: 'PromotionList',
@@ -217,10 +220,12 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        // 获取列表数据  有分页
         return promoTerminalList(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

+ 16 - 13
src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue

@@ -2,6 +2,7 @@
   <a-modal
     centered
     class="lookUpCustomers-modal"
+    id="lookUpCustomers-modal"
     :footer="null"
     :maskClosable="false"
     title="参与客户"
@@ -12,28 +13,28 @@
       <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="地区">
-                  <AreaList id="cykh-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-                </a-form-model-item>
+                <a-form-item label="地区">
+                  <AreaList id="lookUpCustomers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="区域/分区">
-                  <subarea ref="subarea" id="cykh-subarea" @change="subareaChange"></subarea>
-                </a-form-model-item>
+                <a-form-item label="区域/分区">
+                  <subarea ref="subarea" id="lookUpCustomers-subarea" @change="subareaChange"></subarea>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="经销商名称">
-                  <a-input id="cykh-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                  <a-input id="lookUpCustomers-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
                 </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="cykh-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="cykh-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="cykh-export"
+                  id="lookUpCustomers-export"
                   style="margin-left: 10px"
                   type="primary"
                   class="button-warning"
@@ -72,9 +73,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { STable } from '@/components'
 import { hdExportExcel } from '@/libs/exportExcel'
 // 组件
+import { STable } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 // 接口
@@ -93,7 +94,7 @@ export default {
   data () {
     return {
       spinning: false,
-      disabled: false,
+      disabled: false, // 查询、重置按钮是否可以操作
       isShow: this.openModal, //  是否打开弹框
       exportLoading: false, // 导出按钮loading
       // 查询参数
@@ -112,10 +113,12 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        // 获取列表数据 有分页
         return dealerQueryList(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

+ 1 - 1
src/views/promotionRulesManagement/promotionManagement/promotionDescModal.vue

@@ -34,7 +34,7 @@ export default {
   },
   data () {
     return {
-      modalTit: '促销描述',
+      modalTit: '促销描述', // 弹窗标题
       isShow: this.openModal //  是否打开弹框
     }
   },

+ 13 - 11
src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue

@@ -1,25 +1,26 @@
 <template>
   <a-modal
     centered
-    class="promotionDesc-modal"
+    class="promotionShow-modal"
+    id="promotionShow-modal"
     :footer="null"
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
     @cancel="isShow=false"
     :width="500">
-    <div class="promotionDesc-con">
+    <div class="promotionShow-con">
       <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
-      <div class="promotionDescCon" v-if="showType==='IMAGE_CONTENT'" v-html="mainContent"></div>
-      <div class="promotionDescCon" v-if="showType=='VIDEO'" >
+      <div class="promotionShowCon" v-if="showType==='IMAGE_CONTENT'" v-html="mainContent"></div>
+      <div class="promotionShowCon" v-if="showType=='VIDEO'" >
         <video width="100%" height="auto" controls loop controlsList="nodownload">
           <source :src="mainContent" type="video/mp4"></source>
         </video>
       </div>
     </div>
     <div class="btn-cont">
-      <!-- <a-button id="promotionDesc-modal-back" @click="isShow = false" style="margin-right:10px;">下载图片</a-button> -->
-      <a-button id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
+      <!-- <a-button id="promotionShow-modal-back" @click="isShow = false" style="margin-right:10px;">下载图片</a-button> -->
+      <a-button id="promotionShow-modal-back" @click="isShow = false">关闭</a-button>
     </div>
   </a-modal>
 </template>
@@ -27,7 +28,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 export default {
-  name: 'PromotionDescModal',
+  name: 'PromotionShowModal',
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -44,6 +45,7 @@ export default {
     }
   },
   methods: {
+    // 初始化
     pageInit (con) {
       this.showType = con.type
       this.mainContent = con.con
@@ -65,12 +67,12 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .promotionDesc-modal{
+  .promotionShow-modal{
     /deep/.ant-modal-body{
        text-algin:center !important;
     }
 
-    .promotionDesc-con{
+    .promotionShow-con{
       width:340px;
       margin:0 auto;
       position:relative;
@@ -79,7 +81,7 @@ export default {
          width:81%;
          height:auto;
        }
-       .promotionDescCon{
+       .promotionShowCon{
          position: absolute;
          left:15%;
          top:12.5%;
@@ -89,7 +91,7 @@ export default {
          scrollbar-width:none;
          -ms-overflow-style: none;
        }
-       .promotionDescCon::-webkit-scrollbar{
+       .promotionShowCon::-webkit-scrollbar{
            display:none;
        }
     }

+ 17 - 10
src/views/supplierManagement/associatedProduct/add.vue

@@ -4,15 +4,14 @@
       <a-page-header :ghost="false" :backIcon="false" class="associatedProduct-head" @back="handleBack" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="salesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="associatedProduct-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">供应商名称:{{ decodeURI($route.params.name) }}</span>
         </template>
       </a-page-header>
-      <!-- 列表 -->
       <a-card size="small" :bordered="false">
         <!-- 搜索条件 -->
         <div ref="tableSearch" class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="associatedProduct-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="5" :sm="24">
                 <a-form-item label="产品名称">
@@ -75,7 +74,7 @@
               type="link"
               class="button-error"
               @click="handleDel(record)"
-              id="associatedProduct-del-btn">删除</a-button>
+              :id="'associatedProduct-del-btn-'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -91,13 +90,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { supplierProductList, deleteProduct, addProduct, supplierProductSnList, supplierProductBatchInsert } from '@/api/supplier'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import SettingCost from './settingCost.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import ChooseProductsModal from '@/views/common/chooseProductsModal.vue'
+// 接口
+import { supplierProductList, deleteProduct, addProduct, supplierProductSnList, supplierProductBatchInsert } from '@/api/supplier'
 export default {
   name: 'AssociatedProduct',
   mixins: [commonMixin],
@@ -105,12 +106,13 @@ export default {
   data () {
     return {
       spinning: false,
-      disabled: false,
-      advanced: true,
+      disabled: false, // 查询、重置按钮是否可操作
+      advanced: true, // 搜索条件展开关闭
       tableHeight: 0, // 表格高度
       openModal: false, // 设置价格 弹框
       newProduct: false, // 选择产品 弹框
-      queryParam: { //  查询条件
+      //  查询条件
+      queryParam: {
         product: {
           name: '', //  产品名称
           queryWord: '', // 产品编码/原厂编码
@@ -120,16 +122,18 @@ export default {
           productTypeSn3: '' //  产品三级分类
         }
       },
-      productType: [],
+      productType: [], // 产品分类
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         this.queryParam.supplierSn = this.$route.params.sn
+        // 获取列表数据 有分页
         return supplierProductList(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
@@ -162,7 +166,7 @@ export default {
   methods: {
     // 返回
     handleBack () {
-      this.$router.push({ path: '/supplierManagement/supplierInfo/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'supplierInfoList', query: { closeLastOldTab: true } })
     },
     //  产品分类  change
     changeProductType (val, opt) {
@@ -254,18 +258,21 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算列表高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 295
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 6 - 4
src/views/supplierManagement/associatedProduct/chooseImportModal.vue

@@ -67,6 +67,7 @@
 
 <script>
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { supplierProductParseProducts, supplierProductailExcel } from '@/api/supplier'
 export default {
   name: 'ChooseImportModal',
@@ -100,12 +101,13 @@ export default {
         { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
-      loading: false
+      loadData: [], // 列表可导入数据
+      unLoadData: [], // 列表不可导入数据
+      loading: false// 表格加载状态
     }
   },
   methods: {
+    // 获取列表数据
     getData () {
       const _this = this
       this.loading = true
@@ -136,7 +138,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {

+ 8 - 5
src/views/supplierManagement/associatedProduct/importGuideModal.vue

@@ -63,8 +63,10 @@
 </template>
 
 <script>
-import ChooseImportModal from './chooseImportModal.vue'
+// 组件
 import { Upload } from '@/components'
+import ChooseImportModal from './chooseImportModal.vue'
+// 接口
 import { supplierProductDownload } from '@/api/supplier'
 export default {
   name: 'ImportGuideModal',
@@ -83,12 +85,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传地址
+      paramsData: null, // 上传所需参数
+      uploadParams: {// 上传方式
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false// 导出错误项按钮加载状态
     }
   },
   methods: {
@@ -144,6 +146,7 @@ export default {
         }
       })
     },
+    // 下载模板
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))

+ 10 - 5
src/views/supplierManagement/associatedProduct/settingCost.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="merchantInfoManagement-modal"
+    class="settingCost-modal"
     :footer="null"
     :maskClosable="false"
     :title="title"
@@ -25,7 +25,7 @@
           </a-form-model-item>
           <a-form-model-item label="成本价" prop="cost">
             <a-input-number
-              id="setting-cost"
+              id="settingCost-cost"
               v-model="form.cost"
               :precision="2"
               :min="0"
@@ -51,7 +51,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { settingCost } from '@/api/supplier'
 export default {
   name: 'SettingCost',
@@ -65,18 +67,21 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      title: '设置成本价',
+      isShow: this.openModal, //  是否打开弹框
+      title: '设置成本价', // 弹窗标题
+      // 表单label布局
       labelCol: { span: 4 },
       wrapperCol: { span: 18 },
       productName: '', // 产品名称
       productCode: '', // 产品编码
+      // 提交参数
       form: {
         supplierSn: '', // 供应商sn
         supplierProductSn: '', // 产品sn
         cost: '' // 成本
       },
+      // 表单验证规则
       rules: {
         cost: [
           { required: true, message: '请输入成本价', trigger: 'change' }
@@ -148,7 +153,7 @@ export default {
 </script>
 
 <style lang="less">
-  .merchantInfoManagement-modal{
+  .settingCost-modal{
     .ant-modal-body {
       padding: 40px 40px 24px;
     }

+ 14 - 5
src/views/supplierManagement/associatedProductDetails/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="associatedProductList-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="associatedProductList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="供应商名称">
@@ -23,19 +23,19 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品分类">
-                  <ProductType id="associatedProduct-productType" v-model="productType" @change="changeProductType"></ProductType>
+                  <ProductType id="associatedProductList-productType" v-model="productType" @change="changeProductType"></ProductType>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="品牌">
-                  <ProductBrand id="associatedProduct-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
+                  <ProductBrand id="associatedProductList-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="associatedProductList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="associatedProductList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="associatedProductList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -48,6 +48,7 @@
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
         <s-table
+          id="associatedProductList-table"
           class="sTable fixPagination"
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
@@ -72,9 +73,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
+// 接口
 import { supplierProductList } from '@/api/supplier'
 export default {
   name: 'AssociatedProductDetailsList',
@@ -85,7 +88,8 @@ export default {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0, // 表格高度
-      queryParam: { //  查询条件
+      //  查询条件
+      queryParam: {
         supplierName: '', // 供应商名称
         product: {
           name: '', //  产品名称
@@ -102,10 +106,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return supplierProductList(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
@@ -153,18 +159,21 @@ export default {
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 20 - 14
src/views/supplierManagement/costSetRecord/list.vue

@@ -3,36 +3,36 @@
     <a-card size="small" :bordered="false" class="costSetRecordList-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="costSetRecordList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
-                <a-input id="costSetList-productName" v-model.trim="queryParam.product.name" allowClear placeholder="请输入产品名称"/>
+                <a-input id="costSetRecordList-productName" v-model.trim="queryParam.product.name" allowClear placeholder="请输入产品名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品编码/原厂编码">
-                <a-input id="costSetList-productCode" v-model.trim="queryParam.product.queryWord" allowClear placeholder="请输入产品编码"/>
+                <a-input id="costSetRecordList-productCode" v-model.trim="queryParam.product.queryWord" allowClear placeholder="请输入产品编码"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="品牌">
-                <ProductBrand id="costSetRecord-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
+                <ProductBrand id="costSetRecordList-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="产品分类">
-                <ProductType id="costSetRecord-productType" v-model="productType" @change="changeProductType"></ProductType>
+                <ProductType id="costSetRecordList-productType" v-model="productType" @change="changeProductType"></ProductType>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="供应商名称">
-                <a-input id="costSetList-productName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
+                <a-input id="costSetRecordList-productName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
               </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="costSetList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="costSetList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="costSetRecordList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="costSetRecordList-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
                 type="primary"
@@ -41,7 +41,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_costSetRecordExport')"
-                id="costSetDetailList-export">导出</a-button>
+                id="costSetRecordList-export">导出</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -51,6 +51,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 列表 -->
         <s-table
+          id="costSetRecordList-table"
           class="sTable fixPagination"
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
@@ -75,10 +76,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
+import { STable, VSelect } from '@/components'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
+// 接口
 import { supplierProductCostLogList, supplierProductCostLogExport } from '@/api/supplier'
 export default {
   name: 'CostSetRecordList',
@@ -89,8 +92,10 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
         supplierName: '', // 供应商名称
         product: {
           name: '', //  产品名称
@@ -112,18 +117,18 @@ export default {
         { title: '供应商名称', dataIndex: 'supplierName', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '变更前', dataIndex: 'oldCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '变更后', dataIndex: 'newCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
-
       ],
-      disabled: false, //  查询、重置按钮是否可操作
       productType: [], // 产品分类默认值
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return supplierProductCostLogList(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
@@ -180,6 +185,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 21 - 15
src/views/supplierManagement/costSetting/addProductModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="chooseProducts-modal"
+    class="addProduct-modal"
     :footer="null"
     :maskClosable="false"
     title="新增"
@@ -14,7 +14,7 @@
           <div style="font-size:14px;"><span style="color:red;">*</span>供应商名称:</div>
           <div style="flex-grow: 1;">
             <supplier
-              id="chooseProducts-supplier"
+              id="addProduct-supplier"
               style="width:50%"
               ref="supplier"
               v-model="supplierSn"
@@ -32,6 +32,7 @@
           <!-- 搜索条件 -->
           <div class="table-page-search-wrapper">
             <a-form-model
+              id="addProduct-form"
               ref="ruleForm"
               class="form-model-con"
               layout="inline"
@@ -43,22 +44,22 @@
               <a-row :gutter="15">
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="产品编码" prop="code">
-                    <a-input id="chooseProducts-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+                    <a-input id="addProduct-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="产品品牌">
-                    <ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                    <ProductBrand id="addProduct-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="产品分类">
-                    <ProductType id="chooseProducts-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType"></ProductType>
+                    <ProductType id="addProduct-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType"></ProductType>
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                  <a-button type="primary" @click="handleSearch" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
-                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
+                  <a-button type="primary" @click="handleSearch" :disabled="disabled" id="addProduct-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="addProduct-reset">重置</a-button>
                 </a-col>
               </a-row>
             </a-form-model>
@@ -82,13 +83,13 @@
         <!-- 按钮 -->
         <div class="btn-con">
           <a-button
-            id="chooseProducts-cancel"
+            id="addProduct-cancel-btn"
             class="button-cancel"
             @click="isShow=false"
             style="padding: 0 30px;margin-right: 15px;">取消</a-button>
           <a-button
             type="primary"
-            id="chooseProducts-save"
+            id="addProduct-save-btn"
             @click="handleSave"
             style="padding: 0 30px;">保存</a-button>
         </div>
@@ -98,14 +99,16 @@
 </template>
 
 <script>
+// 组件
 import { STable } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
 import supplier from '@/views/common/supplier.js'
-import { addProduct, supplierProductSnList } from '@/api/supplier'
+// 接口
 import { productPricingList } from '@/api/product'
+import { addProduct, supplierProductSnList } from '@/api/supplier'
 export default {
-  name: 'ChooseProductsModal',
+  name: 'AddProductModal',
   components: { STable, supplier, ProductType, ProductBrand },
   props: {
     openModal: { //  弹框显示状态
@@ -125,12 +128,16 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
+      // 表单label布局设置
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
       supplierSn: undefined, // 供应商sn
-      queryParam: { //  查询条件
+      //  查询条件
+      queryParam: {
         code: '', //  产品编码
         productBrandSn: undefined, //  产品品牌
         productType: [], // 产品分类默认值
@@ -138,13 +145,12 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
+      // 表单验证规则
       rules: {
         productBrandSn: [ { required: true, message: '请选择产品品牌', trigger: 'change' } ],
         productType: [ { required: true, message: '请选择产品分类', trigger: 'change' } ]
       },
       chooseData: [], // 已选产品
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false, //  表格加载中
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'code', align: 'center' },
@@ -169,7 +175,7 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 表格选中数据
     }
   },
   methods: {

+ 5 - 2
src/views/supplierManagement/costSetting/chooseImportModal.vue

@@ -1,6 +1,7 @@
 <template>
   <a-modal
     centered
+    id="costSetting-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 { supplierProductParseNewProducts, supplierProductailNewExcel } from '@/api/supplier'
 export default {
   mixins: [commonMixin],
@@ -105,10 +107,11 @@ export default {
       ],
       loadData: [], // 正确数据
       unLoadData: [], // 错误数据
-      loading: false
+      loading: false// 表格加载状态
     }
   },
   methods: {
+    // 获取列表数据
     getData () {
       const _this = this
       this.loading = true
@@ -143,7 +146,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {

+ 5 - 2
src/views/supplierManagement/costSetting/importGuideModal.vue

@@ -1,6 +1,7 @@
 <template>
   <a-modal
     centered
+    id="costSetting-importGuide-modal"
     class="importGuide-modal"
     :footer="null"
     :maskClosable="false"
@@ -69,8 +70,10 @@
 </template>
 
 <script>
-import ChooseImportModal from './chooseImportModal.vue'
+// 组件
 import { Upload } from '@/components'
+import ChooseImportModal from './chooseImportModal.vue'
+// 接口
 import { supplierProductNewDownloadExcel } from '@/api/supplier'
 export default {
   name: 'ImportGuideModal',
@@ -94,7 +97,7 @@ export default {
       uploadParams: {
         savePathType: 'local' // 文件上传位置
       },
-      exportLoading: false // loading
+      exportLoading: false // 导出错误项loading
     }
   },
   methods: {

+ 20 - 13
src/views/supplierManagement/costSetting/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="costSetList-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="costSetList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="产品名称">
@@ -52,7 +52,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_costSetExportDetail')"
-                id="costSetDetailList-export">导出明细</a-button>
+                id="costSeting-export">导出明细</a-button>
             </a-col>
           </a-row>
         </a-form>
@@ -62,14 +62,15 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button id="costSetDetailList-new" type="primary" v-if="$hasPermissions('B_costSetAddProduct')" @click="newProduct=true">新增</a-button>
-          <a-button id="costSetDetailList-import" type="primary" v-if="$hasPermissions('B_costSetBatchImport')" class="button-warning" @click="handleBatchImport">批量导入</a-button>
-          <a-button id="costSetDetailList-paudit" type="primary" ghost v-if="$hasPermissions('B_costSetAudit')" @click="handleBatchAudit">批量审核</a-button>
+          <a-button id="costSeting-new" type="primary" v-if="$hasPermissions('B_costSetAddProduct')" @click="newProduct=true">新增</a-button>
+          <a-button id="costSeting-import" type="primary" v-if="$hasPermissions('B_costSetBatchImport')" class="button-warning" @click="handleBatchImport">批量导入</a-button>
+          <a-button id="costSeting-paudit" type="primary" ghost v-if="$hasPermissions('B_costSetAudit')" @click="handleBatchAudit">批量审核</a-button>
         </div>
         <!-- 列表 -->
         <s-table
           class="sTable fixPagination"
           ref="table"
+          id="costSeting-table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
           :rowKey="(record) => record.supplierProductSn"
@@ -91,7 +92,7 @@
           <template slot="action" slot-scope="text, record">
             <div>
               <a-button
-                :id="'costSetDetailList-audit-'+record.id"
+                :id="'costSetList-audit-'+record.id"
                 size="small"
                 type="link"
                 class="button-warning"
@@ -99,7 +100,7 @@
                 @click="handleAudit([record.supplierProductSn])"
               >审核</a-button>
               <a-button
-                :id="'costSetDetailList-editcost-'+record.id"
+                :id="'costSetList-editcost-'+record.id"
                 size="small"
                 type="link"
                 class="button-warning"
@@ -107,7 +108,7 @@
                 @click="handleCostSet(record,editFlag = true)"
               >编辑成本</a-button>
               <a-button
-                :id="'costSetDetailList-setcost-'+record.id"
+                :id="'costSetList-setcost-'+record.id"
                 size="small"
                 type="link"
                 class="button-warning"
@@ -131,6 +132,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import { hdExportExcel } from '@/libs/exportExcel'
 import ProductType from '@/views/common/productType.js'
@@ -138,6 +140,7 @@ import ProductBrand from '@/views/common/productBrand.js'
 import addProductModal from './addProductModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
 import SettingCost from './settingCost.vue'
+// 接口
 import { supplierProductList, supplierProductExportDetail, supplierProductUpdateAuditState, supplierProductNewBatchInsert } from '@/api/supplier'
 export default {
   name: 'CostSettingList',
@@ -146,12 +149,14 @@ export default {
   data () {
     return {
       spinning: false,
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
+      disabled: false, //  查询、重置按钮是否可操作
       advanced: true, // 高级搜索 展开/关闭
       openGuideModal: false, // 导入指导弹窗
       tableHeight: 0, // 表格高度
-      queryParam: { //  查询条件
-        supplierName: '',
+      //  查询条件
+      queryParam: {
+        supplierName: '', // 供应商名称
         product: {
           name: '', //  产品名称
           queryWord: '', // 产品编码/原厂编码
@@ -162,16 +167,17 @@ export default {
         },
         auditState: undefined // 审核状态
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      productType: [],
+      productType: [], // 产品分类
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据
         return supplierProductList(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
@@ -326,6 +332,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 9 - 5
src/views/supplierManagement/costSetting/settingCost.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="merchantInfoManagement-modal"
+    class="settingCost-modal"
     :footer="null"
     :maskClosable="false"
     :title="title"
@@ -11,12 +11,12 @@
     <div>
       <a-spin :spinning="spinning" tip="Loading...">
         <a-form-model
+          id="settingCost-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
           :label-col="labelCol"
-          :wrapper-col="wrapperCol"
-        >
+          :wrapper-col="wrapperCol">
           <a-form-model-item style="margin-bottom:10px;" label="产品名称">
             <div style="line-height:normal;padding-top:11px;">{{ productName }}</div>
           </a-form-model-item>
@@ -31,7 +31,7 @@
           </a-form-model-item>
           <a-form-model-item label="变更成本价" prop="modifyCost">
             <a-input-number
-              id="setting-cost"
+              id="settingCost-modifyCost"
               v-model="form.modifyCost"
               :precision="2"
               :min="0"
@@ -57,7 +57,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { settingCost } from '@/api/supplier'
 export default {
   name: 'SettingCost',
@@ -75,9 +77,10 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
       title: '设置成本价', // 标题
+      // 表单label布局设置
       labelCol: { span: 4 },
       wrapperCol: { span: 18 },
       productName: '', // 产品名称
@@ -89,6 +92,7 @@ export default {
         supplierProductSn: '', // 产品sn
         modifyCost: '' // 最新成本
       },
+      // 表单验证规则
       rules: {
         modifyCost: [
           { required: true, message: '请输入成本价', trigger: 'change' }

+ 10 - 6
src/views/supplierManagement/supplierInfo/edit.vue

@@ -4,7 +4,7 @@
       <a-page-header :ghost="false" :backIcon="false" @back="handleBack" class="supplierInfoEdit-cont">
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="merchantInfoManagement-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="supplierInfoEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
         </template>
       </a-page-header>
       <a-form-model
@@ -56,21 +56,21 @@
                       <a-col span="8">
                         <a-form-model-item prop="provinceSn">
                           <a-select id="supplierInfoEdit-provinceSn" allowClear @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
-                            <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                            <a-select-option :id="'supplierInfoEdit-provinceSn'+item.areaSn" v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
                           </a-select>
                         </a-form-model-item>
                       </a-col>
                       <a-col span="8">
                         <a-form-model-item prop="citySn">
                           <a-select id="supplierInfoEdit-citySn" allowClear @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
-                            <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
+                            <a-select-option :id="'supplierInfoEdit-citySn'+item.areaSn" v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
                           </a-select>
                         </a-form-model-item>
                       </a-col>
                       <a-col span="8">
                         <a-form-model-item prop="districtSn">
                           <a-select id="supplierInfoEdit-districtSn" allowClear @change="areaCharged" v-model="form.districtSn" placeholder="请选择区/县">
-                            <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
+                            <a-select-option :id="'supplierInfoEdit-districtSn'+item.areaSn" v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
                           </a-select>
                         </a-form-model-item>
                       </a-col>
@@ -230,7 +230,7 @@
                 <a-col :xs="24" :sm="24" :md="24" :lg="16" :xl="16">
                   <a-form-model-item label="备注" prop="remark" :label-col="{span:4}" :wrapper-col="{span:20}">
                     <a-textarea
-                      id="merchantInfoManagementEdit-remark"
+                      id="supplierInfoEdit-remark"
                       :maxLength="300"
                       v-model="form.remark"
                       placeholder="请输入备注(最多300字符)"
@@ -259,8 +259,10 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
-import { getArea } from '@/api/data'
+// 组件
 import { VSelect } from '@/components'
+// 接口
+import { getArea } from '@/api/data'
 import { supplierDetail, supplierSave } from '@/api/supplier.js'
 export default {
   name: 'SupplierInfoEdit',
@@ -269,6 +271,7 @@ export default {
   data () {
     return {
       spinning: false,
+      // 表单 label布局
       formItemLayout: {
         labelCol: {
           span: 8
@@ -303,6 +306,7 @@ export default {
         contactRole2: '', // 联系人2角色
         remark: '' // 备注
       },
+      // 表单验证规则
       rules: {
         supplierName: [
           { required: true, message: '请输入供应商名称', trigger: 'change' }

+ 19 - 7
src/views/supplierManagement/supplierInfo/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="supplierInfoList-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="supplierInfoList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="供应商名称">
@@ -39,7 +39,13 @@
           bordered>
           <!-- 状态 -->
           <template slot="enabledFlag" slot-scope="text, record">
-            <a-switch v-if="$hasPermissions('B_supplierInfo_enabled')" checkedChildren="启用" unCheckedChildren="禁用" v-model="record.enableFlag" @change="changeFlagHandle(text, record)"/>
+            <a-switch
+              :id="'supplierInfoList-enableFlag-'+record.id"
+              v-if="$hasPermissions('B_supplierInfo_enabled')"
+              checkedChildren="启用"
+              unCheckedChildren="禁用"
+              v-model="record.enableFlag"
+              @change="changeFlagHandle(text, record)"/>
             <span v-else :style="{color:(record.enableFlag==1?'#00aa00':'#999')}"> {{ record.enableFlag==1? '已启用': '已禁用' }} </span>
           </template>
           <!-- 操作 -->
@@ -57,7 +63,7 @@
               v-if="$hasPermissions('B_supplierInfo_edit')"
               class="button-info"
               @click="handleEdit(record)"
-              id="supplierInfoList-edit-btn">编辑</a-button>
+              :id="'supplierInfoList-edit-btn-'+record.id">编辑</a-button>
             <span v-if="!$hasPermissions('B_supplierInfo_relation') && !$hasPermissions('B_supplierInfo_edit')">--</span>
           </template>
         </s-table>
@@ -68,7 +74,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { supplierList, updateEnableStatus } from '@/api/supplier'
 export default {
   name: 'SupplierInfoList',
@@ -77,11 +85,12 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      //  查询条件
+      queryParam: {
         supplierName: '' //  供应商名称
       },
-      disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -91,16 +100,19 @@ export default {
         { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
-      total: 0,
+      total: 0, // 总计数量
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return supplierList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 获取数据总条数
             this.total = data.count || 0
+            // 计算表格显示序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1