From e77b9391119df5f59164771073c31c7205311f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sun, 5 Sep 2021 00:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E9=AB=98=E5=BA=A6=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/src/mixins/JeecgListMixin.js | 30 +++++++---- .../src/views/material/MaterialList.vue | 53 +++++++++---------- 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/jshERP-web/src/mixins/JeecgListMixin.js b/jshERP-web/src/mixins/JeecgListMixin.js index 58b13d7b..13f84bb0 100644 --- a/jshERP-web/src/mixins/JeecgListMixin.js +++ b/jshERP-web/src/mixins/JeecgListMixin.js @@ -7,8 +7,10 @@ import { filterObj } from '@/utils/util'; import { deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl } from '@/api/manage' import Vue from 'vue' import { ACCESS_TOKEN } from "@/store/mutation-types" +import {mixinDevice} from '@/utils/mixin.js' export const JeecgListMixin = { + mixins: [mixinDevice], data(){ return { //token header @@ -30,9 +32,7 @@ export const JeecgListMixin = { total: 0 }, /* 控制table高度 */ - scroll: { - y: document.documentElement.clientHeight-330 - }, + scroll: {}, /* 排序参数 */ isorter:{ column: 'createTime', @@ -61,16 +61,24 @@ export const JeecgListMixin = { } }, created() { - if(!this.disableMixinCreated){ - //console.log(' -- mixin created -- ') - this.loadData(); - //初始化字典配置 在自己页面定义 - this.initDictConfig(); - //初始化按钮权限 - this.initActiveBtnStr(); - } + this.initScroll() + if(!this.disableMixinCreated){ + //console.log(' -- mixin created -- ') + this.loadData(); + //初始化字典配置 在自己页面定义 + this.initDictConfig(); + //初始化按钮权限 + this.initActiveBtnStr(); + } }, methods:{ + initScroll() { + if (this.isMobile()) { + this.scroll.y = '' + } else { + this.scroll.y = document.documentElement.clientHeight-330 + } + }, loadData(arg) { if(!this.url.list){ this.$message.error("请设置url.list属性!") diff --git a/jshERP-web/src/views/material/MaterialList.vue b/jshERP-web/src/views/material/MaterialList.vue index 8d0f0084..a8d9af20 100644 --- a/jshERP-web/src/views/material/MaterialList.vue +++ b/jshERP-web/src/views/material/MaterialList.vue @@ -80,10 +80,10 @@ size="middle" bordered rowKey="id" - :scroll="{ x: 1500, y: 500 }" :columns="columns" :dataSource="dataSource" :pagination="ipagination" + :scroll="scroll" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> @@ -153,43 +153,33 @@ }, // 表头 columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:40, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; - } - }, - {title: '条码', dataIndex: 'mBarCode', width: 120}, - {title: '名称', dataIndex: 'name', width: 120}, - {title: '规格', dataIndex: 'standard', width: 80}, - {title: '型号', dataIndex: 'model', width: 80}, - {title: '颜色', dataIndex: 'color', width: 60}, - {title: '类别', dataIndex: 'categoryName', width: 80}, - {title: '扩展信息', dataIndex: 'materialOther', width: 100}, - {title: '单位', dataIndex: 'unit', width: 100, + {title: '条码', dataIndex: 'mBarCode', width: '8%'}, + {title: '名称', dataIndex: 'name', width: '8%'}, + {title: '规格', dataIndex: 'standard', width: '5%'}, + {title: '型号', dataIndex: 'model', width: '5%'}, + {title: '颜色', dataIndex: 'color', width: '5%'}, + {title: '类别', dataIndex: 'categoryName', width: '5%'}, + {title: '扩展信息', dataIndex: 'materialOther', width: '6%'}, + {title: '单位', dataIndex: 'unit', width: '6%', scopedSlots: { customRender: 'customRenderUnit' } }, - {title: '安全存量', dataIndex: 'safetyStock', width: 80}, - {title: '库存', dataIndex: 'stock', width: 70}, - {title: '采购价', dataIndex: 'purchaseDecimal', width: 70}, - {title: '零售价', dataIndex: 'commodityDecimal', width: 70}, - {title: '销售价', dataIndex: 'wholesaleDecimal', width: 70}, - {title: '最低售价', dataIndex: 'lowDecimal', width: 80}, - {title: '状态', dataIndex: 'enabled', width: 55, align: "center", + {title: '安全存量', dataIndex: 'safetyStock', width: '5%'}, + {title: '库存', dataIndex: 'stock', width: '5%'}, + {title: '采购价', dataIndex: 'purchaseDecimal', width: '5%'}, + {title: '零售价', dataIndex: 'commodityDecimal', width: '5%'}, + {title: '销售价', dataIndex: 'wholesaleDecimal', width: '5%'}, + {title: '最低售价', dataIndex: 'lowDecimal', width: '5%'}, + {title: '状态', dataIndex: 'enabled', width: '4%', align: "center", scopedSlots: { customRender: 'customRenderEnabled' } }, - {title: '序列号', dataIndex: 'enableSerialNumber', width: 55, align: "center", + {title: '序列号', dataIndex: 'enableSerialNumber', width: '4%', align: "center", scopedSlots: { customRender: 'customRenderEnableSerialNumber' } }, { title: '操作', dataIndex: 'action', align:"center", - width: 120, + width: '10%', scopedSlots: { customRender: 'action' }, } ], @@ -213,6 +203,13 @@ } }, methods: { + initScroll() { + if (this.isMobile()) { + this.scroll.y = '' + } else { + this.scroll.y = document.documentElement.clientHeight-370 + } + }, loadTreeData(){ let that = this; let params = {};