Browse Source

修改表格高度自适应

lilei 4 years ago
parent
commit
b8f147dad6

+ 5 - 1
src/views/bulkManagement/bulkReturnGoods/list.vue

@@ -66,7 +66,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1310 }"
+      :scroll="{ x: 1310, y: tableHeight }"
       bordered>
       bordered>
       <!-- 是否转销售单 -->
       <!-- 是否转销售单 -->
       <template slot="invenstoryNum" slot-scope="text, record">
       <template slot="invenstoryNum" slot-scope="text, record">
@@ -98,6 +98,7 @@ export default {
   data () {
   data () {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         sparePartsReturnNo: '', //  散件退货单号
         sparePartsReturnNo: '', //  散件退货单号
         supplierSn: undefined, //  供应商
         supplierSn: undefined, //  供应商
@@ -122,6 +123,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 275
+        }
         // 创建时间
         // 创建时间
         if (this.time && this.time.length > 0) {
         if (this.time && this.time.length > 0) {
           this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
           this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)

+ 5 - 1
src/views/bulkManagement/bulkWarehousingOrder/list.vue

@@ -96,7 +96,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1410, y: 300 }"
+      :scroll="{ x: 1410, y: tableHeight }"
       bordered>
       bordered>
       <!-- 散件单号 -->
       <!-- 散件单号 -->
       <template slot="sparePartsPurchaseNo" slot-scope="text, record">
       <template slot="sparePartsPurchaseNo" slot-scope="text, record">
@@ -149,6 +149,7 @@ export default {
       supplierList: [], //  供应商列表数据
       supplierList: [], //  供应商列表数据
       createDate: [], //  创建时间
       createDate: [], //  创建时间
       dateFormat: 'YYYY-MM-DD',
       dateFormat: 'YYYY-MM-DD',
+      tableHeight: 0,
       // 查询参数
       // 查询参数
       queryParam: {
       queryParam: {
         sparePartsPurchaseNo: '', //  散件单号
         sparePartsPurchaseNo: '', //  散件单号
@@ -172,6 +173,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 275
+        }
         // 创建时间
         // 创建时间
         if (this.createDate && this.createDate.length > 0) {
         if (this.createDate && this.createDate.length > 0) {
           this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
           this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)

+ 5 - 1
src/views/customerManagement/customerInfo/list.vue

@@ -106,7 +106,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1190, y: 300 }"
+      :scroll="{ x: 1190, y: tableHeight }"
       bordered>
       bordered>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -150,6 +150,7 @@ export default {
   data () {
   data () {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         customerName: undefined, //  客户名称
         customerName: undefined, //  客户名称
         contactName: '', //  联系人
         contactName: '', //  联系人
@@ -176,6 +177,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 284
+        }
         // 创建时间
         // 创建时间
         if (this.creatTime && this.creatTime.length > 0) {
         if (this.creatTime && this.creatTime.length > 0) {
           this.queryParam.beginDate = moment(this.creatTime[0]).format(this.dateFormat)
           this.queryParam.beginDate = moment(this.creatTime[0]).format(this.dateFormat)

+ 5 - 1
src/views/financialManagement/expenseManagement/list.vue

@@ -80,7 +80,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1120, y: 300 }"
+      :scroll="{ x: 1120, y: tableHeight }"
       bordered>
       bordered>
       <!-- 状态 -->
       <!-- 状态 -->
       <template slot="state" slot-scope="text, record">
       <template slot="state" slot-scope="text, record">
@@ -126,6 +126,7 @@ export default {
   components: { STable, VSelect, expenseManagementDetailModal },
   components: { STable, VSelect, expenseManagementDetailModal },
   data () {
   data () {
     return {
     return {
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       advanced: false, //  高级搜索 展开/关闭
       advanced: false, //  高级搜索 展开/关闭
       costTypeList: [], // 费用类型
       costTypeList: [], // 费用类型
@@ -161,6 +162,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 300
+        }
         if (this.createDate.length > 0) {
         if (this.createDate.length > 0) {
           this.queryParam.beginDate = moment(this.createDate[0]).format('YYYY-MM-DD')
           this.queryParam.beginDate = moment(this.createDate[0]).format('YYYY-MM-DD')
           this.queryParam.endDate = moment(this.createDate[1]).format('YYYY-MM-DD')
           this.queryParam.endDate = moment(this.createDate[1]).format('YYYY-MM-DD')

+ 5 - 1
src/views/financialManagement/financialCollection/list.vue

@@ -81,7 +81,7 @@
       :rowKey="record => record.id"
       :rowKey="record => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1290, y: 300 }"
+      :scroll="{ x: 1290, y: tableHeight }"
       bordered
       bordered
     >
     >
       <!-- 操作 -->
       <!-- 操作 -->
@@ -120,6 +120,7 @@ export default {
       advanced: false, //  高级搜索 展开/关闭
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
       openModal: false, // 详情弹框
+      tableHeight: 0,
       // 查询参数
       // 查询参数
       queryParam: {
       queryParam: {
         bizType: 'ALL',
         bizType: 'ALL',
@@ -219,6 +220,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 300
+        }
         if (this.queryParam.auditDate.length > 0) {
         if (this.queryParam.auditDate.length > 0) {
           this.queryParam.auditBeginDate = moment(this.queryParam.auditDate[0]).format('YYYY-MM-DD HH:mm:ss')
           this.queryParam.auditBeginDate = moment(this.queryParam.auditDate[0]).format('YYYY-MM-DD HH:mm:ss')
           this.queryParam.auditEndDate = moment(this.queryParam.auditDate[1]).format('YYYY-MM-DD HH:mm:ss')
           this.queryParam.auditEndDate = moment(this.queryParam.auditDate[1]).format('YYYY-MM-DD HH:mm:ss')

+ 5 - 1
src/views/financialManagement/financialPayment/list.vue

@@ -80,7 +80,7 @@
       :rowKey="record => record.id"
       :rowKey="record => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1280, y: 300 }"
+      :scroll="{ x: 1280, y: tableHeight }"
       bordered
       bordered
     >
     >
       <!-- 操作 -->
       <!-- 操作 -->
@@ -119,6 +119,7 @@ export default {
       advanced: false, //  高级搜索 展开/关闭
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 详情弹框
       openModal: false, // 详情弹框
+      tableHeight: 0,
       curBizType: '',
       curBizType: '',
       // 查询参数
       // 查询参数
       queryParam: {
       queryParam: {
@@ -219,6 +220,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 300
+        }
         if (this.queryParam.auditDate.length > 0) {
         if (this.queryParam.auditDate.length > 0) {
           this.queryParam.auditBeginDate = moment(this.queryParam.auditDate[0]).format('YYYY-MM-DD HH:mm:ss')
           this.queryParam.auditBeginDate = moment(this.queryParam.auditDate[0]).format('YYYY-MM-DD HH:mm:ss')
           this.queryParam.auditEndDate = moment(this.queryParam.auditDate[1]).format('YYYY-MM-DD HH:mm:ss')
           this.queryParam.auditEndDate = moment(this.queryParam.auditDate[1]).format('YYYY-MM-DD HH:mm:ss')

+ 5 - 1
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -81,7 +81,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1470, y: 300 }"
+      :scroll="{ x: 1470, y: tableHeight }"
       bordered>
       bordered>
       <!-- 产品分类 -->
       <!-- 产品分类 -->
       <template slot="productTypeName" slot-scope="text, record">
       <template slot="productTypeName" slot-scope="text, record">
@@ -111,6 +111,7 @@ export default {
   data () {
   data () {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productName: '', //  产品名称
@@ -140,6 +141,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 340
+        }
         return stockList(Object.assign(parameter, this.queryParam)).then(res => {
         return stockList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize

+ 5 - 1
src/views/inventoryManagement/warehouse/list.vue

@@ -28,7 +28,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ y: 300 }"
+      :scroll="{ y: tableHeight }"
       bordered>
       bordered>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -72,6 +72,7 @@ export default {
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         name: '' //  仓库名称
         name: '' //  仓库名称
       },
       },
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -82,6 +83,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 340
+        }
         return warehouseList(Object.assign(parameter, this.queryParam)).then(res => {
         return warehouseList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize

+ 5 - 1
src/views/productManagement/productBrand/list.vue

@@ -34,7 +34,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ y: 300 }"
+      :scroll="{ y: tableHeight }"
       bordered>
       bordered>
       <!-- 状态 -->
       <!-- 状态 -->
       <template slot="enabledFlag" slot-scope="text, record">
       <template slot="enabledFlag" slot-scope="text, record">
@@ -77,6 +77,7 @@ export default {
         enabledFlag: undefined //  状态
         enabledFlag: undefined //  状态
       },
       },
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
+      tableHeight:0,
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
         { title: '产品品牌名称', dataIndex: 'brandName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '产品品牌名称', dataIndex: 'brandName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
@@ -88,6 +89,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 220
+        }
         return dealerProductBrandList(Object.assign(parameter, this.queryParam)).then(res => {
         return dealerProductBrandList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize

+ 5 - 1
src/views/productManagement/productCategory/list.vue

@@ -14,7 +14,7 @@
       :data="loadData"
       :data="loadData"
       :showPagination="false"
       :showPagination="false"
       :defaultExpandedRowKeys="defaultExpandedRowKeys"
       :defaultExpandedRowKeys="defaultExpandedRowKeys"
-      :scroll="{ y: 300 }"
+      :scroll="{ y: tableHeight }"
       bordered>
       bordered>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -58,6 +58,7 @@ export default {
   components: { STable, productCategoryEditModal },
   components: { STable, productCategoryEditModal },
   data () {
   data () {
     return {
     return {
+      tableHeight: 0,
       formItemLayout: {
       formItemLayout: {
         labelCol: { span: 6 },
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
         wrapperCol: { span: 16 }
@@ -70,6 +71,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 250
+        }
         return dealerProductTypeList().then(res => {
         return dealerProductTypeList().then(res => {
           //  递归去除空children
           //  递归去除空children
           this.recursionFun(res.data)
           this.recursionFun(res.data)

+ 5 - 1
src/views/productManagement/productInfo/list.vue

@@ -84,7 +84,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1500, y: 300 }"
+      :scroll="{ x: 1500, y: tableHeight }"
       bordered>
       bordered>
       <!-- 产品分类 -->
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
       <template slot="productType" slot-scope="text, record">
@@ -137,6 +137,7 @@ export default {
   data () {
   data () {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       productType: [],
       productType: [],
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         code: '', //  产品编码
         code: '', //  产品编码
@@ -166,6 +167,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 340
+        }
         return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
         return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize

+ 5 - 1
src/views/productManagement/productInfoJg/list.vue

@@ -79,7 +79,7 @@
       :rowKey="(record) => record.id"
       :rowKey="(record) => record.id"
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
-      :scroll="{ x: 1340, y: 300 }"
+      :scroll="{ x: 1340, y: tableHeight }"
       bordered>
       bordered>
       <!-- 产品分类 -->
       <!-- 产品分类 -->
       <template slot="productType" slot-scope="text, record">
       <template slot="productType" slot-scope="text, record">
@@ -106,6 +106,7 @@ export default {
   data () {
   data () {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
       productType: [],
       productType: [],
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         code: '', //  产品编码
         code: '', //  产品编码
@@ -135,6 +136,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 210
+        }
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
         return productList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize

+ 3 - 1
src/views/salesManagement/outboundOrder/list.vue

@@ -92,7 +92,7 @@
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
       :showPagination="false"
       :showPagination="false"
-      :scroll="{ x: 1700 }"
+      :scroll="{ x: 1700, y: tableHeight }"
       bordered>
       bordered>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -124,6 +124,7 @@ export default {
   data () {
   data () {
     return {
     return {
       advanced: false, // 高级搜索 展开/关闭
       advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 300, // 表格高度
       queryParam: { //  查询条件
       queryParam: { //  查询条件
         demanderName: undefined, //  客户名称
         demanderName: undefined, //  客户名称
         outBizType: undefined, //  出库类型
         outBizType: undefined, //  出库类型
@@ -152,6 +153,7 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        this.tableHeight = window.innerHeight - 220
         // 审核时间
         // 审核时间
         if (this.time && this.time.length > 0) {
         if (this.time && this.time.length > 0) {
           this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
           this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)

+ 5 - 1
src/views/supplierManagement/supplierInfo/list.vue

@@ -39,7 +39,7 @@
       :columns="columns"
       :columns="columns"
       :data="loadData"
       :data="loadData"
       :customRow="handleClickRow"
       :customRow="handleClickRow"
-      :scroll="{ x: 1310, y: 300 }"
+      :scroll="{ x: 1310, y: tableHeight }"
       bordered>
       bordered>
       <!-- 操作 -->
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
       <template slot="action" slot-scope="text, record">
@@ -73,6 +73,7 @@ export default {
         supplierName: '', //  供应商名称
         supplierName: '', //  供应商名称
         enabledFlag: undefined //  状态
         enabledFlag: undefined //  状态
       },
       },
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -88,6 +89,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 275
+        }
         return supplierList(Object.assign(parameter, this.queryParam)).then(res => {
         return supplierList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize