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
| <template>
| <!-- 叉车任务 -->
| <div id="forklifttasks" class="global-content">
| <!-- 筛选 -->
| <maintask-inquer
| byfilter="任务编号"
| :groupshow="true"
| :dele="false"
| :derive="true"
| :forkliftshow="true"
| :filterList="filterList"
| @addmodal="addmodal"
| @derive="derive"
| @inquer="inquer"
| />
| <!-- table -->
| <div class="table">
| <table-container
| :wipelist="wipelist"
| :tableHead="tableHead"
| :tableData="tableData"
| :editShow="true"
| :delShow="true"
| :currentPage="page"
| :pageSize="pageSize"
| :totle="totle"
| :naxnumShow="false"
| @edit="edit"
| @del="del"
| @CurrentChange="CurrentChange"
| @SizeChange="SizeChange"
| />
| </div>
|
| <transition name="modal">
| <modal v-if="addmodalShow" :modabg="true" @cancel="addmodalShow = false">
| <p slot="title">叉车任务-{{ title }}</p>
| <div class="height" slot="centent">
| <forklifttasks-edit @cancel="addmodalShow = false" :rowitem="rowitem" @addsubmit="addsubmit" />
| </div>
| </modal>
| </transition>
| </div>
| </template>
|
| <script>
| import { TableContainer, Modal } from '@/components/index';
| import maintaskInquer from '../components/maintask-inquer';
| import forklifttasksEdit from '../components/forklifttasksEdit';
| const { forklifttasks } = require('@/components/tableContainer/tableHead');
| import { CarTaskSearch, CarTaskDelete } from '@/api/forklifttasks';
| import { exportTableList } from '@/utils/excel';
| import { getimestampDate, getymdhms } from '@/utils/date';
| export default {
| data() {
| return {
| title: '',
| tableData: [],
| modalShow: false,
| addmodalShow: false,
| wipelist: ['inOrderCode'],
| rowitem: {},
| totle: 0,
| page: 1,
| pageSize: 20,
| pageNum: 0,
| inuqerobg: {},
| filterList: [
| {
| value: '任务编号',
| label: '任务编号'
| },
| {
| value: '目的地',
| label: '目的地'
| },
| {
| value: '取货地',
| label: '取货地'
| },
| {
| value: '器具编号',
| label: '器具编号'
| },
| {
| value: '零件编号',
| label: '零件编号'
| }
| ]
| };
| },
| components: { TableContainer, maintaskInquer, Modal, forklifttasksEdit },
| computed: {
| tableHead() {
| return forklifttasks;
| }
| },
| mounted() {
| this.CarTaskSearch();
| },
| methods: {
| //查询
| inquer(e) {
| this.inuqerobg = e;
| this.page = 1;
| this.CarTaskSearch();
| },
| //导出
| derive() {
| let tHeader = [];
| let filterVal = [];
| this.tableHead.forEach(item => {
| tHeader.push(item.columnDescription);
| filterVal.push(item.columnName);
| });
| const {
| 任务编号: carTaskName,
| 目的地: toDestination,
| 取货地: fromDestination,
| 零件编号: itemName,
| 器具编号: containerName,
| userName
| } = this.inuqerobg;
| this.$Loading(true);
| CarTaskSearch('1&onePageNum=99999999', {
| itemName,
| carTaskName,
| toDestination,
| fromDestination,
| containerName,
| userName,
| createTimeStart: this.inuqerobg.timepick ? this.inuqerobg.timepick[0] : '',
| createTimeEnd: this.inuqerobg.timepick ? this.inuqerobg.timepick[1] : ''
| }).then(res => {
| if (res.code == 0) {
| let data = res.data;
| data.forEach(item => {
| item.updateTime = item.updateTime ? getimestampDate(item.updateTime) : '';
| });
| exportTableList(tHeader, filterVal, data, '叉车任务' + getymdhms());
| }
| this.$Loading();
| });
| },
| //搜索叉车任务
| CarTaskSearch() {
| const {
| 任务编号: carTaskName,
| 目的地: toDestination,
| 取货地: fromDestination,
| 零件编号: itemName,
| 器具编号: containerName,
| userName
| } = this.inuqerobg;
| this.$Loading(true);
| CarTaskSearch(this.page + '&onePageNum=' + this.pageSize, {
| itemName,
| carTaskName,
| toDestination,
| fromDestination,
| containerName,
| userName,
| createTimeStart: this.inuqerobg.timepick ? this.inuqerobg.timepick[0] : '',
| createTimeEnd: this.inuqerobg.timepick ? this.inuqerobg.timepick[1] : ''
| }).then(res => {
| if (res.code == 0) {
| let data = res.data;
| data.forEach(item => {
| item.updateTime = item.updateTime ? getimestampDate(item.updateTime) : '';
| });
| this.tableData = data;
| this.totle = res.num;
| this.pageNum = res.pageNum;
| }
| this.$Loading();
| });
| },
| CurrentChange(e) {
| console.log(e);
| this.page = e;
| this.CarTaskSearch();
| },
| //页数
| SizeChange(e) {
| this.pageSize = e;
| this.CarTaskSearch();
| },
| //编辑
| edit(row) {
| this.addmodalShow = true;
| this.rowitem = { ...row };
| this.title = '编辑';
| },
| //删除
| del(row) {
| console.log(row);
| const { carTaskName } = { ...row };
| this.$confirm('此操作将永久删除, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| })
| .then(() => {
| CarTaskDelete({ carTaskName }).then(res => {
| if (res.code == 0) {
| this.$message({
| type: 'success',
| message: '删除成功!'
| });
| this.CarTaskSearch();
| }
| });
| })
| .catch(() => {
| this.$message({
| type: 'info',
| message: '已取消删除'
| });
| });
| },
| //新建
| addmodal() {
| this.rowitem = {};
| this.addmodalShow = true;
| this.title = '新建';
| },
| //新增修改后
| addsubmit() {
| this.addmodalShow = false;
| this.modalShow = false;
| this.CarTaskSearch();
| }
| }
| };
| </script>
|
| <style lang="scss" scoped>
| #forklifttasks {
| .table {
| width: 100%;
| margin-top: 10px;
| height: calc(100% - 40px);
| overflow: hidden;
| }
| }
| </style>
|
|