Pārlūkot izejas kodu

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

2.货权转移管理列表新增删除
dw 1 nedēļu atpakaļ
vecāks
revīzija
aad07d5583
2 mainītis faili ar 159 papildinājumiem un 31 dzēšanām
  1. 55
    26
      src/view/maint/cargo.vue
  2. 104
    5
      src/view/record/changerecord.vue

+ 55
- 26
src/view/maint/cargo.vue Parādīt failu

13
 			<el-button type="primary" size="small" @click="handleAdd">新增</el-button>
13
 			<el-button type="primary" size="small" @click="handleAdd">新增</el-button>
14
 			<el-button type="danger" size="small"  @click="resetButton">重置</el-button>
14
 			<el-button type="danger" size="small"  @click="resetButton">重置</el-button>
15
 		</el-row>
15
 		</el-row>
16
-    
16
+
17
 		<el-table :data="tableData" border>
17
 		<el-table :data="tableData" border>
18
 			<el-table-column prop="id" label="编号" width="60" v-if="isShow">
18
 			<el-table-column prop="id" label="编号" width="60" v-if="isShow">
19
 			</el-table-column>
19
 			</el-table-column>
29
 			<el-table-column label="操作">
29
 			<el-table-column label="操作">
30
 				<template slot-scope="scope">
30
 				<template slot-scope="scope">
31
 					<el-button size="mini" @click="handleEdit(scope.row)">编辑</el-button>
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
 				</template>
33
 				</template>
34
 			</el-table-column>
34
 			</el-table-column>
35
 			<el-table-column label="日志记录" width="120">
35
 			<el-table-column label="日志记录" width="120">
86
 
86
 
87
 		<el-dialog title="转移数量变动日志" :visible.sync="dialogVisibleRecord" width="1000px">
87
 		<el-dialog title="转移数量变动日志" :visible.sync="dialogVisibleRecord" width="1000px">
88
 			<div class="searchForm-header">
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
 					</el-row>
121
 					</el-row>
107
-					
108
 				</el-form>
122
 				</el-form>
109
 			</div>
123
 			</div>
110
 			<el-table :data="tableData2" border>
124
 			<el-table :data="tableData2" border>
151
                 options: [],
165
                 options: [],
152
                 tableData: [],
166
                 tableData: [],
153
 				tableData2: [],
167
 				tableData2: [],
154
-
168
+        count:0,
155
                 currentPage: 1,
169
                 currentPage: 1,
156
 				totalRows: 0,
170
 				totalRows: 0,
157
 				pageSizes: [50, 100, 200,500],
171
 				pageSizes: [50, 100, 200,500],
178
                 },
192
                 },
179
                 optionsSub: [{
193
                 optionsSub: [{
180
                     value: 'up',
194
                     value: 'up',
181
-                    label: '增加'}, 
195
+                    label: '增加'},
182
                     {value: 'down',
196
                     {value: 'down',
183
                     label: '减少'
197
                     label: '减少'
184
                 }],
198
                 }],
189
 					RecordDate:[],
203
 					RecordDate:[],
190
 					subStr:'',
204
 					subStr:'',
191
 					changeFrom:'',
205
 					changeFrom:'',
206
+          remark: '',
192
 				},
207
 				},
