Selaa lähdekoodia

增加入库页面

石岩 3 viikkoa sitten
vanhempi
commit
a8b22cc43a
1 muutettua tiedostoa jossa 755 lisäystä ja 0 poistoa
  1. 755
    0
      src/view/ware/InStore.vue

+ 755
- 0
src/view/ware/InStore.vue Näytä tiedosto

@@ -0,0 +1,755 @@
1
+<template>
2
+	<div style="height:100%;">
3
+		<div class="searchForm-header">
4
+			<el-form :model="query" label-width="100px" inline="">
5
+				<el-row>
6
+					<el-form-item label="库房名称" style="margin-left: -15px">
7
+						<el-select v-model="query.wareName" clearable size="small" style="width:120px;margin-left: -8px">
8
+							<el-option v-for="item in optionsWare" :key="item.id" :label="item.name" :value="item.name">
9
+							</el-option>
10
+						</el-select>
11
+					</el-form-item>
12
+					<el-form-item label="垛位名称" style="margin-left: -35px">
13
+						<el-input v-model="query.stackName" size="small" style="width:120px;margin-left: -8px"></el-input>
14
+					</el-form-item>
15
+					<el-form-item label="品名" style="margin-left: -35px">
16
+						<el-input v-model="query.materialName" size="small" style="width:120px;margin-left: -8px">
17
+							<el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
18
+						</el-input>
19
+					</el-form-item>
20
+					<el-form-item label="钢种" style="margin-left: -35px">
21
+						<el-input v-model="query.standard" size="small" style="width:150px;margin-left: -8px">
22
+							<el-button slot="append" icon="el-icon-search" @click="showMaterial"></el-button>
23
+						</el-input>
24
+					</el-form-item>
25
+          <el-form-item label="货权单位" style="margin-left: -35px">
26
+          	<el-input v-model="query.fkcustomer" size="small" style="width:170px;margin-left: -8px">
27
+          		<el-button slot="append" icon="el-icon-search" @click="showfkCustomer"></el-button>
28
+          	</el-input>
29
+          </el-form-item>
30
+					<el-form-item label="客户名称" style="margin-left: -35px">
31
+						<el-input v-model="query.customerName" size="small" style="width:170px;margin-left: -8px">
32
+							<el-button slot="append" icon="el-icon-search" @click="showCustomer"></el-button>
33
+						</el-input>
34
+					</el-form-item>
35
+					<el-form-item label="规格型号" style="margin-left: -15px;margin-top: -3px">
36
+						<el-input v-model="query.model" size="small" style="width:120px;margin-left: -8px">
37
+						</el-input>
38
+					</el-form-item>
39
+          <el-form-item label="钢板号" style="margin-left: -15px;margin-top: -3px">
40
+          	<el-input v-model="query.plateNo" size="small" style="width:120px;margin-left: -8px">
41
+          	</el-input>
42
+          </el-form-item>
43
+          <el-form-item label="订单号" style="margin-left: -15px;margin-top: -3px">
44
+          	<el-input v-model="query.ordNo" size="small" style="width:120px;margin-left: -8px">
45
+          	</el-input>
46
+          </el-form-item>
47
+					<el-form-item label="" style="margin-top: 0px;margin-left: 10px">
48
+						<el-button size="small"  type="primary" @click="handleSearch">查询</el-button>
49
+						<el-button size="small"  type="info" @click="handleClear">重置</el-button>
50
+                        
51
+                        <el-button size="small"  type="info" @click="handleImport" plain>导入</el-button>
52
+
53
+						<el-button @click="showChangeCustomer" size="small"  type="primary">货权转移</el-button>
54
+						<el-button type="primary" size="small"  @click="showDistribution">配货</el-button>
55
+                        <el-button type="success" @click="handleExport" style="margin-left: 2px" size="small">导出记录</el-button>
56
+                        <el-button type="primary" size="small" @click="showOut">出库</el-button>
57
+                        <el-button size="small" type="danger"  @click="handleInBack" :disabled="backAble">取消入库</el-button>
58
+					</el-form-item>
59
+				</el-row>
60
+
61
+			</el-form>
62
+		</div>
63
+		<div class="tabledata-grid">
64
+			<el-table :data="tableData" height="100%"   border style="width: 97%;" v-loading="loading" ref="multipleTable"	@select="handleTableSelect"	 @selection-change="handleSelectionChange" @select-all = "selectAll">
65
+				<el-table-column type="selection" width="40" header-align="center" align="center"></el-table-column>
66
+				<el-table-column prop="plateNo" label="产品编号" width="200" show-overflow-tooltip header-align="center"></el-table-column>
67
+				<el-table-column prop="materialName" label="品名" width="100" show-overflow-tooltip header-align="center" align="center"></el-table-column>
68
+                <el-table-column prop="ordNo" label="订单号" width="180" show-overflow-tooltip header-align="center"></el-table-column>
69
+				<el-table-column prop="model" label="规格型号" width="160" show-overflow-tooltip header-align="center" align="center"></el-table-column>
70
+				<el-table-column prop="weight" label="重量" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
71
+				<el-table-column prop="materialStandard" label="钢种" width="100" show-overflow-tooltip header-align="center" align="center"></el-table-column>
72
+				<el-table-column prop="inCarNo" label="入库车号" width="200" show-overflow-tooltip header-align="center"></el-table-column>
73
+                <el-table-column prop="addTime" label="入库时间" width="200" show-overflow-tooltip header-align="center"></el-table-column>
74
+                <el-table-column prop="customerName" label="货主" width="300" show-overflow-tooltip header-align="center"></el-table-column>
75
+				<el-table-column prop="productionPlace" label="产地" width="250" show-overflow-tooltip header-align="center"></el-table-column>
76
+				<el-table-column prop="count" label="件数" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
77
+				<el-table-column prop="wgtDcnMtcCd" label="计重方式" width="100" show-overflow-tooltip header-align="center"></el-table-column>
78
+				<el-table-column prop="billRule" label="计费规则" width="100" show-overflow-tooltip header-align="center"></el-table-column>
79
+				<el-table-column prop="edgeTy" label="切边类型" width="100" show-overflow-tooltip header-align="center"></el-table-column>
80
+				<el-table-column prop="appDesc" label="外观描述" width="100" show-overflow-tooltip header-align="center"></el-table-column>
81
+				<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip header-align="center"></el-table-column>
82
+			</el-table>
83
+			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
84
+			 :page-sizes="pageSizes" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalRows">
85
+			</el-pagination>
86
+		</div>
87
+
88
+		<popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
89
+		<popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
90
+        <popup-customer ref="PopupfkCustomer" @receviceFromChild="receviceFromfkCustomer"></popup-customer>
91
+		<popup-customer ref="PopupNewCustomer" @receviceFromChild="receviceFromNewCustomer"></popup-customer>
92
+		<popup-address ref="PopupAddress" @receviceFromChild="receviceFromAddress"></popup-address>
93
+		<popup-distribution ref="PopupDistribution" @receviceFromChild="receviceFromDistreibution" :selectRows="selectRows"></popup-distribution>
94
+		<popup-out ref="PopupOut" @receviceFromChild="receviceFromOut"></popup-out>
95
+		<popup-in ref="PopupIn" @receviceFromChild="receviceFromIn" :wares="options" :wareId="query.wareId" :stack="moveFromStack"></popup-in>
96
+		<el-dialog title="货权转移" :visible.sync="customerDialogVisible" width="500px">
97
+			<el-form>
98
+				<el-form-item label="货权转移">
99
+					<el-input v-model="newCustomer.name">
100
+						<el-button slot="append" icon="el-icon-search" @click="showNewCustomer"></el-button>
101
+					</el-input>
102
+				</el-form-item>
103
+				<el-form-item label="修改目的地">
104
+					<el-input v-model="newAddress_fir">
105
+						<el-button slot="append" icon="el-icon-search" @click="showAddress"></el-button>
106
+					</el-input>
107
+				</el-form-item>
108
+        <el-form-item label="修改地址">
109
+        	<el-input v-model="newAddress_lst">
110
+        	</el-input>
111
+        </el-form-item>
112
+				<el-form-item label=" ">
113
+					<el-button type="success" @click="handleCustomerSave">保存</el-button>
114
+					<el-button type="danger" @click="handleCustomerCancelSave">取消</el-button>
115
+				</el-form-item>
116
+			</el-form>
117
+		</el-dialog>
118
+		<el-dialog title="导入入库信息" :visible.sync="importDialogVisible" width="1000px">
119
+			<el-upload class="upload-demo" action="" :on-change="handleChange" :on-exceed="handleExceed" :on-remove="handleRemove"
120
+			 ref="upload" :limit="1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
121
+			 :auto-upload="false">
122
+				<el-button slot="trigger" size="small" type="primary">选择文件</el-button>
123
+				<el-button size="small" type="success" @click="inImport">保存</el-button>
124
+				<div slot="tip" >只能上传xlsx/xls文 件</div>
125
+			</el-upload>
126
+			<!-- 
127
+            <el-table :data="imTableData" border>
128
+				<el-table-column prop="层数" label="层数" width="60" show-overflow-tooltip header-align="center"></el-table-column>
129
+				<el-table-column prop="库房" label="库房" width="100" show-overflow-tooltip header-align="center"></el-table-column>
130
+				<el-table-column prop="垛位" label="垛位" width="120" show-overflow-tooltip header-align="center"></el-table-column>
131
+				<el-table-column prop="物料" label="物料" width="120" show-overflow-tooltip align="center" header-align="center"></el-table-column>
132
+				<el-table-column prop="钢种" label="钢种" width="120" show-overflow-tooltip align="center" header-align="center"></el-table-column>
133
+				<el-table-column prop="钢板号" label="钢板号" width="200" show-overflow-tooltip header-align="center"></el-table-column>
134
+				<el-table-column prop="规格型号" label="规格型号" width="120" show-overflow-tooltip header-align="center"></el-table-column>
135
+				<el-table-column prop="数量" label="数量" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
136
+				<el-table-column prop="重量" label="重量" width="120" show-overflow-tooltip align="right" header-align="center"></el-table-column>
137
+				<el-table-column prop="客户" label="客户" width="300" show-overflow-tooltip header-align="center"></el-table-column>
138
+				<el-table-column prop="备注" label="备注" width="150" show-overflow-tooltip header-align="center"></el-table-column>
139
+			</el-table> 
140
+            -->
141
+		</el-dialog>
142
+        
143
+	</div>
144
+</template>
145
+
146
+<script>
147
+	import axios from '@/axios'
148
+	import PopupStack from '@/components/PopupStack.vue'
149
+	import PopupMaterial from '@/components/PopupMaterial.vue'
150
+	import PopupCustomer from '@/components/PopupCustomer.vue'
151
+	import PopupAddress from '@/components/PopupAddress.vue'
152
+	import PopupDistribution from '@/components/PopupDistribution.vue'
153
+	import PopupOut from '@/components/PopupOut.vue'
154
+	import PopupIn from '@/components/PopupIn.vue'
155
+  import Export2Excel from '../../excel/Export2Excel.js'
156
+	import {
157
+		mapState
158
+	} from 'vuex'
159
+	export default {
160
+		components: {
161
+			PopupStack,
162
+			PopupMaterial,
163
+			PopupCustomer,
164
+			PopupAddress,
165
+			PopupDistribution,
166
+			PopupOut,
167
+			PopupIn,
168
+		},
169
+		computed: {
170
+			// splitCount: function() {
171
+			// 	let result = Number(this.split.originalCount) - Number(this.split.count)
172
+			// 	return result
173
+			// },
174
+			// splitWeight: function() {
175
+			// 	let result = Number(this.split.originalWeight) - Number(this.split.weight)
176
+			// 	return result
177
+			// },
178
+			...mapState({
179
+				serverName: state => state.app.serverName,
180
+				// wareBackgroundColor: state => state.color.wareBackgroundColor,
181
+				// stackColor: state => state.color.stackColor,
182
+				// stackSelectedColor: state => state.color.stackSelectedColor,
183
+				// lockColor: state => state.color.lockColor,
184
+			})
185
+		},
186
+		data() {
187
+			return {
188
+				addressDialogVisible: false,
189
+				customerDialogVisible: false,
190
+				query: {
191
+					wareName: '',
192
+					stackName: '',
193
+					model: '',
194
+					materialName: '',
195
+					standard: '',
196
+					customerName: '',
197
+                    fkcustomer: '',
198
+					plateNo: '',
199
+                    ordNo: '',
200
+					wareId:'',
201
+				},
202
+				multipleSelection: [],
203
+				tableData: [],
204
+				optionsWare: [],
205
+				newCustomer: {
206
+					id: '',
207
+					name: ''
208
+				},
209
+				newAddress_fir: '',
210
+                newAddress_lst: '',
211
+				currentPage: 1,
212
+				totalRows: 0,
213
+				pageSizes: [50, 100, 200],
214
+				pageSize: 50,
215
+				HideAndShow: 0,
216
+
217
+
218
+				loading: false,
219
+				importDialogVisible: false,
220
+				selectRows: [],
221
+				options: [],
222
+				moveFromStack: {}, //移除垛位
223
+				fileTemp: [],
224
+				imTableData: [],
225
+				moveStore: {},
226
+			};
227
+		},
228
+        //键盘监听
229
+		mounted() {
230
+			this.getWare()
231
+			//this.getTableData()
232
+		},
233
+		methods: {
234
+			showMaterial() {
235
+				this.$refs.PopupMaterial.show()
236
+			},
237
+			receviceFromMaterial(material) {
238
+				this.query.materialName = material.name
239
+				this.query.standard = material.standard
240
+			},
241
+
242
+			showCustomer() {
243
+				this.$refs.PopupCustomer.show()
244
+			},
245
+			receviceFromCustomer(customer) {
246
+				this.query.customerName = customer.name
247
+			},
248
+
249
+      showfkCustomer() {
250
+      	this.$refs.PopupfkCustomer.show()
251
+      },
252
+      receviceFromfkCustomer(customer) {
253
+      	this.query.fkcustomer = customer.name
254
+      },
255
+
256
+			showNewCustomer() {
257
+				this.$refs.PopupNewCustomer.show()
258
+			},
259
+			receviceFromNewCustomer(customer) {
260
+				this.newCustomer = customer
261
+				this.newAddress = customer.address
262
+			},
263
+			showAddress() {
264
+				this.$refs.PopupAddress.show(this.newCustomer.id)
265
+			},
266
+			receviceFromAddress(address) {
267
+				this.newAddress_fir = address.address_fir
268
+        this.newAddress_lst = address.address_lst
269
+			},
270
+
271
+			handleSearch() {
272
+				this.currentPage = 1
273
+				this.getTableData()
274
+			},
275
+			handleImport() {
276
+				this.importDialogVisible = true
277
+			},
278
+            showUpload() {
279
+				this.dialogTravePic = true
280
+			},
281
+			handleDownload() {
282
+				window.open(this.serverName.substr(0, this.serverName.lastIndexOf('/', this.serverName.lastIndexOf('/') - 1)) +
283
+					'/import.xls')
284
+			},
285
+			showIn() {
286
+				// if (this.query.wareId == '') {
287
+				// 	this.$message({
288
+				// 		type: 'error',
289
+				// 		message: '请选择入库库房'
290
+				// 	});
291
+				// 	return
292
+				// }
293
+				// if (this.query.stackId == '') {
294
+				// 	this.$message({
295
+				// 		type: 'error',
296
+				// 		message: '请选择入库垛位'
297
+				// 	});
298
+				// 	return
299
+				// }
300
+				this.$refs.PopupIn.show()
301
+			},
302
+			handleInBack() {
303
+				if (this.selectRows.length < 1) {
304
+					this.$message({
305
+						type: 'error',
306
+						message: '至少选择一条数据!',
307
+					});
308
+					return
309
+				} else {
310
+					var url = 'WareIn/back.do'
311
+					var param = {
312
+						json: JSON.stringify(this.selectRows),
313
+					}
314
+					axios.post(url, param).then(response => {
315
+						if (response.data.code == 0) {
316
+							this.getStoreByStackId(response.data.data)
317
+						} else {
318
+							this.$message({
319
+								type: 'error',
320
+								message: '操作失败;' + response.data.msg,
321
+							});
322
+						}
323
+					});
324
+				}
325
+			},
326
+			showDistribution() {
327
+				//console.log(this.selectRows.length)
328
+				if (this.selectRows.length < 1) {
329
+					this.$message({
330
+						type: 'warning',
331
+						message: '至少选择一条数据!',
332
+					});
333
+				}
334
+				this.$refs.PopupDistribution.show()
335
+
336
+			},
337
+			showOut() {
338
+				this.$refs.PopupOut.show()
339
+			},
340
+			getWare() {
341
+				var url = 'MaintWare/queryByUserId.do'
342
+				var param = {}
343
+				axios.get(url, param).then(response => {
344
+					this.optionsWare = response.data.data
345
+                    console.log('optionsWare',optionsWare)
346
+					if (response.data.data.length == 1) {
347
+						this.wareName = response.data.data[0].name
348
+
349
+					}
350
+				});
351
+			},
352
+			handleSizeChange(val) {
353
+				this.pageSize = val
354
+				this.getTableData()
355
+			},
356
+
357
+			handleCurrentChange(val) {
358
+				this.currentPage = val
359
+				this.getTableData()
360
+			},
361
+
362
+			search() {
363
+				this.currentPage = 1
364
+				this.getTableData()
365
+			},
366
+
367
+			getTableData() {
368
+				this.loading = true
369
+				var url = 'WareStore/queryStore.do'
370
+				var param = {
371
+					page: this.currentPage,
372
+					rows: this.pageSize,
373
+					wareName: this.query.wareName,
374
+					stackName: this.query.stackName,
375
+					model: this.query.model,
376
+					materialName: this.query.materialName,
377
+					standard: this.query.standard,
378
+					customerName: this.query.customerName,
379
+          plateNo: this.query.plateNo,
380
+          ordNo: this.query.ordNo,
381
+          fkcompony: this.query.fkcustomer,
382
+				}
383
+				axios.get(url, param).then(response => {
384
+					if (response.data.code == 0) {
385
+						this.tableData = response.data.data.list
386
+						this.totalRows = response.data.data.total
387
+					} else {
388
+						this.$message({
389
+							type: 'error',
390
+							message: '操作失败;' + response.data.msg,
391
+						});
392
+					}
393
+					this.loading = false
394
+				});
395
+			},
396
+			handleSelectionChange(val) {
397
+				this.multipleSelection = val;
398
+			},
399
+			showChangeCustomer() {
400
+				if (this.multipleSelection.length < 1) {
401
+					this.$message({
402
+						type: 'error',
403
+						message: '至少选择一条记录!',
404
+					});
405
+					return
406
+				}
407
+				var customerAddress = this.multipleSelection[0].customer.address
408
+				var boolean = true
409
+				for (var i = 0; i < this.multipleSelection.length; i++) {
410
+					if (this.multipleSelection[i].customer.address == customerAddress) {
411
+
412
+					} else {
413
+						boolean = boolean && false
414
+						customerAddress = this.multipleSelection[i].customer.address
415
+					}
416
+				}
417
+				if (boolean) {
418
+					this.newCustomer = this.multipleSelection[0].customer
419
+					this.newAddress = this.multipleSelection[0].receiveAddress
420
+					this.customerDialogVisible = true
421
+				} else {
422
+					this.$message({
423
+						type: 'error',
424
+						message: '请选择同一客户!',
425
+					});
426
+				}
427
+			},
428
+
429
+			handleCustomerSave() {
430
+				var url = 'WareChange/changeCustomer.do'
431
+				var param = {
432
+					json: JSON.stringify(this.multipleSelection),
433
+					customer: JSON.stringify(this.newCustomer),
434
+					address_fir: this.newAddress_fir,
435
+          address_lst: this.newAddress_lst
436
+				}
437
+				axios.post(url, param).then(response => {
438
+					if (response.data.code == 0) {
439
+						this.getTableData()
440
+						this.customerDialogVisible = false
441
+					} else {
442
+						this.$message({
443
+							type: 'error',
444
+							message: '操作失败;' + response.data.msg,
445
+						});
446
+					}
447
+				});
448
+			},
449
+			handleCustomerCancelSave() {
450
+				this.customerDialogVisible = false
451
+			},
452
+			inImport() {
453
+				var url = 'WareIn/inImport.do'
454
+				var json = JSON.stringify(this.imTableData)
455
+				var param = {
456
+					json: json
457
+				}
458
+				axios.post(url, param).then(response => {
459
+					if (response.data.code == '0') {
460
+						this.$message({
461
+							type: 'success',
462
+							message: '入库成功!',
463
+						});
464
+						this.importDialogVisible = false
465
+						this.imTableData = []
466
+						this.fileTemp = null
467
+					} else {
468
+						this.$message({
469
+							type: 'error',
470
+							message: '入库失败!' + response.data.msg
471
+						});
472
+
473
+					}
474
+				});
475
+			},
476
+			handleTableSelectionChange(val) {
477
+				this.selectRows = val
478
+				this.setLayerColor()
479
+			},
480
+			receviceFromDistreibution() {
481
+				this.getStoreByStackId(null)
482
+			},
483
+			getStoreByStackId(moveSelect) {
484
+				this.tableDataLoading = true
485
+				var url = 'WareStore/queryByWareIdStackId.do'
486
+				var param = {
487
+					wareId: this.query.wareId,
488
+					stackId: this.moveFromStack.id
489
+				}
490
+				axios.get(url, param).then(response => {
491
+					if (response.data.code == 0) {
492
+						this.tableData = response.data.data
493
+						this.selectRows = []
494
+						// if (this.isLayer == '0') {
495
+						// 	this.drawStoreNoLayer(response.data.data)
496
+						// } else if (this.isLayer == '1') {    //1是A开头的,2是B开头的,3是C开头的。
497
+						// 	this.drawStoreAutoLayer(response.data.data)
498
+						// } else if (this.isLayer == '2') {
499
+						// 	this.drawStoreManulLayer(response.data.data)
500
+						// }
501
+						if (moveSelect) {
502
+							this.$refs.multipleTable.clearSelection();
503
+							for (let i = 0; i < this.tableData.length; i++) {
504
+								for (let j = 0; j < moveSelect.length; j++) {
505
+									if (moveSelect[j].layer === this.tableData[i].layer) {
506
+										this.selectRows.push(this.tableData[i])
507
+									}
508
+								}
509
+							}
510
+							this.$nextTick(() => {
511
+								this.toggleSelection(this.selectRows, true)
512
+								this.setLayerColor()
513
+							})
514
+
515
+						}
516
+					} else {
517
+						this.$message({
518
+							type: 'error',
519
+							message: '保存失败' + response.data.msg,
520
+						});
521
+					}
522
+					this.tableDataLoading = false
523
+				});
524
+			},
525
+			receviceFromOut(customer) {
526
+				this.getStoreByStackId()
527
+			},
528
+			receviceFromIn() {
529
+				this.getStoreByStackId()
530
+			},
531
+			handleChange(file, fileList) {
532
+				this.fileTemp = file.raw
533
+				if (this.fileTemp) {
534
+					if ((this.fileTemp.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') || (this.fileTemp.type ==
535
+							'application/vnd.ms-excel')) {
536
+						this.importfxx(this.fileTemp)
537
+					} else {
538
+						this.$message({
539
+							type: 'warning',
540
+							message: '附件格式错误,请删除后重新上传!'
541
+						})
542
+					}
543
+				} else {
544
+					this.$message({
545
+						type: 'warning',
546
+						message: '请上传附件!'
547
+					})
548
+				}
549
+
550
+			},
551
+			handleExceed(file, fileList) {},
552
+			handleRemove(file, fileList) {
553
+				this.fileTemp = null
554
+			},
555
+			toggleSelection(rows, selected) {
556
+				if (rows) {
557
+					rows.forEach(row => {
558
+						this.$refs.multipleTable.toggleRowSelection(row, selected);  //接受两个参数,row传递被勾选行的数据,selected设置是否选中
559
+					});
560
+				}
561
+			},
562
+			setLayerColor() {
563
+				if (this.selectRows.length == 0) {
564
+					for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
565
+						if (this.tableData[i].lockFlag == '1') {
566
+							this.moveStore.storage._roots[i].attr('style', {
567
+								fill: this.lockColor,
568
+							})
569
+						} else {
570
+							this.moveStore.storage._roots[i].attr('style', {
571
+								fill: this.stackColor,
572
+							})
573
+						}
574
+					}
575
+				} else {
576
+					for (let i = 0; i < this.moveStore.storage._roots.length; i++) {
577
+						for (let j = 0; j < this.selectRows.length; j++) {
578
+							if (this.tableData[i] === this.selectRows[j]) {
579
+								this.moveStore.storage._roots[i].attr('style', {
580
+									fill: this.stackSelectedColor,
581
+								})
582
+								break;
583
+							} else {
584
+								if (this.tableData[i].lockFlag == '1') {
585
+									this.moveStore.storage._roots[i].attr('style', {
586
+										fill: this.lockColor,
587
+									})
588
+								} else {
589
+									this.moveStore.storage._roots[i].attr('style', {
590
+										fill: this.stackColor,
591
+									})
592
+								}
593
+							}
594
+						}
595
+
596
+					}
597
+				}
598
+			},
599
+			handleTableSelect(selection, row) {  //第一个参数是目前所有选中的数据
600
+				console.log(JSON.stringify(row))
601
+				if (row.lockFlag == '1') {
602
+					// this.$message({
603
+					// 	type: 'error',
604
+					// 	message: '该行已被配货锁定',
605
+					// });
606
+					alert("该行已被配货锁定")
607
+					this.toggleSelection([row], false)
608
+					// for(let i = 0;i<selection.length;i++){
609
+					//  if(selection[i]==row){
610
+					// 	 selection.splice(i,1)
611
+					//  }
612
+					// }
613
+				} else {
614
+					this.selectRows = selection
615
+					this.setLayerColor()
616
+				}
617
+			},
618
+			selectAll(selection){
619
+				this.selectRows = selection;
620
+			},
621
+      handleExport() {
622
+      	var imptData = [];
623
+      	var url = 'WareStore/queryStore.do'
624
+      	var param = {
625
+      		page: -1,
626
+      		rows: -1,
627
+      		wareName: this.query.wareName,
628
+      		stackName: this.query.stackName,
629
+      		model: this.query.model,
630
+      		materialName: this.query.materialName,
631
+      		standard: this.query.standard,
632
+      		customerName: this.query.customerName,
633
+      	  plateNo: this.query.plateNo,
634
+      	  ordNo: this.query.ordNo,
635
+      	  fkcompony: this.query.fkcustomer,
636
+      	}
637
+
638
+
639
+      	axios.get(url, param).then(response => {
640
+
641
+      		if (response.data.code == 0) {
642
+      			var imptData = response.data.data;
643
+      			if (imptData.length == 0) {
644
+      				this.$alert('无法导出,选择时间段无记录', '提示', {
645
+      					confirmButtonText: '确定',
646
+      					callback: action => {}
647
+      				});
648
+      			} else {
649
+
650
+      				this.exportExcel(imptData)
651
+      			}
652
+      		} else {
653
+      			this.$message({
654
+      				type: 'error',
655
+      				message: '操作失败;' + response.data.msg,
656
+      			});
657
+      		}
658
+
659
+      	});
660
+
661
+      },
662
+      exportExcel(imptData) {
663
+      	// alert(JSON.stringify(imptData))
664
+      	const header = ["垛位"
665
+      					,"层数"
666
+      					,"品名"
667
+      					,"钢种"
668
+                ,"产品编号"
669
+                ,"订单号"
670
+      					,"规格型号"
671
+      					,"数量"
672
+                ,"重量"
673
+                ,"货权单位"
674
+                ,"客户"
675
+      					,"目的地"
676
+                ,"收货地址"
677
+      					,"计量方式"
678
+      					,"切边类型"
679
+      					,"产地"
680
+      					,"备注"
681
+      					,"入库时间"
682
+      	] // 导出的表头名
683
+      	const filterVal = ["stackName"
684
+      			,"layer"
685
+      			,"materialName"
686
+      			,"materialStandard"
687
+      			,"plateNo"
688
+            ,"ordNo"
689
+      			,"model"
690
+      			,"count"
691
+      			,"weight"
692
+            ,"fkComponyId"
693
+      			,"customerName"
694
+      			,"receiveAddressFir"
695
+            ,"receiveAddressLast"
696
+      			,"wgtDcnMtcCd"
697
+      			,"edgeTy"
698
+      			,"productionPlace"
699
+            ,"remark"
700
+      			,"addTime"
701
+      	]
702
+
703
+        /* for(var i=0;i<imptData.length;i++){
704
+        	imptData[i]["stackName"] = imptData[i].stack.name;
705
+        	imptData[i]["materialName"] = imptData[i].material.name;
706
+          imptData[i]["materialStandard"] = imptData[i].material.standard;
707
+          imptData[i]["customerName"] = imptData[i].customer.name;
708
+        } */
709
+      	const list = imptData
710
+      	const data = this.formatJson(filterVal, list)
711
+
712
+      	const filename = '库存操作' + (new Date()).toLocaleDateString();
713
+      	Export2Excel.export_json_to_excel({
714
+      		header,
715
+      		data,
716
+      		filename
717
+      	})
718
+      },
719
+      formatJson(filterVal, jsonData) {
720
+      	return jsonData.map(v => filterVal.map(j => {
721
+      		return v[j]
722
+      	}))
723
+      },
724
+
725
+
726
+			//showChangeAddress() {},
727
+			// handleAddressSave() {
728
+			// },
729
+			// handleAddressCancelSave() {
730
+			// 	this.addressDialogVisible = false
731
+			// },
732
+		},
733
+	}
734
+</script>
735
+
736
+<style>
737
+.option_btn{
738
+	margin-left: 30px
739
+}
740
+.searchForm-header{
741
+		height: auto;
742
+		margin-left: 10px;
743
+	}
744
+	.tabledata-grid{
745
+		font-size: 20px;
746
+		margin-left: 5px;
747
+		height: calc(100% - 100px);
748
+
749
+	}
750
+
751
+  .el-select-dropdown .el-scrollbar .el-scrollbar__wrap
752
+    {
753
+        overflow: scroll!important;
754
+    }
755
+</style>

Loading…
Peruuta
Tallenna