瀏覽代碼

1.转移数量变动日志 新增 (总计 , 备注模糊查询 )

2.货权转移管理列表新增删除
dw 1 周之前
父節點
當前提交
aad07d5583
共有 2 個檔案被更改,包括 159 行新增31 行删除
  1. 55
    26
      src/view/maint/cargo.vue
  2. 104
    5
      src/view/record/changerecord.vue

+ 55
- 26
src/view/maint/cargo.vue 查看文件

@@ -13,7 +13,7 @@
13 13
 			<el-button type="primary" size="small" @click="handleAdd">新增</el-button>
14 14
 			<el-button type="danger" size="small"  @click="resetButton">重置</el-button>
15 15
 		</el-row>
16
-    
16
+
17 17
 		<el-table :data="tableData" border>
18 18
 			<el-table-column prop="id" label="编号" width="60" v-if="isShow">
19 19
 			</el-table-column>
@@ -29,7 +29,7 @@
29 29
 			<el-table-column label="操作">
30 30
 				<template slot-scope="scope">
31 31
 					<el-button size="mini" @click="handleEdit(scope.row)">编辑</el-button>
32
-					<!-- <el-button size="mini" type="danger" @click="handleDelete(scope.row.id)">删除</el-button> -->
32
+					 <el-button size="mini" type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
33 33
 				</template>
34 34
 			</el-table-column>
35 35
 			<el-table-column label="日志记录" width="120">
@@ -86,25 +86,39 @@
86 86
 
87 87
 		<el-dialog title="转移数量变动日志" :visible.sync="dialogVisibleRecord" width="1000px">
88 88
 			<div class="searchForm-header">
89
-				<el-form :model="queryDetail" label-width="100px" inline="">
90
-					<el-row>
91
-						<el-form-item>
92
-							<el-date-picker size="small" v-model="queryDetail.RecordDate"  style="width:330px;margin-left: -8px" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="getTableData2" clearable>
93
-							</el-date-picker>
94
-						</el-form-item>
95
-						<el-form-item>
96
-							<el-select size="small" v-model="queryDetail.subStr" placeholder="修改类型" @change="getTableData2" clearable>
97
-								<el-option v-for="item in optionsSubStr" :key="item.value" :label="item.label" :value="item.value"> </el-option>
98
-							</el-select>
99
-						</el-form-item>
100
-						<el-form-item>
101
-							<el-select size="small" v-model="queryDetail.changeFrom" placeholder="修改来源" @change="getTableData2" clearable>
102
-								<el-option v-for="item in optionsChangeFrom" :key="item.value" :label="item.label" :value="item.value"> </el-option>
103
-							</el-select>
104
-						</el-form-item>
105
-						
89
+				<el-form :model="queryDetail" label-width="80px" inline>
90
+					<el-row :gutter="20">
91
+						<el-col :span="8">
92
+							<el-form-item label="日期范围">
93
+								<el-date-picker size="small" v-model="queryDetail.RecordDate" style="width: 100%;" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="getTableData2" clearable>
94
+								</el-date-picker>
95
+							</el-form-item>
96
+						</el-col>
97
+						<el-col :span="4">
98
+							<el-form-item label="修改类型">
99
+								<el-select size="small" v-model="queryDetail.subStr" placeholder="请选择" @change="getTableData2" clearable>
100
+									<el-option v-for="item in optionsSubStr" :key="item.value" :label="item.label" :value="item.value"> </el-option>
101
+								</el-select>
102
+							</el-form-item>
103
+						</el-col>
104
+						<el-col :span="4">
105
+							<el-form-item label="修改来源">
106
+								<el-select size="small" v-model="queryDetail.changeFrom" placeholder="请选择" @change="getTableData2" clearable>
107
+									<el-option v-for="item in optionsChangeFrom" :key="item.value" :label="item.label" :value="item.value"> </el-option>
108
+								</el-select>
109
+							</el-form-item>
110
+						</el-col>
111
+						<el-col :span="4">
112
+							<el-form-item label="备注">
113
+								<el-input placeholder="模糊查询" v-model="queryDetail.remark" @change="getTableData2" clearable size="small"></el-input>
114
+							</el-form-item>
115
+						</el-col>
116
+						<el-col :span="4">
117
+							<el-form-item label="合计">
118
+								<el-input v-model="count" disabled size="small"></el-input>
119
+							</el-form-item>
120
+						</el-col>
106 121
 					</el-row>
107
-					
108 122
 				</el-form>
109 123
 			</div>
110 124
 			<el-table :data="tableData2" border>
@@ -151,7 +165,7 @@
151 165
                 options: [],
152 166
                 tableData: [],
153 167
 				tableData2: [],