193
 				optionsSubStr:[{
208
 				optionsSubStr:[{
194
 						value: '增加',
209
 						value: '增加',
347
 				this.dialogVisible = true
362
 				this.dialogVisible = true
348
 				this.change.id = tempRow.id
363
 				this.change.id = tempRow.id
349
 				this.change.uperCustomer = tempRow.uperCustomer.id
364
 				this.change.uperCustomer = tempRow.uperCustomer.id
350
-				this.change.Customer = ''
365
+				this.change.Customer = tempRow.customer.id
351
 				this.change.sub = ''
366
 				this.change.sub = ''
352
 				this.change.weight = ''
367
 				this.change.weight = ''
368
+        this.change.remark = ''
353
 			},
369
 			},
354
 			handleViewRecord(row){
370
 			handleViewRecord(row){
355
 				this.dialogVisibleRecord=true;
371
 				this.dialogVisibleRecord=true;
360
 				this.queryDetail.subStr='',
376
 				this.queryDetail.subStr='',
361
 				this.queryDetail.changeFrom='',
377
 				this.queryDetail.changeFrom='',
362
 				this.getTableData2(tempRow.uperCustomer.id,tempRow.customer.id)
378
 				this.getTableData2(tempRow.uperCustomer.id,tempRow.customer.id)
363
-				
379
+
364
 			},
380
 			},
365
 			getTableData2(uperCustomer,Customer){
381
 			getTableData2(uperCustomer,Customer){
366
-
382
+        this.count = 0;
367
 				var url = 'MaintCargo/queryRecord.do'
383
 				var url = 'MaintCargo/queryRecord.do'
368
 				// alert(this.queryDetail.RecordDate);
384
 				// alert(this.queryDetail.RecordDate);
369
 				if(this.queryDetail.RecordDate == null){
385
 				if(this.queryDetail.RecordDate == null){
377
 					RecordDateBegin : (!this.queryDetail.RecordDate[0]) ? "1970-01-01 00:00:00" : this.queryDetail.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"),
393
 					RecordDateBegin : (!this.queryDetail.RecordDate[0]) ? "1970-01-01 00:00:00" : this.queryDetail.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"),
378
 					RecordDateEnd : (!this.queryDetail.RecordDate[1]) ? "2999-01-01 00:00:00" : this.queryDetail.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
394
 					RecordDateEnd : (!this.queryDetail.RecordDate[1]) ? "2999-01-01 00:00:00" : this.queryDetail.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
379
 					subStr:this.queryDetail.subStr,
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
 				axios.get(url, param).then(response => {
400
 				axios.get(url, param).then(response => {
386
 					if (response.data.code == 0) {
403
 					if (response.data.code == 0) {
387
 						this.tableData2 = response.data.data.list
404
 						this.tableData2 = response.data.data.list
388
 						this.totalRows2 = response.data.data.total
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
 						//this.drawWareLayout()
418
 						//this.drawWareLayout()
390
 					} else {
419
 					} else {
391
 						this.$message({
420
 						this.$message({

+ 104
- 5
src/view/record/changerecord.vue Parādīt failu

34
 							<el-input v-model="query.model" size="small" style="width:120px;margin-left: -8px">
34
 							<el-input v-model="query.model" size="small" style="width:120px;margin-left: -8px">
35
 							</el-input>
35
 							</el-input>
36
 						</el-form-item>
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
 							<el-input v-model="query.plateNo" size="small" style="width:120px;margin-left: -8px">
38
 							<el-input v-model="query.plateNo" size="small" style="width:120px;margin-left: -8px">
39
 							</el-input>
39
 							</el-input>
40
 						</el-form-item>
40
 						</el-form-item>
44
 						</el-form-item>
44
 						</el-form-item>
45
 						<el-form-item label=" " style="margin-top: -15px">
45
 						<el-form-item label=" " style="margin-top: -15px">
46
 							<el-button @click="handleSearch" type="primary"  size="small" >查询</el-button>
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
 						</el-form-item>
48
 						</el-form-item>
48
 					</el-row>
49
 					</el-row>
49
 				</el-form>
50
 				</el-form>
102
 
103
 
103
 		<popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
104
 		<popup-material ref="PopupMaterial" @receviceFromChild="receviceFromMaterial"></popup-material>
104
 		<popup-customer ref="PopupCustomer" @receviceFromChild="receviceFromCustomer"></popup-customer>
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
 	</div>
114
 	</div>
106
 </template>
115
 </template>
107
 
116
 
151
 					plateNo: '',
160
 					plateNo: '',
152
 					RecordDate:[],
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
 		mounted() {
170
 		mounted() {
234
 					customerName: this.query.customerName,
244
 					customerName: this.query.customerName,
235
 					plateNo: this.query.plateNo,
245
 					plateNo: this.query.plateNo,
236
 					pFromDate:(!this.query.RecordDate[0]) ? "1970-01-01 00:00:00" : this.query.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"),		//date类型
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
 				this.childParam = param;
249
 				this.childParam = param;
240
 				axios.get(url, param).then(response => {
250
 				axios.get(url, param).then(response => {
253
 			},
263
 			},
254
 			changeWare(){
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
 </script>
336
 </script>
260
 
337
 
261
 <style>
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
 .searchForm-header{
361
 .searchForm-header{
263
 		/*background-color: red;*/
362
 		/*background-color: red;*/
264
 		height: auto;
363
 		height: auto;

Notiek ielāde…
Atcelt
Saglabāt