1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
| <template>
| <!-- 仓库信息 -->
| <div id="cassline" class="global-content">
| <!-- 筛选 -->
| <storage-inquer
| byfilter="班线编号"
| :groupshow="true"
| :dele="false"
| :filterList="filterList"
| @addmodal="addmodal"
| @inquer="inquer"
| />
| <!-- table -->
| <div class="table">
| <table-container
| :wipelist="wipelist"
| :tableHead="tableHead"
| :tableData="tableData"
| :editShow="true"
| :delShow="true"
| :currentPage="page"
| :pageSize="pageSize"
| :totle="totle"
| @edit="edit"
| @del="del"
| @SizeChange="SizeChange"
| @CurrentChange="CurrentChange"
| />
| </div>
|
| <transition name="modal">
| <modal v-if="addmodalShow" :modabg="true" @cancel="addmodalShow = false">
| <p slot="title">货位管理-{{ title }}</p>
| <div class="height" slot="centent">
| <cassline-edit @cancel="addmodalShow = false" :rowitem="rowitem" @addsubmit="addsubmit" />
| </div>
| </modal>
| </transition>
| </div>
| </template>
|
| <script>
| import { TableContainer, Modal } from '@/components/index';
| import StorageInquer from '../../components/storage-inquer';
| import CasslineEdit from '../../components/casslineEdit';
| const { cassline } = require('@/components/tableContainer/tableHead');
| import { ProductionLineSearch, ProductionLineDelete } from '@/api/cass-line';
| export default {
| data() {
| return {
| title: '',
| tableData: [],
| modalShow: false,
| addmodalShow: false,
| wipelist: [],
| rowitem: {},
| totle: 0,
| page: 1,
| pageSize: 20,
| pageNum: 0,
| inuqerobg: {},
| filterList: [
| {
| value: '班线编号',
| label: '班线编号'
| },
| {
| value: '班线名称',
| label: '班线名称'
| }
| ]
| };
| },
| components: { TableContainer, StorageInquer, Modal, CasslineEdit },
| computed: {
| tableHead() {
| return cassline;
| }
| },
| mounted() {
| this.ProductionLineSearch();
| },
| methods: {
| //查询
| inquer(e) {
| this.inuqerobg = e;
| this.page = 1;
| this.ProductionLineSearch();
| },
| //搜索用户
| ProductionLineSearch() {
| this.$Loading(true);
| const { 班线编号: productionCode, 班线名称: productionName } = this.inuqerobg;
| ProductionLineSearch(this.page + '&onePageNum=' + this.pageSize, { productionCode, productionName }).then(res => {
| if (res.code == 0) {
| this.tableData = res.data;
| this.totle = res.num;
| this.pageNum = res.pageNum;
| }
| this.$Loading();
| });
| },
| CurrentChange(e) {
| console.log(e);
| this.page = e;
| this.ProductionLineSearch();
| },
| //页数
| SizeChange(e) {
| this.pageSize = e;
| this.PlaceVsContainer();
| },
| //编辑
| edit(row) {
| this.addmodalShow = true;
| this.rowitem = { ...row };
| this.title = '编辑';
| },
| //删除
| del(row) {
| console.log(row);
| const { productionCode } = { ...row };
| this.$confirm('此操作将永久删除该班线, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| })
| .then(() => {
| ProductionLineDelete({ productionCode }).then(res => {
| this.$message({
| type: 'success',
| message: '删除成功!'
| });
| this.ProductionLineSearch();
| });
| })
| .catch(() => {
| this.$message({
| type: 'info',
| message: '已取消删除'
| });
| });
| },
| //新建
| addmodal() {
| this.rowitem = {};
| this.addmodalShow = true;
| this.title = '新建';
| },
| //新增修改后
| addsubmit() {
| this.addmodalShow = false;
| this.modalShow = false;
| this.ProductionLineSearch();
| }
| }
| };
| </script>
|
| <style lang="scss" scoped>
| #cassline {
| .table {
| width: 100%;
| margin-top: 10px;
| height: calc(100% - 40px);
| overflow: hidden;
| }
| }
| </style>
|
|