123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <template>
- <div class="app-container">
- <div>
- <!-- 筛选条件 -->
- <Collapse :screen-form="searchForm">
- <template #right_btn>
- <el-button size="mini" @click="clearFn">清空</el-button>
- <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
- </template>
- <template #search>
- <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="仓库名称" prop="correspondName">
- <el-input v-model="searchForm.correspondName" placeholder="请输入经销商名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="物料名称" prop="materialName">
- <el-input v-model="searchForm.materialName" placeholder="请输入经销商名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="物料编码" prop="materialNumber">
- <el-input v-model="searchForm.materialNumber" placeholder="请输入经销商名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="规格型号" prop="specification">
- <el-input v-model="searchForm.specification" placeholder="请输入经销商名称"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </template>
- </Collapse>
- <!-- 按钮 -->
- <div class="btn-group clearfix">
- <div class="fl"></div>
- <div class="fr">
- <div style="display: flex;">
- <ExportButton :exUrl="'stock/startAcc/stockExport'" :exParams="exParams" exText="导出一" />
- <div style="width:10px"></div>
- <ExportButton :exUrl="'stock/startAcc/stockExport2'" :exParams="exParams" exText="导出二" />
- <div style="width:10px"></div>
- <ExportButton :exUrl="'stock/startAcc/stockExport3'" :exParams="exParams" exText="导出三" />
- </div>
- </div>
- </div>
- <div class="mymain-container">
- <!-- 列表 -->
- <div class="table">
- <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit
- highlight-current-row stripe show-summary :summary-method="getSummaries">
- <el-table-column align="left" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="存货类别" prop="categoryName" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="物料名称" prop="materialName" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="规格型号" prop="spec" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="广州可用数量" prop="gzOnNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="佛山可用数量" prop="fsOnNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="总可用数量" prop="allOnNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="广州开单未提数量" prop="gzNeverNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="佛山开单未提数量" prop="fsNeverNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="总开单未提数量" prop="allNeverNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="广州结存数量" prop="gzNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="佛山结存数量" prop="fsNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- <el-table-column align="left" label="总结存数量" prop="allNumber" min-width="160" show-overflow-tooltip>
- </el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
- </el-pagination>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { stockStartAccStock } from '@/api/guangFoInventory'
- export default {
- components: {},
- data() {
- return {
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表
- listLoading: false, // 列表加载loading
- searchForm: {
- correspondName: '',
- materialName: '',
- materialNumber: '',
- specification: ''
- },
- dataList: [],
- statusList: [],
- currentStatus: ''
- }
- },
- computed: {
- exParams() {
- return {
- ...this.searchForm
- }
- }
- },
- async created() {
- await this.getList({ pageNumber: 1, pageSize: 10 })
- },
- methods: {
- // 更改每页数量
- handleSizeChange(val) {
- this.pageSize = val
- this.currentPage = 1
- this.getList({
- ...this.searchForm,
- pageNumber: this.currentPage,
- pageSize: this.pageSize
- })
- },
- // 更改当前页
- handleCurrentChange(val) {
- this.currentPage = val
- this.getList({
- ...this.searchForm,
- pageNumber: this.currentPage,
- pageSize: this.pageSize
- })
- },
- //搜索功能
- async searchFn() {
- this.currentPage = 1
- await this.getList({
- ...this.searchForm,
- pageNumber: this.currentPage,
- pageSize: this.pageSize
- })
- },
- //重置
- clearFn() {
- this.$refs.searchForm.resetFields()
- },
- //获取列表数据
- async getList(data) {
- const res = await stockStartAccStock(data)
- this.dataList = res.data.records
- this.listTotal = res.data.total
- },
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index < 6) {
- return;
- }
- const values = data.map(item => Number(item[column.property]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- }
- });
- return sums;
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .selectStyle {
- width: 100%;
- }
- ::v-deep .el-textarea__inner {
- resize: none;
- }
- ::v-deep .el-form {
- .inputStyle {
- width: 80%;
- }
- }
- ::v-deep .dialog-footer {
- display: flex;
- justify-content: center;
- }
- ::v-deep .el-dialog__header {
- background-color: #dddddd;
- }
- .inp {
- margin: 0 12px;
- }
- .right {
- margin-top: 12px;
- float: right;
- }
- .table {
- margin-top: 12px;
- }
- .search {
- display: flex;
- margin-top: 12px;
- ::v-deep .el-input {
- width: 50%;
- margin-right: 12px;
- }
- }
- .import-btn {
- display: inline-block;
- margin-left: 10px;
- }
- </style>
|