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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
| <template>
| <!-- 仓库信息 -->
| <div id="enter"
| class="global-content">
| <!-- 筛选 -->
| <inbound-inuqer ref="inref"
| byfilter="零件编号"
| :filterList="filterList"
| :loading="loading"
| :tolead="false"
| :derive="false"
| :imexcel="false"
| :datetimeshow="true"
| @refresh="refresh"
| @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"
| @CurrentChange="CurrentChange"
| @SizeChange="SizeChange"
| @handleSelectionChange="handleSelectionChange" />
| </div>
|
| <transition name="modal">
| <modal v-if="addmodalShow"
| :modabg="true"
| @cancel="addmodalShow = false">
| <p slot="title">组盘-{{ title }}</p>
| <div class="height"
| slot="centent">
| <enter-edit @partclick="partShow = true"
| @cancel="
| addmodalShow = false;
| refresh();
| "
| :rowitem="rowitem"
| :chooselist="chooselist"
| @addsubmit="addsubmit" />
| </div>
| </modal>
| </transition>
| <transition name="modal">
| <modal v-if="partShow"
| :modabg="true"
| @cancel="partShow = false">
| <p slot="title">零件列表</p>
| <div class="height"
| slot="centent">
| <choose ref="enterChoose"
| :choice="false"
| @chooseClick="chooseClick"
| @cancel="partShow = false"
| @addchoose="addchooseShow = true" />
| </div>
| </modal>
| </transition>
| </div>
| </template>
|
| <script>
| import { TableContainer, Modal, Choose, AddChoose } from '@/components/index';
| import inboundInuqer from '../../components/inboundinuqer';
| import enterEdit from '../../components/enterEdit';
| // import enterChoose from '../../components/choose';
| // import AddChoose from '../../components/addchoose';
| const { enter } = require('@/components/tableContainer/tableHead');
| import { ContainerVsItemSearch, ContainerVsItemDelete } from '@/api/enter';
| export default {
| data () {
| return {
| title: '',
| tableData: [],
| modalShow: false,
| addmodalShow: false,
| partShow: false,
| addchooseShow: false,
| loading: false,
| chooselist: [], //零件数据
| wipelist: [],
| handleSeleclist: [], //勾选数据
| rowitem: {},
| totle: 0,
| page: 1,
| pageSize: 20,
| inuqerobg: {},
| filterList: [
| {
| value: '组盘编号',
| label: '组盘编号'
| },
| {
| value: '零件编号',
| label: '零件编号'
| },
| {
| value: '零件名称',
| label: '零件名称'
| },
| {
| value: '器具编号',
| label: '器具编号'
| },
| {
| value: '器具类型',
| label: '器具类型'
| },
| {
| value: '入库计划',
| label: '入库计划'
| },
| {
| value: '出库计划',
| label: '出库计划'
| },
| {
| value: '返修车间',
| label: '返修车间'
| },
| {
| value: '生产班线',
| label: '生产班线'
| }
| ]
| };
| },
| components: { TableContainer, inboundInuqer, Modal, enterEdit, Choose, AddChoose },
| computed: {
| tableHead () {
| return enter;
| }
| },
| mounted () {
| this.ContainerVsItemSearch();
| },
| methods: {
| //刷新
| refresh () {
| this.loading = true;
| this.inuqerobg = {};
| this.$refs.inref.inrefclear();
| this.ContainerVsItemSearch();
| },
| //查询
| inquer (e) {
| this.inuqerobg = e;
| this.page = 1;
| this.ContainerVsItemSearch();
| },
| //搜索用户
| ContainerVsItemSearch () {
| const {
| 组盘编号: cviCode,
| 零件编号: itemName,
| 零件名称: itemDes,
| 器具编号: containerName,
| 器具类型: containerType,
| 入库计划: inOrderCode,
| 出库计划: outOrderCode,
| 返修车间: badByFactory,
| 生产班线: createLine
| } = this.inuqerobg;
| this.$Loading(true);
| ContainerVsItemSearch(this.page + '&onePageNum=' + this.pageSize, {
| itemName,
| itemDes,
| containerName,
| containerType,
| inOrderCode,
| outOrderCode,
| badByFactory,
| createLine,
| cviCode,
| createTimeStart: this.inuqerobg.timepick ? this.inuqerobg.timepick[0] : '',
| createTimeEnd: this.inuqerobg.timepick ? this.inuqerobg.timepick[1] : ''
| }).then(res => {
| this.loading = false;
| if (res.code == 0) {
| this.tableData = res.data;
| this.totle = res.num;
| }
| this.$Loading();
| });
| },
| CurrentChange (e) {
| console.log(e);
| this.page = e;
| this.ContainerVsItemSearch();
| },
| //页数
| SizeChange (e) {
| this.pageSize = e;
| this.ContainerVsItemSearch();
| },
| //编辑
| edit (row) {
| this.rowitem = { ...row };
| this.chooselist = []; //零件数据
| this.addmodalShow = true;
| this.title = '编辑';
| },
| //勾选
| handleSelectionChange (e) {
| this.handleSeleclist = e;
| },
| //删除
| del (row) {
| console.log(row);
| const { id } = { ...row };
| this.$confirm('此操作将永久删除该组盘信息, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| })
| .then(() => {
| ContainerVsItemDelete({ id }).then(res => {
| if (res.code == 0) {
| this.$message({
| type: 'success',
| message: '删除成功'
| });
| this.ContainerVsItemSearch();
| } else {
| this.$message({
| type: 'warning',
| message: '删除失败'
| });
| }
| });
| })
| .catch(() => {
| this.$message({
| type: 'info',
| message: '已取消删除'
| });
| });
| },
| //新建
| addmodal () {
| this.rowitem = {};
| this.chooselist = [];
| this.addmodalShow = true;
| this.title = '新建';
| },
| //新增修改后
| addsubmit () {
| this.addmodalShow = false;
| this.modalShow = false;
| this.ContainerVsItemSearch();
| },
| //零件勾选数据
| chooseClick (e) {
| if (e.length > 0) {
| this.chooselist = [...e];
| this.partShow = false;
| } else {
| this.$message({
| type: 'info',
| message: '请勾选'
| });
| }
| },
| //新增零件后
| addchooseclick () {
| this.addchooseShow = false;
| this.$refs.enterChoose.itemSearch();
| }
| }
| };
| </script>
|
| <style lang="scss" scoped>
| #enter {
| .table {
| width: 100%;
| margin-top: 10px;
| height: calc(100% - 40px);
| overflow: hidden;
| }
| }
| </style>
|
|