浏览代码

修改bug

chenrui 2 年之前
父节点
当前提交
bd650cfac7
共有 1 个文件被更改,包括 17 次插入27 次删除
  1. 17 27
      src/views/productManagement/productInfoJg/list.vue

+ 17 - 27
src/views/productManagement/productInfoJg/list.vue

@@ -110,13 +110,13 @@
       ref="table"
       :style="{ height: tableHeight+84.5+'px' }"
       size="small"
-      :row-selection="$hasPermissions('B_JgProduct_enable')?rowSelection:null"
+      :row-selection="$hasPermissions('B_JgProduct_enable')?{columnWidth: '3%', getCheckboxProps: record => ({props: {disabled: record.enabledFlag == undefined}})}:null"
       @rowSelection="rowSelectionFun"
       rowKeyName="productSn"
       :rowKey="(record) => record.productSn"
       :columns="columns"
       :data="loadData"
-      :scroll="{ y: tableHeight}"
+      :scroll="{ y: tableHeight }"
       :defaultLoadData="false"
       bordered>
       <!-- 产品图片 -->
@@ -227,52 +227,42 @@ export default {
     }
   },
   computed: {
-    rowSelection () {
-      return {
-        columnWidth: 40,
-        getCheckboxProps: record => ({
-          props: {
-            disabled: record.enabledFlag == undefined // Column configuration not to be checked
-          }
-        })
-      }
-    },
     columns () {
       const _this = this
       let arr = [
-        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
-        { title: '产品编码', dataIndex: 'code', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'name', align: 'center', width: 260, customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'origCode', width: 160, align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: '12%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
       ]
       const cArr = [
-        { title: '终端价', dataIndex: 'terminalPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '自定义终端价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '自定义车主价', dataIndex: 'price2', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 100, align: 'center' },
-        { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: 120, align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 160, align: 'center' }
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
+        { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
       if (_this.currentDealerInfo.dealerLevel && _this.currentDealerInfo.dealerLevel == 'PROVINCE') { //  省级
         arr.push(
-          { title: '省级价', dataIndex: 'provincePrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-          { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+          { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
         )
       } else if (_this.currentDealerInfo.dealerLevel && _this.currentDealerInfo.dealerLevel == 'CITY') { //  市级
         arr.push(
-          { title: '市级价', dataIndex: 'cityPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+          { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
         )
       }
       if (_this.currentDealerInfo.isShowSpecialPrice && _this.currentDealerInfo.isShowSpecialPrice == '1') { //  是否展示特约价
-        arr.push({ title: '特约价', dataIndex: 'specialPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (_this.isTerminalPrice) {
-        cArr.splice(1, 0, { title: '自定义终端价', dataIndex: 'dealerProductPrice.terminalPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        cArr.splice(1, 0, { title: '自定义终端价', dataIndex: 'dealerProductPrice.terminalPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (_this.isCarOwnersPrice) {
         const pos = _this.isTerminalPrice ? 3 : 2
-        cArr.splice(pos, 0, { title: '自定义车主价', dataIndex: 'dealerProductPrice.carOwnersPrice', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        cArr.splice(pos, 0, { title: '自定义车主价', dataIndex: 'dealerProductPrice.carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       arr = [...arr, ...cArr]
       return arr