Commit 3cc2769a authored by 罗林杰's avatar 罗林杰

修改分页

parent 3028bd87
......@@ -6,7 +6,7 @@
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="rows"
:total="total"
:total="Number(total)"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
......@@ -21,8 +21,7 @@ export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
required: true
},
page: {
type: Number,
......@@ -33,10 +32,7 @@ export default {
default: 20
},
rows: {
type: Array,
default() {
return [10, 20, 50, 100]
}
type: Array
},
layout: {
type: String,
......
......@@ -18,7 +18,7 @@
<el-row style="margin-top: 20px;">
<el-col :span="24">
<div class="statistics">
<p>待盘: {{ this.pendingCount }}</p>
<p>合计: {{ this.count }}</p>
</div>
</el-col>
<el-col :span="24">
......@@ -41,26 +41,26 @@
title="盘点详情"
:close-on-click-modal="true"
:visible.sync="infoOpen"
width="1700px"
width="300px"
append-to-body
@close="infoWinCancel"
>
<el-table :row-style="rowStyle" border :data="detailList" max-height="450">
<el-table-column type="index" label="序号" fixed="left" width="75" align="center" />
<el-table-column label="管理编号" width="140" prop="insCode" :show-overflow-tooltip="true">
<el-table-column type="index" label="序号" fixed="left" width="50" align="center" />
<el-table-column label="管理编号" width="120" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insCode || '-' }}
</template>
</el-table-column>
<el-table-column label="仪器名称" prop="insName" width="140" :show-overflow-tooltip="true">
<el-table-column label="仪器名称" prop="insName" width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insName || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
v-show="total>0"
:total="total"
:page.sync="detailQueryParams.page"
:limit.sync="detailQueryParams.rows"
layout="total, prev, pager, next"
......@@ -99,7 +99,7 @@ export default {
// 管理字典
insManageList: {},
completedCount:0,
pendingCount:0,
count:0,
// 类型字典
insTypeList: {},
// 日期范围
......@@ -112,7 +112,6 @@ export default {
pdCode: undefined,
userName: undefined
},
detailTotal: 0,
detailQueryParams: {
page: 1,
rows: 10,
......@@ -156,7 +155,7 @@ export default {
this.detailQueryParams.pdId = id
getInventoryPdDetail(this.detailQueryParams).then(response => {
this.detailList = response.rows
this.detailTotal = response.total
this.total = response.total
this.detailQueryParams.page = response.pageNu
this.detailQueryParams.rows = response.pageSize
this.countStatus()
......@@ -172,8 +171,8 @@ export default {
})
},
countStatus() {
this.completedCount = this.detailList.filter(item => item.pdStatus === '0').length;
this.pendingCount = this.detailList.filter(item => item.pdStatus === '1').length;
this.completedCount = this.detailList.filter(item => item.pdStatus === '1').length;
this.count = this.total;
},
// 根据状态控制当前行的颜色
changeColor({ row, rowIndex }) {
......
......@@ -4,17 +4,17 @@
<div style="padding:5px 10px">
<el-table v-loading="loading" border :data="insStrumentInfoList">
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="编号" width="150" prop="insCode" :show-overflow-tooltip="true">
<el-table-column label="编号" width="130" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pdCode || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" width="200" prop="insJdrq" :show-overflow-tooltip="true">
<el-table-column label="创建时间" width="150" prop="insJdrq" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm:ss' ) }}</span>
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm' ) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" class-name="small-padding fixed-width" width="60px">
<el-table-column label="操作" class-name="small-padding fixed-width" width="50px">
<template slot-scope="scope">
<div class="download-btn-box">
<el-button
......@@ -34,69 +34,9 @@
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
layout="total, prev, pager, next"
@pagination="getList"
/>
<!-- 设备详情对话框-->
<el-dialog
title="盘点详情"
:close-on-click-modal="true"
:visible.sync="infoOpen"
width="1700px"
append-to-body
@close="infoWinCancel"
>
<el-table v-loading="loading" :row-style="rowStyle" border :data="detailList" max-height="450">
<el-table-column type="index" label="序号" fixed="left" width="75" align="center" />
<el-table-column label="管理编号" width="140" prop="insCode" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insCode || '-' }}
</template>
</el-table-column>
<el-table-column label="仪器名称" prop="insName" width="140" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.insName || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:page.sync="detailQueryParams.page"
:limit.sync="detailQueryParams.rows"
layout="total, prev, pager, next"
@pagination="getInventoryPdDetail(id)"
/>
</el-dialog>
<el-dialog :visible.sync="inventoryOpen" :close-on-click-modal="true" width="1700px" append-to-body @close="infoWinCancel">
<el-row>
<el-col :span="6">
<el-button class="submitBtn" type="primary">
<span>开始盘点</span>
</el-button>
</el-col>
<el-col :span="18">
<el-button class="submitBtn" type="primary">
<span>结束盘点</span>
</el-button>
</el-col>
</el-row>
<!-- 新增统计数据展示 -->
<el-row style="margin-top: 20px;">
<el-col :span="12">
<div class="statistics">
<p><strong>待盘:</strong> {{ pendingCount }}</p>
</div>
</el-col>
<el-col :span="12">
<div class="statistics">
<p><strong>已盘:</strong> {{ completedCount }}</p>
</div>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button class="submitBtn" type="primary" @click="handleInfo">查看盘点</el-button>
</div>
</el-dialog>
</div>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment