Browse Source

修改bug

chenrui 1 year ago
parent
commit
63f4f10b4b

+ 28 - 23
src/views/dealerManagement/merchantInfoManagement/chooseTypeList.vue

@@ -67,7 +67,31 @@ export default {
       showTableHead: true, // 显示表头
       chooseDataList: [],
       selectedRowKeys: [],
-      checkboxOption: {
+      queryParam: {
+        productBrandSn: undefined,
+        productTypeSn1: undefined, //  产品一级分类
+        productTypeSn2: undefined, //  产品二级分类
+        productTypeSn3: undefined //  产品三级分类
+      },
+      productType: [],
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      dataSource: []
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '', field: '', key: 'acheck', width: 60, type: 'checkbox', align: 'center' },
+        { title: '品牌', field: 'productBrandName', key: 'a', align: 'center', width: 160, operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '一级分类', field: 'productTypeName1', key: 'b', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '二级分类', field: 'productTypeName2', key: 'c', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
+        { title: '三级分类', field: 'productTypeName3', key: 'd', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } }
+      ]
+      return arr
+    },
+    checkboxOption () {
+      return {
+        selectedRowKeys: this.selectedRowKeys,
         // 行选择改变事件
         selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
           const selectedRowKeysInfo = selectedRowKeys.map(item => {
@@ -90,28 +114,7 @@ export default {
           this.selectedRowKeys = selectedRowKeys
           this.chooseDataList = selectedRowKeysInfo
         }
-      },
-      queryParam: {
-        productBrandSn: undefined,
-        productTypeSn1: undefined, //  产品一级分类
-        productTypeSn2: undefined, //  产品二级分类
-        productTypeSn3: undefined //  产品三级分类
-      },
-      productType: [],
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      dataSource: []
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
-        { title: '', field: '', key: 'acheck', width: 60, type: 'checkbox', align: 'center' },
-        { title: '品牌', field: 'productBrandName', key: 'a', align: 'center', width: 160, operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
-        { title: '一级分类', field: 'productTypeName1', key: 'b', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
-        { title: '二级分类', field: 'productTypeName2', key: 'c', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } },
-        { title: '三级分类', field: 'productTypeName3', key: 'd', width: 160, align: 'center', operationColumn: false, renderBodyCell: ({ row, column }) => { return row[column.field] || '--' } }
-      ]
-      return arr
+      }
     }
   },
   methods: {
@@ -145,6 +148,7 @@ export default {
       }
       this.productType = []
       this.getTableData()
+      this.clearSelectTable()
     },
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : undefined
@@ -154,6 +158,7 @@ export default {
     // 清空选项
     clearSelectTable () {
       this.selectedRowKeys = []
+      this.chooseDataList = []
     }
   }
 

+ 5 - 6
src/views/dealerManagement/merchantInfoManagement/permissionSettingNew.vue

@@ -104,9 +104,9 @@ export default {
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '品牌', dataIndex: 'productBrandName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '一级分类', dataIndex: 'productTypeName1', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '二级分类', dataIndex: 'productTypeName2', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '三级分类', dataIndex: 'productTypeName3', align: 'left', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '15%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '二级分类', dataIndex: 'productTypeName2', align: 'center', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '三级分类', dataIndex: 'productTypeName3', align: 'center', width: '20%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -117,9 +117,8 @@ export default {
           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
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = i + 1
             }
             this.disabled = false
           }