154
-
168
+        count:0,
155 169
                 currentPage: 1,
156 170
 				totalRows: 0,
157 171
 				pageSizes: [50, 100, 200,500],
@@ -178,7 +192,7 @@
178 192
                 },
179 193
                 optionsSub: [{
180 194
                     value: 'up',
181
-                    label: '增加'}, 
195
+                    label: '增加'},
182 196
                     {value: 'down',
183 197
                     label: '减少'
184 198
                 }],
@@ -189,6 +203,7 @@
189 203
 					RecordDate:[],
190 204
 					subStr:'',
191 205
 					changeFrom:'',
206
+          remark: '',
192 207
 				},
193 208
 				optionsSubStr:[{
194 209
 						value: '增加',
@@ -347,9 +362,10 @@
347 362
 				this.dialogVisible = true
348 363
 				this.change.id = tempRow.id
349 364
 				this.change.uperCustomer = tempRow.uperCustomer.id
350
-				this.change.Customer = ''
365
+				this.change.Customer = tempRow.customer.id
351 366
 				this.change.sub = ''
352 367
 				this.change.weight = ''
368
+        this.change.remark = ''
353 369
 			},
354 370
 			handleViewRecord(row){
355 371
 				this.dialogVisibleRecord=true;
@@ -360,10 +376,10 @@
360 376
 				this.queryDetail.subStr='',
361 377
 				this.queryDetail.changeFrom='',
362 378
 				this.getTableData2(tempRow.uperCustomer.id,tempRow.customer.id)
363
-				
379
+
364 380
 			},
365 381
 			getTableData2(uperCustomer,Customer){
366
-
382
+        this.count = 0;
367 383
 				var url = 'MaintCargo/queryRecord.do'
368 384
 				// alert(this.queryDetail.RecordDate);
369 385
 				if(this.queryDetail.RecordDate == null){
@@ -377,7 +393,8 @@
377 393
 					RecordDateBegin : (!this.queryDetail.RecordDate[0]) ? "1970-01-01 00:00:00" : this.queryDetail.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"),
378 394
 					RecordDateEnd : (!this.queryDetail.RecordDate[1]) ? "2999-01-01 00:00:00" : this.queryDetail.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
379 395
 					subStr:this.queryDetail.subStr,
380
-					changeFrom:this.queryDetail.changeFrom
396
+					changeFrom:this.queryDetail.changeFrom,
397
+          remark:this.queryDetail.remark
381 398
 
382 399
 				}
383 400
 				axios.get(url, param).then(response => {
@@ -386,6 +403,18 @@
386 403
 					if (response.data.code == 0) {
387 404
 						this.tableData2 = response.data.data.list
388 405
 						this.totalRows2 = response.data.data.total
406
+            if(this.queryDetail.subStr=='增加'){
407
+              this.tableData2.forEach((item, index) => {
408
+                console.log(index, item)
409
+                this.count += item.weight
410
+              })
411
+            }else if(this.queryDetail.subStr=='减少'){
412
+              this.tableData2.forEach((item, index) => {
413
+                console.log(index, item)
414
+                this.count += item.weight
415
+              })
416
+              this.count = -this.count
417
+            }
389 418
 						//this.drawWareLayout()
390 419
 					} else {
391 420
 						this.$message({

+ 104
- 5
src/view/record/changerecord.vue 查看文件

@@ -34,7 +34,7 @@
34 34
 							<el-input v-model="query.model" size="small" style="width:120px;margin-left: -8px">
35 35
 							</el-input>
36 36
 						</el-form-item>
37
-						<el-form-item label="钢板号" style="margin-left: -35px;margin-top: -15px"> 
37
+						<el-form-item label="钢板号" style="margin-left: -35px;margin-top: -15px">
38 38
 							<el-input v-model="query.plateNo" size="small" style="width:120px;margin-left: -8px">
39 39
 							</el-input>
40 40
 						</el-form-item>
@@ -44,6 +44,7 @@
44 44
 						</el-form-item>
45 45
 						<el-form-item label=" " style="margin-top: -15px">
46 46
 							<el-button @click="handleSearch" type="primary"  size="small" >查询</el-button>
47
+							<el-button @click="handleExport" type="success"  size="small" icon="el-icon-download">导出记录</el-button>
47 48
 						</el-form-item>
48 49
 					</el-row>
49 50
 				</el-form>
@@ -102,6 +103,14 @@
102 103
 
103 104
 		<popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
104 105
 		<popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
106
+
107
+		<!-- 导出Loading遮罩层 -->
108
+		<div v-if="exportLoading" class="export-loading-mask">
109
+			<div class="export-loading-content">
110
+				<i class="el-icon-loading"></i>
111
+				<p>正在导出,请稍候...</p>
112
+			</div>
113
+		</div>
105 114
 	</div>
106 115
 </template>
107 116
 
@@ -151,10 +160,11 @@
151 160
 					plateNo: '',
152 161
 					RecordDate:[],
153 162
 				},
154
-				childUrl:'WareChangeRecord/queryTotal.do',
155
-				loading: false,
163
+childUrl:'WareChangeRecord/queryTotal.do',
164
+			loading: false,
165
+			exportLoading: false,
156 166
 
157
-			};
167
+		};
158 168
 		},
159 169
 		//页面加载完成渲染
160 170
 		mounted() {
@@ -234,7 +244,7 @@
234 244
 					customerName: this.query.customerName,
235 245
 					plateNo: this.query.plateNo,
236 246
 					pFromDate:(!this.query.RecordDate[0]) ? "1970-01-01 00:00:00" : this.query.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"),		//date类型
237
-					pToDate  :(!this.query.RecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"), 
247
+					pToDate  :(!this.query.RecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
238 248
 				}
239 249
 				this.childParam = param;
240 250
 				axios.get(url, param).then(response => {
@@ -253,12 +263,101 @@
253 263
 			},
254 264
 			changeWare(){
255 265
 
266
+			},
267
+			// 导出Excel
268
+			handleExport() {
269
+				// 显示加载动画
270
+				this.exportLoading = true;
271
+
272
+				var baseUrl = this.$store.state.app.serverName;
273
+				var url = baseUrl + 'WareChangeRecord/exportExcel.do';
274
+				let userId = localStorage.getItem("userId");
275
+				let belongId = localStorage.getItem("belongId");
276
+				let token = localStorage.getItem("token");
277
+
278
+				var param = {
279
+					wareName: this.query.wareName,
280
+					stackName: this.query.stackName,
281
+					model: this.query.model,
282
+					materialName: this.query.materialName,
283
+					standard: this.query.standard,
284
+					customerName: this.query.customerName,
285
+					plateNo: this.query.plateNo,
286
+					pFromDate: (!this.query.RecordDate[0]) ? "1970-01-01 00:00:00" : this.query.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"),
287
+					pToDate: (!this.query.RecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") : this.query.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
288
+					userId: userId,
289
+					belongId: belongId
290
+				};
291
+
292
+				var params = [];
293
+				for (var key in param) {
294
+					params.push(key + '=' + encodeURIComponent(param[key]));
295
+				}
296
+				var fullUrl = url + (params.length > 0 ? '?' + params.join('&') : '');
297
+
298
+				// 使用 fetch + blob 方式,下载完成后关闭 loading
299
+				fetch(fullUrl, {
300
+					headers: {
301
+						'token': token,
302
+						'userId': userId,
303
+						'belongId': belongId
304
+					}
305
+				})
306
+				.then(response => {
307
+					if (!response.ok) {
308
+						throw new Error('网络请求失败');
309
+					}
310
+					return response.blob();
311
+				})
312
+				.then(blob => {
313
+					// 创建下载链接
314
+					const url = window.URL.createObjectURL(blob);
315
+					const link = document.createElement('a');
316
+					link.href = url;
317
+					link.download = '转移记录_' + new Date().toISOString().slice(0, 10) + '.xlsx';
318
+					document.body.appendChild(link);
319
+					link.click();
320
+					// 浏览器开始下载后立即关闭 loading
321
+					this.exportLoading = false;
322
+					// 清理
323
+					setTimeout(() => {
324
+						document.body.removeChild(link);
325
+						window.URL.revokeObjectURL(url);
326
+					}, 100);
327
+				})
328
+				.catch(error => {
329
+					console.error('导出失败:', error);
330
+					this.$message.error('导出失败:' + error.message);
331
+					this.exportLoading = false;
332
+				});
256 333
 			}
257 334
 		},
258 335
 	}
259 336
 </script>
260 337
 
261 338
 <style>
339
+/* 导出Loading遮罩样式 */
340
+.export-loading-mask {
341
+	position: fixed;
342
+	top: 0;
343
+	left: 0;
344
+	width: 100%;
345
+	height: 100%;
346
+	background-color: rgba(0, 0, 0, 0.5);
347
+	z-index: 9999;
348
+	display: flex;
349
+	justify-content: center;
350
+	align-items: center;
351
+}
352
+
353
+.export-loading-content {
354
+	background-color: #fff;
355
+	padding: 30px 50px;
356
+	border-radius: 8px;
357
+	text-align: center;
358
+	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
359
+}
360
+
262 361
 .searchForm-header{
263 362
 		/*background-color: red;*/
264 363
 		height: auto;

Loading…
取消
儲存