| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489 |
- <template>
- <div id="inventoryBalance">
- <el-card shadow="never">
- <!-- 数据表格 -->
- <div>
- <search-table @search="reload"></search-table>
- </div>
- <ele-pro-table
- ref="table"
- class="table"
- :columns="columns"
- :pageSize="20"
- :datasource="datasource"
- height="calc(100vh - 405px)"
- full-height="calc(100vh - 116px)"
- tool-class="ele-toolbar-form"
- :needPage="false"
- >
- <!-- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-view"
- @click="add(true, row)"
- >
- 详情
- </el-link>
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-download"
- @click="downLoad(row)"
- >
- 下载
- </el-link>
- </template> -->
- </ele-pro-table>
- </el-card>
- </div>
- </template>
- <script>
- import searchTable from './components/searchTable.vue';
- import { sendReceiveGatherExcel } from '@/api/warehouseManagement/statisticalReports';
- export default {
- components: { searchTable },
- computed: {
- columns() {
- let year, month, days;
- if (this.date) {
- year = this.date.split('-')[0];
- month = this.date.split('-')[1].replace(/^0+/, '');
- days = new Date(year, month, 0).getDate();
- } else {
- year = new Date().getFullYear();
- month = new Date().getMonth() + 1;
- days = new Date(year, month, 0).getDate();
- }
- let dateColumns = Array.from({ length: days }, (_, i) => ({
- prop: `dateList[${i}][dateTotalNum]`,
- label: `${month}/${i + 1}`,
- align: 'center',
- showOverflowTooltip: true
- }));
- let arr = [
- {
- type: 'index',
- label: '序号',
- width: 50,
- align: 'center'
- },
- {
- prop: 'clientName',
- label: '客户',
- align: 'center',
- width: 200,
- showOverflowTooltip: true
- },
- {
- prop: 'categoryCode',
- label: '件号',
- align: 'center',
- width: 180,
- showOverflowTooltip: true
- },
- {
- prop: 'categoryName',
- label: '件名',
- align: 'center',
- width: 180,
- showOverflowTooltip: true
- },
- {
- prop: 'startNum',
- label: '期初\n素材',
- slot: 'startTime',
- align: 'center',
- width: 80,
- showOverflowTooltip: true
- },
- {
- prop: 'endNum',
- label: '结存\n合计',
- align: 'center',
- width: 0,
- showOverflowTooltip: true
- },
- {
- prop: 'totalNum',
- label: '小计',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'category',
- label: '类别',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'dateList',
- label: '日期/数量',
- align: 'center',
- showOverflowTooltip: true,
- // children: [
- // {
- // prop: 'dateList[0][dateTotalNum]',
- // label: month + '/1',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[1][dateTotalNum]',
- // label: month + '/2',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[2][dateTotalNum]',
- // label: month + '/3',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[3][dateTotalNum]',
- // label: month + '/4',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[4][dateTotalNum]',
- // label: month + '/5',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[5][dateTotalNum]',
- // label: month + '/6',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[6][dateTotalNum]',
- // label: month + '/7',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[7][dateTotalNum]',
- // label: month + '/8',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[8][dateTotalNum]',
- // label: month + '/9',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[9][dateTotalNum]',
- // label: month + '/10',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[10][dateTotalNum]',
- // label: month + '/11',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[11][dateTotalNum]',
- // label: month + '/12',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[12][dateTotalNum]',
- // label: month + '/13',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[13][dateTotalNum]',
- // label: month + '/14',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[14][dateTotalNum]',
- // label: month + '/15',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[15][dateTotalNum]',
- // label: month + '/16',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[16][dateTotalNum]',
- // label: month + '/17',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[17][dateTotalNum]',
- // label: month + '/18',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[18][dateTotalNum]',
- // label: month + '/19',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[19][dateTotalNum]',
- // label: month + '/20',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[20][dateTotalNum]',
- // label: month + '/21',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[21][dateTotalNum]',
- // label: month + '/22',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[22][dateTotalNum]',
- // label: month + '/23',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[23][dateTotalNum]',
- // label: month + '/24',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[24][dateTotalNum]',
- // label: month + '/25',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[25][dateTotalNum]',
- // label: month + '/26',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[26][dateTotalNum]',
- // label: month + '/27',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[27][dateTotalNum]',
- // label: month + '/28',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[28][dateTotalNum]',
- // label: month + '/29',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[29][dateTotalNum]',
- // label: month + '/30',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'dateList[30][dateTotalNum]',
- // label: month + '/31',
- // align: 'center',
- // showOverflowTooltip: true
- // }
- // ]
- children: dateColumns
- }
- ];
- return arr;
- }
- },
- data() {
- return {
- date: ''
- // columns: [
- // {
- // type: 'index',
- // label: '序号',
- // width: 50,
- // align: 'center'
- // },
- // {
- // prop: 'code',
- // label: '客户',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'name',
- // label: '件号',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'createUserName',
- // label: '件名',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'startTime',
- // label: '期初素材',
- // slot: 'startTime',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'endTime',
- // label: '结存合计',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'endTime',
- // label: '小计',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'endTime',
- // label: '类别',
- // align: 'center',
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'endTime',
- // label: '日期/数量',
- // align: 'center',
- // showOverflowTooltip: true,
- // children: [
- // {
- // prop: 'province',
- // label: '1',
- // align: 'center',
- // showOverflowTooltip: true
- // }
- // ]
- // }
- // ]
- };
- },
- methods: {
- // downLoad(row) {
- // sendReceiveGatherExcel({
- // code: row.code,
- // name: row.name,
- // startTime: row.startTime,
- // endTime: row.endTime,
- // exportStatus: 1
- // }).then((data) => {
- // try {
- // let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
- // let elink = document.createElement('a');
- // elink.setAttribute(
- // 'download',
- // decodeURI(decodeURI('收发汇总表.xlsx'))
- // );
- // elink.style.display = 'none';
- // elink.href = objectUrl1;
- // document.body.appendChild(elink);
- // elink.click();
- // document.body.removeChild(elink);
- // window.URL.revokeObjectURL(elink.href);
- // this.search();
- // } catch (err) {
- // this.$message.error('导出失败,请联系管理员!');
- // }
- // });
- // },
- // add(isView, row) {
- // console.log('isView--', isView);
- // console.log('row-----', row);
- // this.$refs.addRef.open(isView, row);
- // },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return sendReceiveGatherExcel({
- ...where
- // ...order,
- // type: 2,
- // keyWord: this.keyWord,
- // pageNum: page,
- // size: limit
- });
- },
- reload(where) {
- this.date = where.startDate ?? '';
- console.log(where);
- this.$refs.table.reload({ page: 1, where: where });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- #inventoryBalance {
- height: calc(100vh - 96px);
- width: 100%;
- padding: 10px;
- box-sizing: border-box;
- // element-ui样式穿透
- :deep(.el-card) {
- height: 100%;
- .el-card__body {
- height: 100%;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- .ele-pro-table {
- flex: 1;
- display: flex;
- flex-direction: column;
- .el-table {
- flex: 1;
- // display: flex;
- // flex-direction: column;
- // .el-table__body-wrapper {
- // flex: 1;
- // }
- }
- }
- }
- .el-form-item {
- margin-bottom: 5px !important;
- }
- }
- .ele-form-actions {
- display: flex;
- justify-content: flex-end;
- }
- }
- :deep(.ele-pro-table-header-ellipsis > .el-table th.el-table__cell > .cell) {
- white-space: pre;
- }
- </style>
|