2024-09-09 修改了大部分下拉组件为模糊筛选,减轻前端渲染压力
This commit is contained in:
233
src/views/WarehouseManagement/MaterialRecord/index.vue
Normal file
233
src/views/WarehouseManagement/MaterialRecord/index.vue
Normal file
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="height: 850px">
|
||||
<div style="margin-top: 7px">
|
||||
<el-input v-model="production" style="width: 200px ; margin-left: 10px" size="small" clearable placeholder="物料名称/编号/规格/型号" @keyup.enter.native="pageCurrent=1;pageSize=20;searchTable();searchNumber()"/>
|
||||
<span style="font-size: 17px;color: black ; margin-left: 24px">时间</span>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
@change="pageCurrent=1;pageSize=20;searchTable();searchNumber()"/>
|
||||
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 40px" @click="exportExcel()">导出</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
:summary-method="getSummaries"
|
||||
highlight-current-row
|
||||
show-summary
|
||||
border
|
||||
stripe
|
||||
size="small"
|
||||
style="width: 1061px"
|
||||
height="740px">
|
||||
<el-table-column width="70px" label="序号" type="index" align="center"/>
|
||||
<el-table-column width="130px" label="物料编号" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料编码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('物料名称')" label="物料名称" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="140px" label="图号/型号" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.代号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="47px" label="单位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单位 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="110px" label="出库数" align="center" prop="出库数">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.出库数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="110px" label="入库数" align="center" prop="入库数">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.入库数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="110px" label="库存数" align="center" prop="库存数">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.库存数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库位" align="center" prop="库位">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.货位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期')" label="记录日期" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.记录时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChanges"
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dateRange: '', // 提交日期
|
||||
production: '',
|
||||
loading: false, // 数据加载
|
||||
stockInQuantity: 0, // 入库数
|
||||
outboundQuantity: 0, // 出库数
|
||||
inventoryNumber: 0, // 库存数
|
||||
total: 0, // 分页总数
|
||||
tableData: [], // 合同信息表
|
||||
pageCurrent: 1, // 分页当前页
|
||||
pageSize: 20, // 分页每页显示条数
|
||||
orderName: '', // 排序列名
|
||||
order: '' // 排序方式
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token'
|
||||
])
|
||||
},
|
||||
updated() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['table'].doLayout()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 导出表 8.10
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let dateRange_check, production_check
|
||||
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
|
||||
this.production ? production_check = 1 : production_check = 0
|
||||
var param = []
|
||||
param[0] = ['物料名称_check', production_check]
|
||||
param[1] = ['物料名称', this.production]
|
||||
param[2] = ['时间_check', dateRange_check]
|
||||
param[3] = ['开始时间', this.dateRange[0]]
|
||||
param[4] = ['结束时间', this.dateRange[1]]
|
||||
var Data = this.CreateData('2001', '报表_仓储管理_物料记录_查询', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
searchTable() {
|
||||
if (this.dateRange) {
|
||||
let dateRange_check, production_check
|
||||
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
|
||||
this.production ? production_check = 1 : production_check = 0
|
||||
// var param = []
|
||||
// param[0] = ['物料名称_check', production_check]
|
||||
// param[1] = ['物料名称', this.production]
|
||||
// param[2] = ['时间_check', dateRange_check]
|
||||
// param[3] = ['开始时间', this.dateRange[0]]
|
||||
// param[4] = ['结束时间', this.dateRange[1]]
|
||||
// param[5] = ['PageCurrent', this.pageCurrent]
|
||||
// param[6] = ['PageSize', this.pageSize]
|
||||
// param[7] = ['PageCount', '1111', 'int', '1']
|
||||
// param[8] = ['ItemCount', '1111', 'int', '1']
|
||||
// var Data = this.CreateData('11', '仓储管理_物料记录_查询_统计', param)
|
||||
// this.ExecDatabase(Data).then(response => {
|
||||
// console.log(response, 6666)
|
||||
// this.tableData = response.data.result
|
||||
// this.total = parseInt(response.data.output[0].ItemCount)
|
||||
// })
|
||||
var param = []
|
||||
param[0] = ['物料名称_check', production_check]
|
||||
param[1] = ['物料名称', this.production]
|
||||
param[2] = ['时间_check', dateRange_check]
|
||||
param[3] = ['开始时间', this.dateRange[0]]
|
||||
param[4] = ['结束时间', this.dateRange[1]]
|
||||
var Data = this.CreateData('11', '仓储管理_物料记录_查询新', param, this.pageSize, this.pageCurrent)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 6666)
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('时间不能为空')
|
||||
}
|
||||
},
|
||||
searchNumber() {
|
||||
let dateRange_check, production_check
|
||||
this.dateRange ? dateRange_check = 1 : (dateRange_check = 0, this.dateRange = '')
|
||||
this.production ? production_check = 1 : production_check = 0
|
||||
var param = []
|
||||
param[0] = ['物料名称_check', production_check]
|
||||
param[1] = ['物料名称', this.production]
|
||||
param[2] = ['时间_check', dateRange_check]
|
||||
param[3] = ['开始时间', this.dateRange[0]]
|
||||
param[4] = ['结束时间', this.dateRange[1]]
|
||||
var Data = this.CreateData('11', '仓储管理_物料记录_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.stockInQuantity = response.data[0].入库数
|
||||
this.outboundQuantity = response.data[0].出库数
|
||||
this.inventoryNumber = response.data[0].库存数
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
} else if (index === 5) {
|
||||
sums[index] = this.outboundQuantity.toFixed(2)
|
||||
} else if (index === 6) {
|
||||
sums[index] = this.stockInQuantity.toFixed(2)
|
||||
} else if (index === 7) {
|
||||
sums[index] = this.inventoryNumber.toFixed(2)
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
handleSizeChanges(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.ziduan {
|
||||
width: 50px!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user